Browse Source

Fix light theme issue in existing user flow

Neeraj Gupta 3 years ago
parent
commit
0ba4d735f3

+ 6 - 0
lib/app.dart

@@ -78,6 +78,7 @@ final lightThemeData = ThemeData(
   backgroundColor: Colors.white,
   appBarTheme: AppBarTheme().copyWith(
       backgroundColor: Colors.white,
+      foregroundColor: Colors.black,
       iconTheme: IconThemeData(color: Colors.black)),
   //https://api.flutter.dev/flutter/material/TextTheme-class.html
   textTheme: TextTheme().copyWith(
@@ -108,6 +109,11 @@ final lightThemeData = ThemeData(
           color: Colors.black,
           fontSize: 16,
           fontWeight: FontWeight.w400),
+      bodyText2: TextStyle(
+          fontFamily: 'Inter-Medium',
+          color: Colors.black,
+          fontSize: 16,
+          fontWeight: FontWeight.w400),
       caption: TextStyle(color: Colors.black.withOpacity(0.7), fontSize: 14),
       overline: TextStyle(color: Colors.black.withOpacity(0.8), fontSize: 12)),
 

+ 2 - 4
lib/ui/lock_screen.dart

@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
 import 'package:flutter/widgets.dart';
 import 'package:logging/logging.dart';
 import 'package:photos/ui/app_lock.dart';
-import 'package:photos/ui/common_elements.dart';
 import 'package:photos/utils/auth_util.dart';
 
 class LockScreen extends StatefulWidget {
@@ -29,9 +28,8 @@ class _LockScreenState extends State<LockScreen> {
           width: double.infinity,
           height: 64,
           padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
-          child: button(
-            "unlock",
-            fontSize: 18,
+          child: OutlinedButton(
+            child: Text("unlock"),
             onPressed: () async {
               _showLockScreen();
             },

+ 5 - 13
lib/ui/login_page.dart

@@ -5,7 +5,6 @@ import 'package:flutter/widgets.dart';
 import 'package:photos/core/configuration.dart';
 import 'package:photos/services/user_service.dart';
 import 'package:photos/ui/common/report_bug_popup.dart';
-import 'package:photos/ui/common_elements.dart';
 import 'package:photos/ui/web_page.dart';
 import 'package:photos/utils/dialog_util.dart';
 import 'package:photos/utils/email_util.dart';
@@ -82,10 +81,10 @@ class _LoginPageState extends State<LoginPage> {
           padding: const EdgeInsets.all(12),
           child: RichText(
             text: TextSpan(
+              style:
+                  Theme.of(context).textTheme.subtitle1.copyWith(fontSize: 12),
               children: [
-                TextSpan(
-                  text: "by clicking log in, I agree to the ",
-                ),
+                TextSpan(text: "by clicking log in, I agree to the "),
                 TextSpan(
                   text: "terms of service",
                   style: TextStyle(
@@ -123,12 +122,6 @@ class _LoginPageState extends State<LoginPage> {
                     },
                 ),
               ],
-              style: TextStyle(
-                height: 1.25,
-                fontSize: 12,
-                fontFamily: 'Ubuntu',
-                color: Colors.white70,
-              ),
             ),
             textAlign: TextAlign.center,
           ),
@@ -138,8 +131,8 @@ class _LoginPageState extends State<LoginPage> {
           width: double.infinity,
           height: 64,
           padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
-          child: button(
-            "log in",
+          child: ElevatedButton(
+            child: Text("log in"),
             onPressed: _email != null && _email.isNotEmpty
                 ? () {
                     if (!isValidEmail(_email)) {
@@ -151,7 +144,6 @@ class _LoginPageState extends State<LoginPage> {
                     UserService.instance.getOtt(context, _email);
                   }
                 : null,
-            fontSize: 18,
           ),
         ),
       ],

+ 2 - 3
lib/ui/password_entry_page.dart

@@ -226,9 +226,8 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                     width: double.infinity,
                     height: 64,
                     padding: EdgeInsets.fromLTRB(40, 0, 40, 0),
-                    child: button(
-                      buttonText,
-                      fontSize: 18,
+                    child: ElevatedButton(
+                      child: Text(buttonText),
                       onPressed: _passwordController1.text.isNotEmpty &&
                               _passwordController2.text.isNotEmpty
                           ? _onButtonPress

+ 3 - 5
lib/ui/password_reentry_page.dart

@@ -4,7 +4,6 @@ import 'package:logging/logging.dart';
 import 'package:photos/core/configuration.dart';
 import 'package:photos/core/event_bus.dart';
 import 'package:photos/events/subscription_purchased_event.dart';
-import 'package:photos/ui/common_elements.dart';
 import 'package:photos/ui/recovery_page.dart';
 import 'package:photos/utils/dialog_util.dart';
 
@@ -89,12 +88,11 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
         ),
         Padding(padding: EdgeInsets.all(12)),
         Container(
-          padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
+          padding: const EdgeInsets.symmetric(horizontal: 60),
           width: double.infinity,
           height: 64,
-          child: button(
-            "log in",
-            fontSize: 18,
+          child: OutlinedButton(
+            child: Text("log in"),
             onPressed: _passwordController.text.isNotEmpty
                 ? () async {
                     final dialog =

+ 6 - 9
lib/ui/recovery_page.dart

@@ -2,7 +2,6 @@ import 'dart:ui';
 
 import 'package:flutter/material.dart';
 import 'package:photos/core/configuration.dart';
-import 'package:photos/ui/common_elements.dart';
 import 'package:photos/ui/password_entry_page.dart';
 import 'package:photos/utils/dialog_util.dart';
 import 'package:photos/utils/toast_util.dart';
@@ -59,9 +58,8 @@ class _RecoveryPageState extends State<RecoveryPage> {
             padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
             width: double.infinity,
             height: 64,
-            child: button(
-              "recover",
-              fontSize: 18,
+            child: OutlinedButton(
+              child: Text("recover"),
               onPressed: _recoveryKey.text.isNotEmpty
                   ? () async {
                       final dialog =
@@ -112,11 +110,10 @@ class _RecoveryPageState extends State<RecoveryPage> {
               child: Center(
                 child: Text(
                   "no recovery key?",
-                  style: TextStyle(
-                    decoration: TextDecoration.underline,
-                    fontSize: 12,
-                    color: Colors.white.withOpacity(0.9),
-                  ),
+                  style: Theme.of(context)
+                      .textTheme
+                      .caption
+                      .copyWith(decoration: TextDecoration.underline),
                 ),
               ),
             ),

+ 2 - 4
lib/ui/two_factor_authentication_page.dart

@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 import 'package:flutter/widgets.dart';
 import 'package:photos/services/user_service.dart';
-import 'package:photos/ui/common_elements.dart';
 import 'package:photos/ui/lifecycle_event_handler.dart';
 import 'package:pinput/pin_put/pin_put.dart';
 
@@ -112,9 +111,8 @@ class _TwoFactorAuthenticationPageState
           padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
           width: double.infinity,
           height: 64,
-          child: button(
-            "verify",
-            fontSize: 18,
+          child: OutlinedButton(
+            child: Text("verify"),
             onPressed: _code.length == 6
                 ? () async {
                     _verifyTwoFactorCode(_code);