Skip to content

Commit

Permalink
Merge branch 'master' into 413-smartphone-as-a-container
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmer committed Nov 26, 2024
2 parents 4060318 + e55d448 commit bb9affd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions lib/utils/view_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ import 'globals.dart';
import 'logger.dart';
import 'riverpod/riverpod_providers/state_providers/status_message_provider.dart';

/// Shows a snackbar message to the user for 3 seconds.
ScaffoldFeatureController<SnackBar, SnackBarClosedReason>? showSnackBar(String message) => _showSnackBar(message, const Duration(seconds: 3));

/// Shows a snackbar message to the user for 10 seconds.
ScaffoldFeatureController<SnackBar, SnackBarClosedReason>? showSnackBarLong(String message) => _showSnackBar(message, const Duration(seconds: 10));

/// Shows a snackbar message to the user for a given `Duration`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class _LinkInputViewState extends ConsumerState<LinkInputView> {
onPressed: () async {
ClipboardData? data = await Clipboard.getData('text/plain');
if (data == null || data.text == null || data.text!.isEmpty) {
if (context.mounted) ref.read(statusMessageProvider.notifier).state = (AppLocalizations.of(context)!.clipboardEmpty, '');
if (context.mounted) ref.read(statusMessageProvider.notifier).state = (AppLocalizations.of(context)!.clipboardEmpty, null);
return;
}
setState(() => textController.text = data.text ?? '');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class _LinkInputViewState extends ConsumerState<LinkInputView> {

Future<void> addToken(Uri link) async {
if (link.scheme != 'otpauth') {
ref.read(statusMessageProvider.notifier).state = (AppLocalizations.of(context)!.linkMustOtpAuth, '');
ref.read(statusMessageProvider.notifier).state = (AppLocalizations.of(context)!.linkMustOtpAuth, null);
return;
}
await ref.read(tokenProvider.notifier).handleLink(link);
Expand Down Expand Up @@ -76,7 +76,7 @@ class _LinkInputViewState extends ConsumerState<LinkInputView> {
onPressed: () async {
ClipboardData? data = await Clipboard.getData('text/plain');
if (data == null || data.text == null || data.text!.isEmpty) {
if (context.mounted) ref.read(statusMessageProvider.notifier).state = (AppLocalizations.of(context)!.clipboardEmpty, '');
if (context.mounted) ref.read(statusMessageProvider.notifier).state = (AppLocalizations.of(context)!.clipboardEmpty, null);
return;
}
setState(() => textController.text = data.text ?? '');
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ publish_to: none
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 4.4.2+404206 # TODO Set the right version number
version: 4.4.3+404301 # TODO Set the right version number

# version: major.minor.build + 2x major|2x minor|3x build
# version: version number + build number (optional)
Expand Down

0 comments on commit bb9affd

Please sign in to comment.