fix: icons in iconpicker per platform

This commit is contained in:
Matyáš Caras 2024-02-26 22:59:08 +01:00
parent 4a3f097b02
commit c7e40b12b7
Signed by untrusted user who does not match committer: hernik
GPG key ID: 2A3175F98820C5C6
2 changed files with 22 additions and 4 deletions

View file

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'package:dynamic_color/dynamic_color.dart';
import 'package:flex_color_picker/flex_color_picker.dart';
@ -152,6 +153,13 @@ class _EditCategoriesViewState extends State<EditCategoriesView> {
onTap: () async {
final icon = await showIconPicker(
context,
iconPackModes: [
if (!Platform.isIOS && !Platform.isMacOS)
IconPack.material,
if (Platform.isIOS || Platform.isMacOS)
IconPack.cupertino,
],
// adaptiveDialog: true,
);
if (icon != null) {
selectedWallet!.categories[i].icon = icon;

View file

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'package:currency_picker/currency_picker.dart';
import 'package:dynamic_color/dynamic_color.dart';
@ -153,10 +154,11 @@ class _SetupViewState extends State<SetupView> {
return;
}
final wallet = Wallet(
name: name,
currency: _selectedCurrency,
categories: categories,
starterBalance: double.parse(_balanceController.text),);
name: name,
currency: _selectedCurrency,
categories: categories,
starterBalance: double.parse(_balanceController.text),
);
await WalletManager.saveWallet(wallet);
if (widget.newWallet && context.mounted) {
@ -340,6 +342,14 @@ class _SetupViewState extends State<SetupView> {
onTap: () async {
final icon = await showIconPicker(
context,
iconPackModes: [
if (!Platform.isIOS &&
!Platform.isMacOS)
IconPack.material,
if (Platform.isIOS || Platform.isMacOS)
IconPack.cupertino,
],
// adaptiveDialog: true,
);
if (icon != null) categories[i].icon = icon;
final materialEnabled =