From caafb433482e3a13818236c6ecc0eef257c0b3a3 Mon Sep 17 00:00:00 2001 From: Robert Virkus Date: Mon, 5 Feb 2024 20:36:00 +0100 Subject: [PATCH] chore: adapt to API changes --- lib/settings/provider.dart | 9 ++++----- lib/settings/ui/provider.dart | 10 +++++----- lib/settings/ui/provider.g.dart | 2 +- pubspec.lock | 14 +++++++------- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/lib/settings/provider.dart b/lib/settings/provider.dart index d4bab4e..6128ded 100644 --- a/lib/settings/provider.dart +++ b/lib/settings/provider.dart @@ -1,5 +1,4 @@ import 'package:enough_mail_app/enough_mail_app.dart'; -import 'package:flutter/widgets.dart'; /// Shows how to override the default settings class CustomSettingsNotifier extends SettingsNotifier { @@ -9,10 +8,10 @@ class CustomSettingsNotifier extends SettingsNotifier { }); @override - String getSignatureHtmlGlobal(BuildContext context) => - state.signatureHtml ?? '

---
${context.text.signature}

'; + String getSignatureHtmlGlobal() => + state.signatureHtml ?? '

---
${ref.text.signature}

'; @override - String getSignaturePlainGlobal(BuildContext context) => - state.signaturePlain ?? '---\n${context.text.signature}'; + String getSignaturePlainGlobal() => + state.signaturePlain ?? '---\n${ref.text.signature}'; } diff --git a/lib/settings/ui/provider.dart b/lib/settings/ui/provider.dart index fcfc6b5..76e2817 100644 --- a/lib/settings/ui/provider.dart +++ b/lib/settings/ui/provider.dart @@ -1,6 +1,6 @@ import 'package:enough_mail_app/enough_mail_app.dart'; -import 'package:flutter/widgets.dart'; import 'package:go_router/go_router.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'provider.g.dart'; @@ -13,10 +13,10 @@ class CustomSettingsUiElements extends _$CustomSettingsUiElements @override List generate( - BuildContext context, + WidgetRef ref, ) { - final text = context.text; - final standardElements = SettingsUiElements.buildStandardElements(context); + final text = ref.text; + final standardElements = SettingsUiElements.buildStandardElements(ref); /// You can remove a standard element easily like this: // standardElements.removeType(UiSettingsType.welcome); @@ -28,7 +28,7 @@ class CustomSettingsUiElements extends _$CustomSettingsUiElements UiSettingsElement.divider(), UiSettingsElement( title: text.settingsDevelopment, - onTap: () => context.pushNamed(Routes.settingsDevelopment), + onTap: () => ref.context.pushNamed(Routes.settingsDevelopment), ), ]; } diff --git a/lib/settings/ui/provider.g.dart b/lib/settings/ui/provider.g.dart index c41b86b..e1edb20 100644 --- a/lib/settings/ui/provider.g.dart +++ b/lib/settings/ui/provider.g.dart @@ -7,7 +7,7 @@ part of 'provider.dart'; // ************************************************************************** String _$customSettingsUiElementsHash() => - r'61ce1349e2b4f7db116731b2727e9e60edcd36ba'; + r'42b64d585c8670932f61a474c9caa5a3d66fb135'; /// See also [CustomSettingsUiElements]. @ProviderFor(CustomSettingsUiElements) diff --git a/pubspec.lock b/pubspec.lock index 675892a..ea274d3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -508,7 +508,7 @@ packages: description: path: "." ref: HEAD - resolved-ref: "3fa482b6bbc4630b2de896aa2653a64055efa695" + resolved-ref: "6754401bb38b2449eb21fcebd7437181410a0144" url: "https://github.com/Enough-Software/enough_mail_app.git" source: git version: "1.0.0+96" @@ -647,10 +647,10 @@ packages: dependency: "direct main" description: name: flutter_hooks - sha256: "09f64db63fee3b2ab8b9038a1346be7d8986977fae3fec601275bf32455ccfc0" + sha256: cde36b12f7188c85286fba9b38cc5a902e7279f36dd676967106c041dc9dde70 url: "https://pub.dev" source: hosted - version: "0.20.4" + version: "0.20.5" flutter_inappwebview: dependency: transitive description: @@ -1940,10 +1940,10 @@ packages: dependency: transitive description: name: webview_flutter_wkwebview - sha256: "4d062ad505390ecef1c4bfb6001cd857a51e00912cc9dfb66edb1886a9ebd80c" + sha256: b99ca8d8bae9c6b43d568218691aa537fb0aeae1d7d34eadf112a6aa36d26506 url: "https://pub.dev" source: hosted - version: "3.10.2" + version: "3.11.0" win32: dependency: transitive description: @@ -1985,5 +1985,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + dart: ">=3.2.3 <4.0.0" + flutter: ">=3.16.6"