Browse Source

GradientButton: Fix padding between icon and text

Neeraj Gupta 2 năm trước cách đây
mục cha
commit
01a0ab046f

+ 0 - 1
lib/ui/account/delete_account_page.dart

@@ -75,7 +75,6 @@ class DeleteAccountPage extends StatelessWidget {
               ),
               GradientButton(
                 text: "Yes, send feedback",
-                paddingValue: 4,
                 iconData: Icons.check,
                 onTap: () async {
                   await sendEmail(

+ 0 - 1
lib/ui/account/verify_recovery_page.dart

@@ -201,7 +201,6 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
                               GradientButton(
                                 onTap: _verifyRecoveryKey,
                                 text: "Verify",
-                                paddingValue: 6,
                                 iconData: Icons.shield_outlined,
                               ),
                               const SizedBox(height: 8),

+ 5 - 1
lib/ui/common/gradient_button.dart

@@ -6,10 +6,13 @@ class GradientButton extends StatelessWidget {
   final List<Color> linearGradientColors;
   final Function onTap;
   final Widget child;
+
   // text is ignored if child is specified
   final String text;
+
   // nullable
   final IconData iconData;
+
   // padding between the text and icon
   final double paddingValue;
 
@@ -48,9 +51,10 @@ class GradientButton extends StatelessWidget {
         children: [
           Icon(
             iconData,
+            size: 20,
             color: Colors.white,
           ),
-          Padding(padding: EdgeInsets.all(paddingValue)),
+          const Padding(padding: EdgeInsets.symmetric(horizontal: 6)),
           Text(
             text,
             style: const TextStyle(

+ 0 - 1
lib/ui/create_collection_page.dart

@@ -95,7 +95,6 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
                       _showNameAlbumDialog();
                     },
                     iconData: Icons.create_new_folder_outlined,
-                    paddingValue: 6,
                     text: "To a new album",
                   ),
                 ),

+ 0 - 2
lib/ui/shared_collections_gallery.dart

@@ -191,7 +191,6 @@ class _SharedCollectionGalleryState extends State<SharedCollectionGallery>
                 shareText("Check out https://ente.io");
               },
               iconData: Icons.outgoing_mail,
-              paddingValue: 2,
               text: "Invite",
             ),
           ),
@@ -227,7 +226,6 @@ class _SharedCollectionGalleryState extends State<SharedCollectionGallery>
                 );
               },
               iconData: Icons.person_add,
-              paddingValue: 2,
               text: "Share",
             ),
           ),

+ 0 - 1
lib/ui/tools/lock_screen.dart

@@ -42,7 +42,6 @@ class _LockScreenState extends State<LockScreen> {
                   child: GradientButton(
                     text: "Unlock",
                     iconData: Icons.lock_open_outlined,
-                    paddingValue: 6,
                     onTap: () async {
                       _showLockScreen();
                     },

+ 0 - 1
lib/ui/viewer/gallery/gallery_footer_widget.dart

@@ -27,7 +27,6 @@ class GalleryFooterWidget extends StatelessWidget {
             );
           }
         },
-        paddingValue: 6,
         text: "Preserve more",
         iconData: Icons.cloud_upload_outlined,
       ),