Jelajahi Sumber

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

On boarding screen fixes
Neeraj Gupta 3 tahun lalu
induk
melakukan
0e44e7fc25

+ 3 - 0
.gitmodules

@@ -10,3 +10,6 @@
 	path = thirdparty/sentry-dart
 	url = https://github.com/ente-io/sentry-dart.git
 
+[submodule "thirdparty/extended_image"]
+    path = thirdparty/extended_image
+    url = https://github.com/ente-io/extended_image.git

+ 18 - 2
lib/ui/common/dynamicFAB.dart

@@ -35,7 +35,7 @@ class DynamicFAB extends StatelessWidget {
           mainAxisAlignment: MainAxisAlignment.end,
           children: [
             FloatingActionButton(
-                //mini: true,
+                heroTag: 'FAB',
                 backgroundColor:
                     Theme.of(context).colorScheme.dynamicFABBackgroundColor,
                 foregroundColor:
@@ -62,7 +62,6 @@ class DynamicFAB extends StatelessWidget {
         height: 56,
         padding: EdgeInsets.symmetric(horizontal: 20),
         child: OutlinedButton(
-          //style: Theme.of(context).elevatedButtonTheme.style,
           onPressed: isFormValid //var here
               ? onPressedFunction
               : null,
@@ -72,3 +71,20 @@ class DynamicFAB extends StatelessWidget {
     }
   }
 }
+
+class NoScalingAnimation extends FloatingActionButtonAnimator {
+  @override
+  Offset getOffset({Offset begin, Offset end, double progress}) {
+    return end;
+  }
+
+  @override
+  Animation<double> getRotationAnimation({Animation<double> parent}) {
+    return Tween<double>(begin: 1.0, end: 1.0).animate(parent);
+  }
+
+  @override
+  Animation<double> getScaleAnimation({Animation<double> parent}) {
+    return Tween<double>(begin: 1.0, end: 1.0).animate(parent);
+  }
+}

+ 17 - 42
lib/ui/email_entry_page.dart

@@ -100,22 +100,22 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
       ),
     );
     return Scaffold(
-        appBar: appBar,
-        body: _getBody(),
-        floatingActionButton: DynamicFAB(
-          isKeypadOpen: isKeypadOpen,
-          isFormValid: _isFormValid(),
-          buttonText: 'Create Account',
-          onPressedFunction: () {
-            _config.setVolatilePassword(_passwordController1.text);
-            _config.setEmail(_email);
-            UserService.instance
-                .getOtt(context, _email, isCreateAccountScreen: true);
-          },
-        ),
-        floatingActionButtonLocation: fabLocation()
-        // resizeToAvoidBottomInset: false,
-        );
+      appBar: appBar,
+      body: _getBody(),
+      floatingActionButton: DynamicFAB(
+        isKeypadOpen: isKeypadOpen,
+        isFormValid: _isFormValid(),
+        buttonText: 'Create account',
+        onPressedFunction: () {
+          _config.setVolatilePassword(_passwordController1.text);
+          _config.setEmail(_email);
+          UserService.instance
+              .getOtt(context, _email, isCreateAccountScreen: true);
+        },
+      ),
+      floatingActionButtonLocation: fabLocation(),
+      floatingActionButtonAnimator: NoScalingAnimation(),
+    );
   }
 
   Widget _getBody() {
@@ -355,24 +355,8 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                                                       10, 0, 8, 0),
                                               child: Row(
                                                 children: [
-                                                  // Container(
-                                                  //   child:
-                                                  //       _capitalLetterIsPresent
-                                                  //           ? Icon(
-                                                  //               Icons.check,
-                                                  //               color: CupertinoColors
-                                                  //                   .systemGrey2,
-                                                  //             )
-                                                  //           : Icon(
-                                                  //               Icons.check,
-                                                  //               color: Theme.of(
-                                                  //                       context)
-                                                  //                   .dialogTheme
-                                                  //                   .backgroundColor,
-                                                  //             ),
-                                                  // ),
                                                   Text(
-                                                    'Password Strength: $passwordStrengthText',
+                                                    'Password strength: $passwordStrengthText',
                                                     style: TextStyle(
                                                         color:
                                                             passwordStrengthColor),
@@ -551,15 +535,6 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
     );
   }
 
-  // bool _isFormValid() {
-  //   return _email != null &&
-  //       _email.isNotEmpty &&
-  //       _passwordController1.text.isNotEmpty &&
-  //       _passwordController2.text.isNotEmpty &&
-  //       _hasAgreedToTOS &&
-  //       _hasAgreedToE2E;
-  // }
-
   bool _isFormValid() {
     return _emailIsValid &&
         _passwordsMatch &&

+ 2 - 2
lib/ui/grant_permissions_widget.dart

@@ -28,7 +28,7 @@ class GrantPermissionsWidget extends StatelessWidget {
               Padding(
                 padding: const EdgeInsets.symmetric(horizontal: 20),
                 child: Text(
-                  'ente needs your permission to access gallery',
+                  'Ente needs your permission to access gallery',
                   style: Theme.of(context)
                       .textTheme
                       .headline4
@@ -42,7 +42,7 @@ class GrantPermissionsWidget extends StatelessWidget {
             padding: EdgeInsets.only(
                 left: 20, right: 20, bottom: Platform.isIOS ? 60 : 32),
             child: OutlinedButton(
-              child: Text("Grant Permission"),
+              child: Text("Grant permission"),
               onPressed: () async {
                 final state = await PhotoManager.requestPermissionExtend();
                 if (state == PermissionState.authorized ||

+ 8 - 8
lib/ui/landing_page_widget.dart

@@ -35,7 +35,7 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
               TextSpan(
                 children: const <TextSpan>[
                   TextSpan(
-                    text: "with ",
+                    text: "With ",
                     style: TextStyle(
                       fontSize: 16,
                     ),
@@ -105,7 +105,7 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
                   style:
                       Theme.of(context).colorScheme.optionalActionButtonStyle,
                   child: Text(
-                    "Existing User",
+                    "Existing user",
                   ),
                   onPressed: _navigateToSignInPage,
                 ),
@@ -148,15 +148,15 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
         children: const [
           FeatureItemWidget(
               "assets/protected.png",
-              "protected",
-              "end-to-end encrypted with your password,",
+              "Protected",
+              "End-to-end encrypted with your password,",
               "visible only to you"),
-          FeatureItemWidget("assets/synced.png", "synced",
-              "available across all your devices,", "web, android and ios"),
+          FeatureItemWidget("assets/synced.png", "Synced",
+              "Available across all your devices,", "web, android and ios"),
           FeatureItemWidget(
               "assets/preserved.png",
-              "preserved",
-              "reliably replicated to a fallout shelter,",
+              "Preserved",
+              "Reliably replicated to a fallout shelter,",
               "designed to outlive"),
         ],
         onPageChanged: (index) {

+ 22 - 20
lib/ui/login_page.dart

@@ -40,28 +40,30 @@ class _LoginPageState extends State<LoginPage> {
     }
 
     return Scaffold(
-        appBar: AppBar(
-          elevation: 0,
-          leading: IconButton(
-            icon: Icon(Icons.arrow_back),
-            color: Theme.of(context).iconTheme.color,
-            onPressed: () {
-              Navigator.of(context).pop();
-            },
-          ),
-        ),
-        body: _getBody(),
-        floatingActionButton: DynamicFAB(
-          isKeypadOpen: isKeypadOpen,
-          isFormValid: _emailIsValid,
-          buttonText: 'Log in',
-          onPressedFunction: () {
-            _config.setEmail(_email);
-            UserService.instance
-                .getOtt(context, _email, isCreateAccountScreen: false);
+      appBar: AppBar(
+        elevation: 0,
+        leading: IconButton(
+          icon: Icon(Icons.arrow_back),
+          color: Theme.of(context).iconTheme.color,
+          onPressed: () {
+            Navigator.of(context).pop();
           },
         ),
-        floatingActionButtonLocation: fabLocation());
+      ),
+      body: _getBody(),
+      floatingActionButton: DynamicFAB(
+        isKeypadOpen: isKeypadOpen,
+        isFormValid: _emailIsValid,
+        buttonText: 'Log in',
+        onPressedFunction: () {
+          _config.setEmail(_email);
+          UserService.instance
+              .getOtt(context, _email, isCreateAccountScreen: false);
+        },
+      ),
+      floatingActionButtonLocation: fabLocation(),
+      floatingActionButtonAnimator: NoScalingAnimation(),
+    );
   }
 
   Widget _getBody() {

+ 1 - 0
lib/ui/ott_verification_page.dart

@@ -77,6 +77,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
         },
       ),
       floatingActionButtonLocation: fabLocation(),
+      floatingActionButtonAnimator: NoScalingAnimation(),
     );
   }
 

+ 1 - 0
lib/ui/password_entry_page.dart

@@ -121,6 +121,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
             }
           }),
       floatingActionButtonLocation: fabLocation(),
+      floatingActionButtonAnimator: NoScalingAnimation(),
     );
   }
 

+ 35 - 66
lib/ui/password_reentry_page.dart

@@ -1,5 +1,4 @@
 import 'package:flutter/material.dart';
-import 'package:flutter/widgets.dart';
 import 'package:logging/logging.dart';
 import 'package:photos/core/configuration.dart';
 import 'package:photos/core/event_bus.dart';
@@ -44,41 +43,42 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
     }
 
     return Scaffold(
-        appBar: AppBar(
-          elevation: 0,
-          leading: IconButton(
-            icon: Icon(Icons.arrow_back),
-            color: Theme.of(context).iconTheme.color,
-            onPressed: () {
-              Navigator.of(context).pop();
-            },
-          ),
-        ),
-        body: _getBody(),
-        floatingActionButton: DynamicFAB(
-          isKeypadOpen: isKeypadOpen,
-          isFormValid: _passwordController.text.isNotEmpty,
-          buttonText: 'Log in',
-          onPressedFunction: () async {
-            final dialog = createProgressDialog(context, "Please wait...");
-            await dialog.show();
-            try {
-              await Configuration.instance.decryptAndSaveSecrets(
-                  _passwordController.text,
-                  Configuration.instance.getKeyAttributes());
-            } catch (e) {
-              Logger("PRP").warning(e);
-              await dialog.hide();
-              showErrorDialog(
-                  context, "incorrect password", "please try again");
-              return;
-            }
-            await dialog.hide();
-            Bus.instance.fire(SubscriptionPurchasedEvent());
-            Navigator.of(context).popUntil((route) => route.isFirst);
+      appBar: AppBar(
+        elevation: 0,
+        leading: IconButton(
+          icon: Icon(Icons.arrow_back),
+          color: Theme.of(context).iconTheme.color,
+          onPressed: () {
+            Navigator.of(context).pop();
           },
         ),
-        floatingActionButtonLocation: fabLocation());
+      ),
+      body: _getBody(),
+      floatingActionButton: DynamicFAB(
+        isKeypadOpen: isKeypadOpen,
+        isFormValid: _passwordController.text.isNotEmpty,
+        buttonText: 'Log in',
+        onPressedFunction: () async {
+          final dialog = createProgressDialog(context, "Please wait...");
+          await dialog.show();
+          try {
+            await Configuration.instance.decryptAndSaveSecrets(
+                _passwordController.text,
+                Configuration.instance.getKeyAttributes());
+          } catch (e) {
+            Logger("PRP").warning(e);
+            await dialog.hide();
+            showErrorDialog(context, "Incorrect password", "Please try again");
+            return;
+          }
+          await dialog.hide();
+          Bus.instance.fire(SubscriptionPurchasedEvent());
+          Navigator.of(context).popUntil((route) => route.isFirst);
+        },
+      ),
+      floatingActionButtonLocation: fabLocation(),
+      floatingActionButtonAnimator: NoScalingAnimation(),
+    );
   }
 
   Widget _getBody() {
@@ -159,7 +159,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
                       },
                       child: Container(
                         child: Center(
-                          child: Text("forgot password",
+                          child: Text("Forgot password",
                               style: Theme.of(context)
                                   .textTheme
                                   .subtitle1
@@ -198,37 +198,6 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
             ],
           ),
         ),
-        // Padding(padding: EdgeInsets.all(12)),
-        // Container(
-        //   padding: const EdgeInsets.symmetric(horizontal: 60),
-        //   width: double.infinity,
-        //   height: 64,
-        //   child: OutlinedButton(
-        //     child: Text("log in"),
-        //     onPressed: _passwordController.text.isNotEmpty
-        //         ? () async {
-        //             final dialog =
-        //                 createProgressDialog(context, "Please wait...");
-        //             await dialog.show();
-        //             try {
-        //               await Configuration.instance.decryptAndSaveSecrets(
-        //                   _passwordController.text,
-        //                   Configuration.instance.getKeyAttributes());
-        //             } catch (e) {
-        //               Logger("PRP").warning(e);
-        //               await dialog.hide();
-        //               showErrorDialog(
-        //                   context, "incorrect password", "please try again");
-        //               return;
-        //             }
-        //             await dialog.hide();
-        //             Bus.instance.fire(SubscriptionPurchasedEvent());
-        //             Navigator.of(context).popUntil((route) => route.isFirst);
-        //           }
-        //         : null,
-        //   ),
-        // ),
-        // Padding(padding: EdgeInsets.all(30)),
       ],
     );
   }

+ 2 - 2
lib/ui/payment/stripe_subscription_page.dart

@@ -451,7 +451,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
       child: Row(
         mainAxisAlignment: MainAxisAlignment.center,
         children: [
-          _planText("monthly", _showYearlyPlan),
+          _planText("Monthly", _showYearlyPlan),
           Switch(
             value: _showYearlyPlan,
             activeColor: Colors.white,
@@ -461,7 +461,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
               await _filterStripeForUI();
             },
           ),
-          _planText("yearly", !_showYearlyPlan)
+          _planText("Yearly", !_showYearlyPlan)
         ],
       ),
     );

+ 2 - 7
lib/ui/payment/subscription_common_widgets.dart

@@ -26,13 +26,8 @@ class _SubscriptionHeaderWidgetState extends State<SubscriptionHeaderWidget> {
       return Padding(
         padding: const EdgeInsets.fromLTRB(20, 20, 20, 24),
         child: Text(
-          "ente preserves your memories, so they're always available to you, even if you lose your device",
-          style: Theme.of(context).textTheme.caption
-          /*style: TextStyle(
-            color: Colors.white54,
-            height: 1.2,
-          )*/
-          ,
+          "Ente preserves your memories, so they're always available to you, even if you lose your device",
+          style: Theme.of(context).textTheme.caption,
         ),
       );
     } else {

+ 1 - 1
lib/ui/recovery_key_page.dart

@@ -167,7 +167,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
 
     childrens.add(GradientButton(
       child: Text(
-        'Save Key',
+        'Save key',
         style: gradientButtonTextTheme(),
       ),
       linearGradientColors: const [

+ 3 - 2
lib/ui/recovery_page.dart

@@ -63,6 +63,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
             }
           }),
       floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
+      floatingActionButtonAnimator: NoScalingAnimation(),
       body: Column(
         children: [
           Expanded(
@@ -71,7 +72,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
                 Padding(
                   padding:
                       const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
-                  child: Text('Forgot Password',
+                  child: Text('Forgot password',
                       style: Theme.of(context).textTheme.headline4),
                 ),
                 Padding(
@@ -120,7 +121,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
                         padding: EdgeInsets.symmetric(horizontal: 20),
                         child: Center(
                           child: Text(
-                            "no recovery key?",
+                            "No recovery key?",
                             style: Theme.of(context)
                                 .textTheme
                                 .subtitle1