improve delete-key flow
This commit is contained in:
parent
1d2f4f70c8
commit
9db49a4164
@ -79,7 +79,7 @@ class _KeyTokenListPageState extends State<KeyTokenListPage> {
|
|||||||
child: PagedListView<int, KeyToken>(
|
child: PagedListView<int, KeyToken>(
|
||||||
pagingController: _pagingController,
|
pagingController: _pagingController,
|
||||||
builderDelegate: PagedChildBuilderDelegate<KeyToken>(
|
builderDelegate: PagedChildBuilderDelegate<KeyToken>(
|
||||||
itemBuilder: (context, item, index) => KeyTokenListItem(item: item),
|
itemBuilder: (context, item, index) => KeyTokenListItem(item: item, needsReload: _fullRefresh),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -107,4 +107,9 @@ class _KeyTokenListPageState extends State<KeyTokenListPage> {
|
|||||||
builder: (context) => KeyTokenCreatedModal(keytoken: token, tokenValue: tokValue),
|
builder: (context) => KeyTokenCreatedModal(keytoken: token, tokenValue: tokValue),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _fullRefresh() {
|
||||||
|
ApplicationLog.debug('KeytokenListPage::fullRefresh');
|
||||||
|
_pagingController.refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,10 +17,12 @@ enum KeyTokenListItemMode {
|
|||||||
class KeyTokenListItem extends StatelessWidget {
|
class KeyTokenListItem extends StatelessWidget {
|
||||||
const KeyTokenListItem({
|
const KeyTokenListItem({
|
||||||
required this.item,
|
required this.item,
|
||||||
|
required this.needsReload,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
final KeyToken item;
|
final KeyToken item;
|
||||||
|
final void Function()? needsReload;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -32,7 +34,7 @@ class KeyTokenListItem extends StatelessWidget {
|
|||||||
color: Theme.of(context).cardTheme.color,
|
color: Theme.of(context).cardTheme.color,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navi.push(context, () => KeyTokenViewPage(keytokenID: item.keytokenID, preloadedData: item, needsReload: null));
|
Navi.push(context, () => KeyTokenViewPage(keytokenID: item.keytokenID, preloadedData: item, needsReload: needsReload));
|
||||||
},
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
|
@ -535,7 +535,7 @@ class _KeyTokenViewPageState extends State<KeyTokenViewPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final r = await UIDialogs.showConfirmDialog(context, 'Really (permanently) delete this Key?', okText: 'Unsubscribe', cancelText: 'Cancel');
|
final r = await UIDialogs.showConfirmDialog(context, 'Really (permanently) delete this Key?', okText: 'Delete', cancelText: 'Cancel');
|
||||||
if (!r) return;
|
if (!r) return;
|
||||||
|
|
||||||
await APIClient.deleteKeyToken(acc, keytokenPreview!.keytokenID);
|
await APIClient.deleteKeyToken(acc, keytokenPreview!.keytokenID);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user