Explorar el Código

fixed build errors

ashilkn hace 3 años
padre
commit
ca6209410b

+ 9 - 0
lib/ente_theme_data.dart

@@ -83,3 +83,12 @@ ElevatedButtonThemeData buildElevatedButtonThemeData(
     ),
   ));
 }
+
+TextStyle gradientButtonTextTheme() {
+  return TextStyle(
+    color: Colors.white,
+    fontWeight: FontWeight.w600,
+    fontFamily: 'Inter-SemiBold',
+    fontSize: 18,
+  );
+}

+ 1 - 1
lib/ui/common/gradientButton.dart

@@ -22,7 +22,7 @@ class GradientButton extends StatelessWidget {
           ),
           borderRadius: BorderRadius.circular(8),
         ),
-        child: child,
+        child: Center(child: child),
       ),
     );
   }

+ 4 - 5
lib/ui/gallery_footer_widget.dart

@@ -26,11 +26,10 @@ class GalleryFooterWidget extends StatelessWidget {
               color: Colors.white,
             ),
             Padding(padding: EdgeInsets.all(6)),
-            Text("Preserve more",
-                style: Theme.of(context)
-                    .textTheme
-                    .headline6
-                    .copyWith(color: Colors.white)),
+            Text(
+              "Preserve more",
+              style: gradientButtonTextTheme(),
+            ),
           ],
         ),
         linearGradientColors: const [

+ 24 - 5
lib/ui/landing_page_widget.dart

@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
 import 'package:flutter/widgets.dart';
 import 'package:photos/core/configuration.dart';
 import 'package:photos/ente_theme_data.dart';
+import 'package:photos/ui/common/gradientButton.dart';
 import 'package:photos/ui/email_entry_page.dart';
 import 'package:photos/ui/login_page.dart';
 import 'package:photos/ui/password_entry_page.dart';
@@ -122,16 +123,34 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
   Widget _getSignUpButton(BuildContext context) {
     return Container(
       width: double.infinity,
-      padding: EdgeInsets.symmetric(horizontal: 24),
-      child: ElevatedButton(
-        style: Theme.of(context).colorScheme.primaryActionButtonStyle,
+      padding: EdgeInsets.symmetric(horizontal: 20),
+      child: GradientButton(
         child: Hero(
           tag: "sign_up",
-          child: Text("New to ente"),
+          child: Text(
+            "New to ente",
+            style: gradientButtonTextTheme(),
+          ),
         ),
-        onPressed: _navigateToSignUpPage,
+        linearGradientColors: const [
+          Color(0xFF2CD267),
+          Color(0xFF1DB954),
+        ],
+        onTap: _navigateToSignUpPage,
       ),
     );
+    // return Container(
+    //   width: double.infinity,
+    //   padding: EdgeInsets.symmetric(horizontal: 24),
+    // child: ElevatedButton(
+    //   style: Theme.of(context).colorScheme.primaryActionButtonStyle,
+    //   child: Hero(
+    //     tag: "sign_up",
+    //     child: Text("New to ente"),
+    //   ),
+    //   onPressed: _navigateToSignUpPage,
+    // ),
+    //);
   }
 
   Widget _getFeatureSlider() {

+ 11 - 5
lib/ui/recovery_key_page.dart

@@ -8,6 +8,7 @@ import 'package:flutter/services.dart';
 import 'package:photos/core/configuration.dart';
 import 'package:photos/core/constants.dart';
 import 'package:photos/ente_theme_data.dart';
+import 'package:photos/ui/common/gradientButton.dart';
 import 'package:photos/utils/toast_util.dart';
 import 'package:share_plus/share_plus.dart';
 
@@ -162,10 +163,16 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
       childrens.add(SizedBox(height: 10));
     }
 
-    childrens.add(ElevatedButton(
-      child: Text('Save'),
-      style: Theme.of(context).colorScheme.primaryActionButtonStyle,
-      onPressed: () async {
+    childrens.add(GradientButton(
+      child: Text(
+        'Save',
+        style: gradientButtonTextTheme(),
+      ),
+      linearGradientColors: const [
+        Color(0xFF2CD267),
+        Color(0xFF1DB954),
+      ],
+      onTap: () async {
         await _shareRecoveryKey(recoveryKey);
       },
     ));
@@ -173,7 +180,6 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
       childrens.add(SizedBox(height: 10));
       childrens.add(ElevatedButton(
         child: Text(widget.doneText),
-        // style: Theme.of(context).colorScheme.primaryActionButtonStyle,
         onPressed: () async {
           await _saveKeys();
         },