From 42e1c85b7d2c12528be4ae667db9b3318c77bda7 Mon Sep 17 00:00:00 2001 From: Maurits van Beusekom Date: Fri, 26 Jul 2024 11:57:37 +0200 Subject: [PATCH] Fix formatting --- permission_handler_html/example/lib/main.dart | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/permission_handler_html/example/lib/main.dart b/permission_handler_html/example/lib/main.dart index cc887d50f..b5b147211 100644 --- a/permission_handler_html/example/lib/main.dart +++ b/permission_handler_html/example/lib/main.dart @@ -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 { @@ -60,7 +64,8 @@ class _PermissionState extends State { _PermissionState(this._permission); final Permission _permission; - final PermissionHandlerPlatform _permissionHandler = PermissionHandlerPlatform.instance; + final PermissionHandlerPlatform _permissionHandler = + PermissionHandlerPlatform.instance; PermissionStatus _permissionStatus = PermissionStatus.denied; @override @@ -71,9 +76,9 @@ class _PermissionState extends State { } 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() { @@ -107,7 +112,8 @@ class _PermissionState extends State { color: Colors.white, ), onPressed: () { - checkServiceStatus(context, _permission as PermissionWithService); + checkServiceStatus( + context, _permission as PermissionWithService); }) : null, onTap: () { @@ -116,9 +122,11 @@ class _PermissionState extends State { ); } - 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()), )); }