fix: icons in iconpicker per platform
This commit is contained in:
parent
4a3f097b02
commit
c7e40b12b7
2 changed files with 22 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:dynamic_color/dynamic_color.dart';
|
import 'package:dynamic_color/dynamic_color.dart';
|
||||||
import 'package:flex_color_picker/flex_color_picker.dart';
|
import 'package:flex_color_picker/flex_color_picker.dart';
|
||||||
|
@ -152,6 +153,13 @@ class _EditCategoriesViewState extends State<EditCategoriesView> {
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final icon = await showIconPicker(
|
final icon = await showIconPicker(
|
||||||
context,
|
context,
|
||||||
|
iconPackModes: [
|
||||||
|
if (!Platform.isIOS && !Platform.isMacOS)
|
||||||
|
IconPack.material,
|
||||||
|
if (Platform.isIOS || Platform.isMacOS)
|
||||||
|
IconPack.cupertino,
|
||||||
|
],
|
||||||
|
// adaptiveDialog: true,
|
||||||
);
|
);
|
||||||
if (icon != null) {
|
if (icon != null) {
|
||||||
selectedWallet!.categories[i].icon = icon;
|
selectedWallet!.categories[i].icon = icon;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:currency_picker/currency_picker.dart';
|
import 'package:currency_picker/currency_picker.dart';
|
||||||
import 'package:dynamic_color/dynamic_color.dart';
|
import 'package:dynamic_color/dynamic_color.dart';
|
||||||
|
@ -153,10 +154,11 @@ class _SetupViewState extends State<SetupView> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final wallet = Wallet(
|
final wallet = Wallet(
|
||||||
name: name,
|
name: name,
|
||||||
currency: _selectedCurrency,
|
currency: _selectedCurrency,
|
||||||
categories: categories,
|
categories: categories,
|
||||||
starterBalance: double.parse(_balanceController.text),);
|
starterBalance: double.parse(_balanceController.text),
|
||||||
|
);
|
||||||
await WalletManager.saveWallet(wallet);
|
await WalletManager.saveWallet(wallet);
|
||||||
|
|
||||||
if (widget.newWallet && context.mounted) {
|
if (widget.newWallet && context.mounted) {
|
||||||
|
@ -340,6 +342,14 @@ class _SetupViewState extends State<SetupView> {
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final icon = await showIconPicker(
|
final icon = await showIconPicker(
|
||||||
context,
|
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;
|
if (icon != null) categories[i].icon = icon;
|
||||||
final materialEnabled =
|
final materialEnabled =
|
||||||
|
|
Loading…
Reference in a new issue