Bläddra i källkod

Merge pull request #256 from ente-io/on-bording-screen-fixes

On boarding screen and other fixes
Ashil 3 år sedan
förälder
incheckning
5348a5c9a8
2 ändrade filer med 81 tillägg och 72 borttagningar
  1. 2 2
      lib/app.dart
  2. 79 70
      lib/ui/grant_permissions_widget.dart

+ 2 - 2
lib/app.dart

@@ -21,6 +21,7 @@ final lightThemeData = ThemeData(
   primaryColorLight: Colors.black54,
   iconTheme: IconThemeData(color: Colors.black),
   primaryIconTheme: IconThemeData(color: Colors.red, opacity: 1.0, size: 50.0),
+  bottomAppBarColor: Color.fromRGBO(196, 196, 196, 0.6),
   colorScheme: ColorScheme.light(
       primary: Colors.black, secondary: Color.fromARGB(255, 163, 163, 163)),
   accentColor: Color.fromRGBO(0, 0, 0, 0.6),
@@ -35,7 +36,6 @@ final lightThemeData = ThemeData(
       onPrimary: Colors.white, primary: Colors.black),
   toggleableActiveColor: Colors.green[400],
   scaffoldBackgroundColor: Colors.white,
-  bottomAppBarColor: Color.fromRGBO(196, 196, 196, 0.5),
   backgroundColor: Colors.white,
   appBarTheme: AppBarTheme().copyWith(
       backgroundColor: Colors.white,
@@ -92,7 +92,7 @@ final darkThemeData = ThemeData(
   iconTheme: IconThemeData(color: Colors.white),
   primaryIconTheme: IconThemeData(color: Colors.red, opacity: 1.0, size: 50.0),
   hintColor: Colors.grey,
-  bottomAppBarColor: Color.fromRGBO(196, 196, 196, 0.5),
+  bottomAppBarColor: Color.fromRGBO(255, 255, 255, 0.7),
 
   colorScheme: ColorScheme.dark(primary: Colors.white),
   accentColor: Color.fromRGBO(45, 194, 98, 0.2),

+ 79 - 70
lib/ui/grant_permissions_widget.dart

@@ -10,83 +10,92 @@ class GrantPermissionsWidget extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
     return Scaffold(
-      body: Column(
-        crossAxisAlignment: CrossAxisAlignment.start,
-        mainAxisAlignment: MainAxisAlignment.spaceBetween,
-        children: [
-          Column(
+      body: SingleChildScrollView(
+        child: SizedBox(
+          height: MediaQuery.of(context).size.height,
+          child: Column(
+            crossAxisAlignment: CrossAxisAlignment.start,
+            mainAxisAlignment: MainAxisAlignment.spaceBetween,
             children: [
-              Center(
-                child: Padding(
-                  padding: const EdgeInsets.symmetric(vertical: 50),
-                  child: Image.asset(
-                    "assets/gallery.png",
-                    height: 250,
+              Column(
+                children: [
+                  Center(
+                    child: Padding(
+                      padding: const EdgeInsets.symmetric(vertical: 50),
+                      child: Image.asset(
+                        "assets/gallery.png",
+                        height: 250,
+                      ),
+                    ),
                   ),
-                ),
+                  Padding(
+                    padding: const EdgeInsets.symmetric(horizontal: 20),
+                    child: Text(
+                      'Ente needs your permission to access gallery',
+                      style: Theme.of(context)
+                          .textTheme
+                          .headline4
+                          .copyWith(height: 1.4),
+                    ),
+                  ),
+                ],
               ),
-              Padding(
-                padding: const EdgeInsets.symmetric(horizontal: 20),
-                child: Text(
-                  'Ente needs your permission to access gallery',
-                  style: Theme.of(context)
-                      .textTheme
-                      .headline4
-                      .copyWith(height: 1.4),
+              Container(
+                width: double.infinity,
+                padding: EdgeInsets.only(
+                    left: 20, right: 20, bottom: Platform.isIOS ? 60 : 32),
+                child: OutlinedButton(
+                  child: Text("Grant permission"),
+                  onPressed: () async {
+                    final state = await PhotoManager.requestPermissionExtend();
+                    if (state == PermissionState.authorized ||
+                        state == PermissionState.limited) {
+                      await SyncService.instance.onPermissionGranted(state);
+                    } else if (state == PermissionState.denied) {
+                      AlertDialog alert = AlertDialog(
+                        title: Text("Please grant permissions"),
+                        content: Text(
+                            "ente can encrypt and preserve files only if you grant access to them"),
+                        actions: [
+                          TextButton(
+                            child: Text(
+                              "OK",
+                              style: Theme.of(context)
+                                  .textTheme
+                                  .subtitle1
+                                  .copyWith(
+                                      fontSize: 14,
+                                      fontWeight: FontWeight.w700),
+                            ),
+                            onPressed: () {
+                              Navigator.of(context, rootNavigator: true)
+                                  .pop('dialog');
+                              if (Platform.isIOS) {
+                                PhotoManager.openSetting();
+                              }
+                            },
+                          ),
+                        ],
+                      );
+
+                      showDialog(
+                        context: context,
+                        builder: (BuildContext context) {
+                          return BackdropFilter(
+                            filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
+                            child: alert,
+                          );
+                        },
+                        barrierColor: Colors.black12,
+                      );
+                    }
+                  },
+                  // padding: EdgeInsets.fromLTRB(12, 20, 12, 20),
                 ),
               ),
             ],
           ),
-          Container(
-            width: double.infinity,
-            padding: EdgeInsets.only(
-                left: 20, right: 20, bottom: Platform.isIOS ? 60 : 32),
-            child: OutlinedButton(
-              child: Text("Grant permission"),
-              onPressed: () async {
-                final state = await PhotoManager.requestPermissionExtend();
-                if (state == PermissionState.authorized ||
-                    state == PermissionState.limited) {
-                  await SyncService.instance.onPermissionGranted(state);
-                } else if (state == PermissionState.denied) {
-                  AlertDialog alert = AlertDialog(
-                    title: Text("Please grant permissions"),
-                    content: Text(
-                        "ente can encrypt and preserve files only if you grant access to them"),
-                    actions: [
-                      TextButton(
-                        child: Text(
-                          "OK",
-                          style: Theme.of(context).textTheme.subtitle1.copyWith(
-                              fontSize: 14, fontWeight: FontWeight.w700),
-                        ),
-                        onPressed: () {
-                          Navigator.of(context, rootNavigator: true)
-                              .pop('dialog');
-                          if (Platform.isIOS) {
-                            PhotoManager.openSetting();
-                          }
-                        },
-                      ),
-                    ],
-                  );
-
-                  showDialog(
-                    context: context,
-                    builder: (BuildContext context) {
-                      return BackdropFilter(
-                        filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
-                        child: alert,
-                      );
-                    },
-                    barrierColor: Colors.black12,
-                  );
-                }
-              },
-              // padding: EdgeInsets.fromLTRB(12, 20, 12, 20),
-            ),
-          ),
-        ],
+        ),
       ),
     );
   }