-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 💄 Show snackbar during RPC signTransactions command processing.
- Loading branch information
Showing
4 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
lib/ui/views/rpc_command_receiver/util/processing_indicator.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class CommandHandlerLoadingSnackbar extends SnackBar { | ||
CommandHandlerLoadingSnackbar({super.key, required String message}) | ||
: super( | ||
duration: const Duration(days: 1), | ||
behavior: SnackBarBehavior.floating, | ||
content: Row( | ||
children: [ | ||
const CircularProgressIndicator( | ||
strokeWidth: 2, | ||
), | ||
const SizedBox( | ||
width: 21, | ||
), | ||
Text(message), | ||
], | ||
), | ||
); | ||
|
||
void show(BuildContext context) { | ||
if (!context.mounted) return; | ||
ScaffoldMessenger.of(context).showSnackBar(this); | ||
} | ||
|
||
static void hide(BuildContext context) { | ||
if (!context.mounted) return; | ||
ScaffoldMessenger.of(context).hideCurrentSnackBar(); | ||
} | ||
} |