Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanbeusekom committed Jul 26, 2024
1 parent 19ab0e3 commit 42e1c85
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions permission_handler_html/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,21 @@ void main() {
}

///Defines the main theme color
final MaterialColor themeMaterialColor = BaseflowPluginExample.createMaterialColor(const Color.fromRGBO(48, 49, 60, 1));
final MaterialColor themeMaterialColor =
BaseflowPluginExample.createMaterialColor(
const Color.fromRGBO(48, 49, 60, 1));

/// A Flutter application demonstrating the functionality of this plugin
class PermissionHandlerWidget extends StatefulWidget {
/// Create a page containing the functionality of this plugin
static ExamplePage createPage() {
return ExamplePage(Icons.location_on, (context) => PermissionHandlerWidget());
return ExamplePage(
Icons.location_on, (context) => PermissionHandlerWidget());
}

@override
_PermissionHandlerWidgetState createState() => _PermissionHandlerWidgetState();
_PermissionHandlerWidgetState createState() =>
_PermissionHandlerWidgetState();
}

class _PermissionHandlerWidgetState extends State<PermissionHandlerWidget> {
Expand Down Expand Up @@ -60,7 +64,8 @@ class _PermissionState extends State<PermissionWidget> {
_PermissionState(this._permission);

final Permission _permission;
final PermissionHandlerPlatform _permissionHandler = PermissionHandlerPlatform.instance;
final PermissionHandlerPlatform _permissionHandler =
PermissionHandlerPlatform.instance;
PermissionStatus _permissionStatus = PermissionStatus.denied;

@override
Expand All @@ -71,9 +76,9 @@ class _PermissionState extends State<PermissionWidget> {
}

void _listenForPermissionStatus() async {
await _permissionHandler
.checkPermissionStatus(_permission)
.then((status) => setState(() => _permissionStatus = status), onError: (error, st) => print('$error'));
await _permissionHandler.checkPermissionStatus(_permission).then(
(status) => setState(() => _permissionStatus = status),
onError: (error, st) => print('$error'));
}

Color getPermissionColor() {
Expand Down Expand Up @@ -107,7 +112,8 @@ class _PermissionState extends State<PermissionWidget> {
color: Colors.white,
),
onPressed: () {
checkServiceStatus(context, _permission as PermissionWithService);
checkServiceStatus(
context, _permission as PermissionWithService);
})
: null,
onTap: () {
Expand All @@ -116,9 +122,11 @@ class _PermissionState extends State<PermissionWidget> {
);
}

void checkServiceStatus(BuildContext context, PermissionWithService permission) async {
void checkServiceStatus(
BuildContext context, PermissionWithService permission) async {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text((await _permissionHandler.checkServiceStatus(permission)).toString()),
content: Text(
(await _permissionHandler.checkServiceStatus(permission)).toString()),
));
}

Expand Down

0 comments on commit 42e1c85

Please sign in to comment.