diff --git a/firka/lib/helpers/ui/firka_card.dart b/firka/lib/helpers/ui/firka_card.dart index 9c96d7b..8dbba67 100644 --- a/firka/lib/helpers/ui/firka_card.dart +++ b/firka/lib/helpers/ui/firka_card.dart @@ -7,6 +7,7 @@ enum Attach { none, bottom, top } class FirkaCard extends StatelessWidget { final List left; final List? center; + final double? height; final List? right; final bool shadow; final Widget? extra; @@ -21,6 +22,7 @@ class FirkaCard extends StatelessWidget { this.extra, this.attached, this.color, + this.height, super.key}); @override @@ -34,6 +36,7 @@ class FirkaCard extends StatelessWidget { if (extra != null) { return SizedBox( width: MediaQuery.of(context).size.width, + height: height, child: Card( color: color ?? appStyle.colors.card, shadowColor: shadow ? null : Colors.transparent, @@ -53,7 +56,7 @@ class FirkaCard extends StatelessWidget { : defaultRounding)), ), child: Padding( - padding: const EdgeInsets.all(16.0), + padding: const EdgeInsets.all(12.0), child: Column( children: [ Row( @@ -73,6 +76,7 @@ class FirkaCard extends StatelessWidget { } else { return SizedBox( width: MediaQuery.of(context).size.width, + height: height, child: Card( color: color ?? appStyle.colors.card, shadowColor: shadow ? null : Colors.transparent, @@ -92,7 +96,7 @@ class FirkaCard extends StatelessWidget { : defaultRounding)), ), child: Padding( - padding: const EdgeInsets.all(16.0), + padding: const EdgeInsets.all(12.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/firka/lib/ui/phone/screens/settings/settings_screen.dart b/firka/lib/ui/phone/screens/settings/settings_screen.dart index 1ca4f7f..cc2c3df 100644 --- a/firka/lib/ui/phone/screens/settings/settings_screen.dart +++ b/firka/lib/ui/phone/screens/settings/settings_screen.dart @@ -229,36 +229,41 @@ class _SettingsScreenState extends State { var k = item.values[i]; if (item.values[item.activeIndex] == k) { - widgets.add(FirkaCard(left: [ + widgets.add(FirkaCard(height: 52 + 12, left: [ Text(k, style: appStyle.fonts.B_16R .apply(color: appStyle.colors.textPrimary)) ], right: [ - Checkbox( - value: true, - fillColor: WidgetStateProperty.resolveWith( - (Set states) { - return appStyle.colors.secondary; - }), - onChanged: (_) async { - setState(() { - item.activeIndex = i; - }); + SizedBox( + width: 16, + height: 16, + child: Checkbox( + value: true, + fillColor: WidgetStateProperty.resolveWith( + (Set states) { + return appStyle.colors.secondary; + }), + onChanged: (_) async { + setState(() { + item.activeIndex = i; + }); - await widget.data.isar.writeTxn(() async { - await item.save(widget.data.isar.appSettingsModels); - }); - debugPrint('Settings saved'); - }) + await widget.data.isar.writeTxn(() async { + await item.save(widget.data.isar.appSettingsModels); + }); + debugPrint('Settings saved'); + }), + ), + SizedBox(width: 8), ])); } else { widgets.add(GestureDetector( - child: FirkaCard(left: [ + child: FirkaCard(height: 52 + 12, left: [ Text(k, style: appStyle.fonts.B_16R .apply(color: appStyle.colors.textPrimary)) ], right: [ - SizedBox(height: 48), + SizedBox(height: 16 + 8), ]), onTap: () async { setState(() { @@ -380,7 +385,10 @@ class _SettingsScreenState extends State { ), Text( settings.appIcons[icon]!, - style: appStyle.fonts.B_12R, + style: appStyle.fonts.B_12R.apply( + color: active + ? appStyle.colors.textPrimary + : appStyle.colors.textSecondary), textAlign: TextAlign.center, ), ], @@ -555,7 +563,8 @@ void showSetDoubleSheet(BuildContext context, SettingsDouble setting, Center( child: Text( setting.title, - style: appStyle.fonts.B_14R, + style: appStyle.fonts.B_14R + .apply(color: appStyle.colors.textPrimary), )), Padding( padding: const EdgeInsets.symmetric(