Skip to content

An open-source cross-platform alternative to AirDrop

feat: make buttons in device details bigger

Tien Do Nam5e8867e0e996
diff --git a/app/lib/pages/device_details_page.dart b/app/lib/pages/device_details_page.dart
index 2a0c34ae..ba59c262 100644
--- a/app/lib/pages/device_details_page.dart
+++ b/app/lib/pages/device_details_page.dart
@@ -79,6 +79,7 @@ class _DeviceDetailsPageState extends State<DeviceDetailsPage> with Refena {
icon: favoriteEntry != null ? Icons.favorite : Icons.favorite_border,
label: t.deviceDetailsPage.favorite,
filled: favoriteEntry != null,
+ width: 120,
onTap: () async => await _toggleFavorite(favoriteEntry),
),
const SizedBox(width: 20),
@@ -86,6 +87,7 @@ class _DeviceDetailsPageState extends State<DeviceDetailsPage> with Refena {
icon: Icons.verified_user,
label: t.deviceDetailsPage.verify,
filled: false,
+ width: 120,
onTap: () async => await context.push(() => VerifyPage(device: device)),
),
],
diff --git a/app/lib/widget/big_button.dart b/app/lib/widget/big_button.dart
index ae0f4351..63916589 100644
--- a/app/lib/widget/big_button.dart
+++ b/app/lib/widget/big_button.dart
@@ -9,12 +9,14 @@ class BigButton extends StatelessWidget {
final IconData icon;
final String label;
final bool filled;
+ final double? width;
final VoidCallback onTap;
const BigButton({
required this.icon,
required this.label,
required this.filled,
+ this.width,
required this.onTap,
});
@@ -22,7 +24,7 @@ class BigButton extends StatelessWidget {
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
final sizingInformation = SizingInformation(MediaQuery.sizeOf(context).width);
- final buttonWidth = sizingInformation.isDesktop ? desktopWidth : mobileWidth;
+ final buttonWidth = width ?? (sizingInformation.isDesktop ? desktopWidth : mobileWidth);
return SizedBox(
width: buttonWidth,
height: 65.0,