An open-source cross-platform alternative to AirDrop
feat: improve desktop padding style
Tien Do Name82784661979
diff --git a/app/lib/config/theme.dart b/app/lib/config/theme.dartindex a284902e..8af28ef8 100644--- a/app/lib/config/theme.dart+++ b/app/lib/config/theme.dart@@ -10,9 +10,6 @@ import 'package:yaru/yaru.dart' as yaru;final _borderRadius = BorderRadius.circular(5);-/// On desktop, we need to add additional padding to achieve the same visual appearance as on mobile-double get desktopPaddingFix => checkPlatformIsDesktop() ? 8 : 0;-ThemeData getTheme(ColorMode colorMode, Brightness brightness, DynamicColors? dynamicColors) {if (colorMode == ColorMode.yaru) {return _getYaruTheme(brightness);@@ -55,6 +52,8 @@ ThemeData getTheme(ColorMode colorMode, Brightness brightness, DynamicColors? dyreturn ThemeData(colorScheme: colorScheme,useMaterial3: true,+ // same density on all platforms so desktop matches mobile (defaults to compact on desktop)+ visualDensity: VisualDensity.standard,navigationBarTheme: colorScheme.brightness == Brightness.dark? NavigationBarThemeData(iconTheme: WidgetStateProperty.all(const IconThemeData(color: Colors.white)),@@ -71,12 +70,12 @@ ThemeData getTheme(ColorMode colorMode, Brightness brightness, DynamicColors? dyelevatedButtonTheme: ElevatedButtonThemeData(style: ElevatedButton.styleFrom(foregroundColor: colorScheme.brightness == Brightness.dark ? Colors.white : null,- padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8 + desktopPaddingFix),+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),),),textButtonTheme: TextButtonThemeData(style: TextButton.styleFrom(- padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8 + desktopPaddingFix),+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),),),fontFamily: fontFamily,@@ -176,6 +175,8 @@ ThemeData _getYaruTheme(Brightness brightness) {InputDecorationThemeData;return baseTheme.copyWith(+ // same density on all platforms so desktop matches mobile (defaults to compact on desktop)+ visualDensity: VisualDensity.standard,navigationBarTheme: colorScheme.brightness == Brightness.dark? NavigationBarThemeData(iconTheme: WidgetStateProperty.all(const IconThemeData(color: Colors.white)),@@ -192,12 +193,12 @@ ThemeData _getYaruTheme(Brightness brightness) {elevatedButtonTheme: ElevatedButtonThemeData(style: ElevatedButton.styleFrom(foregroundColor: colorScheme.brightness == Brightness.dark ? Colors.white : null,- padding: checkPlatformIsDesktop() ? const EdgeInsets.all(16) : const EdgeInsets.symmetric(horizontal: 16, vertical: 8),+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),),),textButtonTheme: TextButtonThemeData(style: TextButton.styleFrom(- padding: checkPlatformIsDesktop() ? const EdgeInsets.all(16) : const EdgeInsets.symmetric(horizontal: 16, vertical: 8),+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),),),);diff --git a/app/lib/widget/big_button.dart b/app/lib/widget/big_button.dartindex c957cf3b..ae0f4351 100644--- a/app/lib/widget/big_button.dart+++ b/app/lib/widget/big_button.dart@@ -33,7 +33,7 @@ class BigButton extends StatelessWidget {shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10),),- padding: EdgeInsets.only(left: 2, right: 2, top: 10 + desktopPaddingFix, bottom: 8 + desktopPaddingFix),+ padding: const EdgeInsets.only(left: 2, right: 2, top: 10, bottom: 8),),onPressed: onTap,child: Column(