Skip to content

Commit

Permalink
chore: adapt to API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-virkus committed Feb 5, 2024
1 parent 8308b83 commit caafb43
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
9 changes: 4 additions & 5 deletions lib/settings/provider.dart
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -9,10 +8,10 @@ class CustomSettingsNotifier extends SettingsNotifier {
});

@override
String getSignatureHtmlGlobal(BuildContext context) =>
state.signatureHtml ?? '<p>---<br/>${context.text.signature}</p>';
String getSignatureHtmlGlobal() =>
state.signatureHtml ?? '<p>---<br/>${ref.text.signature}</p>';

@override
String getSignaturePlainGlobal(BuildContext context) =>
state.signaturePlain ?? '---\n${context.text.signature}';
String getSignaturePlainGlobal() =>
state.signaturePlain ?? '---\n${ref.text.signature}';
}
10 changes: 5 additions & 5 deletions lib/settings/ui/provider.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -13,10 +13,10 @@ class CustomSettingsUiElements extends _$CustomSettingsUiElements

@override
List<UiSettingsElement> 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);
Expand All @@ -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),
),
];
}
Expand Down
2 changes: 1 addition & 1 deletion lib/settings/ui/provider.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"

0 comments on commit caafb43

Please sign in to comment.