some async refactorings

This commit is contained in:
Fabian Freund
2024-06-19 21:24:18 +02:00
parent dbf953f879
commit 2c71909283
8 changed files with 11 additions and 13 deletions
@@ -35,11 +35,11 @@ class WebViewRepository extends _$WebViewRepository {
state = {...state, webView.page.value.key: webView};
}
Future<void> closeTab(Key key) async {
void closeTab(Key key) {
state = Map.of(state)..remove(key);
}
Future<void> closeAllTabs() async {
void closeAllTabs() {
state = {};
}
}
@@ -60,8 +60,8 @@ class WebViewTab extends HookConsumerWidget {
IconButton(
visualDensity:
const VisualDensity(horizontal: -4.0, vertical: -4.0),
onPressed: () async {
await ref
onPressed: () {
ref
.read(webViewRepositoryProvider.notifier)
.closeTab(page.key);
},