forked from firka/firka
@@ -7,6 +7,7 @@ enum Attach { none, bottom, top }
|
||||
class FirkaCard extends StatelessWidget {
|
||||
final List<Widget> left;
|
||||
final List<Widget>? center;
|
||||
final double? height;
|
||||
final List<Widget>? 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: [
|
||||
|
||||
@@ -229,36 +229,41 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
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<Color>(
|
||||
(Set<WidgetState> states) {
|
||||
return appStyle.colors.secondary;
|
||||
}),
|
||||
onChanged: (_) async {
|
||||
setState(() {
|
||||
item.activeIndex = i;
|
||||
});
|
||||
SizedBox(
|
||||
width: 16,
|
||||
height: 16,
|
||||
child: Checkbox(
|
||||
value: true,
|
||||
fillColor: WidgetStateProperty.resolveWith<Color>(
|
||||
(Set<WidgetState> 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<SettingsScreen> {
|
||||
),
|
||||
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(
|
||||
|
||||
Reference in New Issue
Block a user