fix: edit on tap now
This commit is contained in:
parent
771f7a3555
commit
d7a8233f6b
3 changed files with 56 additions and 68 deletions
|
@ -17,6 +17,8 @@
|
||||||
- Change graph container style when using light mode
|
- Change graph container style when using light mode
|
||||||
- Make pie chart values more visible by adding the category's corresponding color as background
|
- Make pie chart values more visible by adding the category's corresponding color as background
|
||||||
- Welcome text on Setup view is now centered
|
- Welcome text on Setup view is now centered
|
||||||
|
- Editing entries is now done by tapping the entry, instead of a dedicated button
|
||||||
|
|
||||||
# 1.0.0-alpha+5
|
# 1.0.0-alpha+5
|
||||||
- Add tests
|
- Add tests
|
||||||
- Add searching through entries to homepage
|
- Add searching through entries to homepage
|
||||||
|
|
|
@ -414,45 +414,9 @@ class _HomeViewState extends State<HomeView> {
|
||||||
: groupSortOldest(a, b, locale),
|
: groupSortOldest(a, b, locale),
|
||||||
itemBuilder: (context, element) => Slidable(
|
itemBuilder: (context, element) => Slidable(
|
||||||
endActionPane: ActionPane(
|
endActionPane: ActionPane(
|
||||||
|
extentRatio: 0.3,
|
||||||
motion: const ScrollMotion(),
|
motion: const ScrollMotion(),
|
||||||
children: [
|
children: [
|
||||||
SlidableAction(
|
|
||||||
onPressed: (c) {
|
|
||||||
Navigator.of(context)
|
|
||||||
.push<WalletSingleEntry>(
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (c) =>
|
|
||||||
CreateSingleEntryView(
|
|
||||||
locale: locale,
|
|
||||||
w: selectedWallet!,
|
|
||||||
editEntry: element,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.then(
|
|
||||||
(editedEntry) {
|
|
||||||
if (editedEntry == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
selectedWallet!.entries
|
|
||||||
.remove(element);
|
|
||||||
selectedWallet!.entries
|
|
||||||
.add(editedEntry);
|
|
||||||
WalletManager.saveWallet(
|
|
||||||
selectedWallet!,
|
|
||||||
);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
backgroundColor: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.secondary,
|
|
||||||
foregroundColor: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.onSecondary,
|
|
||||||
icon: Icons.edit,
|
|
||||||
),
|
|
||||||
SlidableAction(
|
SlidableAction(
|
||||||
backgroundColor: Theme.of(context)
|
backgroundColor: Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
|
@ -512,6 +476,34 @@ class _HomeViewState extends State<HomeView> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context)
|
||||||
|
.push<WalletSingleEntry>(
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (c) =>
|
||||||
|
CreateSingleEntryView(
|
||||||
|
locale: locale,
|
||||||
|
w: selectedWallet!,
|
||||||
|
editEntry: element,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.then(
|
||||||
|
(editedEntry) {
|
||||||
|
if (editedEntry == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
selectedWallet!.entries
|
||||||
|
.remove(element);
|
||||||
|
selectedWallet!.entries
|
||||||
|
.add(editedEntry);
|
||||||
|
WalletManager.saveWallet(
|
||||||
|
selectedWallet!,
|
||||||
|
);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
leading: Container(
|
leading: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius:
|
borderRadius:
|
||||||
|
|
|
@ -167,38 +167,8 @@ class _RecurringEntriesViewState extends State<RecurringEntriesView> {
|
||||||
itemBuilder: (c, i) => Slidable(
|
itemBuilder: (c, i) => Slidable(
|
||||||
endActionPane: ActionPane(
|
endActionPane: ActionPane(
|
||||||
motion: const ScrollMotion(),
|
motion: const ScrollMotion(),
|
||||||
|
extentRatio: 0.3,
|
||||||
children: [
|
children: [
|
||||||
SlidableAction(
|
|
||||||
onPressed: (c) {
|
|
||||||
Navigator.of(context)
|
|
||||||
.push<RecurringWalletEntry>(
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (c) => CreateRecurringEntryView(
|
|
||||||
w: selectedWallet!,
|
|
||||||
locale: locale,
|
|
||||||
editEntry:
|
|
||||||
selectedWallet!.recurringEntries[i],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.then(
|
|
||||||
(editedEntry) {
|
|
||||||
if (editedEntry == null) return;
|
|
||||||
selectedWallet!.entries.remove(
|
|
||||||
selectedWallet!.recurringEntries[i],
|
|
||||||
);
|
|
||||||
selectedWallet!.entries.add(editedEntry);
|
|
||||||
WalletManager.saveWallet(selectedWallet!);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
backgroundColor:
|
|
||||||
Theme.of(context).colorScheme.secondary,
|
|
||||||
foregroundColor:
|
|
||||||
Theme.of(context).colorScheme.onSecondary,
|
|
||||||
icon: Icons.edit,
|
|
||||||
),
|
|
||||||
SlidableAction(
|
SlidableAction(
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
Theme.of(context).colorScheme.error,
|
Theme.of(context).colorScheme.error,
|
||||||
|
@ -244,6 +214,30 @@ class _RecurringEntriesViewState extends State<RecurringEntriesView> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context)
|
||||||
|
.push<RecurringWalletEntry>(
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (c) => CreateRecurringEntryView(
|
||||||
|
w: selectedWallet!,
|
||||||
|
locale: locale,
|
||||||
|
editEntry:
|
||||||
|
selectedWallet!.recurringEntries[i],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.then(
|
||||||
|
(editedEntry) {
|
||||||
|
if (editedEntry == null) return;
|
||||||
|
selectedWallet!.entries.remove(
|
||||||
|
selectedWallet!.recurringEntries[i],
|
||||||
|
);
|
||||||
|
selectedWallet!.entries.add(editedEntry);
|
||||||
|
WalletManager.saveWallet(selectedWallet!);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
leading: Container(
|
leading: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
|
Loading…
Reference in a new issue