-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ Add a control to check if UCO balance is not too low after ac…
…tion validation
- Loading branch information
1 parent
cb6ee88
commit 341c02b
Showing
5 changed files
with
180 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
110 changes: 110 additions & 0 deletions
110
lib/ui/views/util/components/low_uco_warning_popup.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,110 @@ | ||
import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' | ||
as aedappfm; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_gen/gen_l10n/localizations.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
|
||
const kLowUCOWarningValue = 5; | ||
|
||
class LowUCOWarningPopup { | ||
static Future<bool?> getDialog( | ||
BuildContext context, | ||
) async { | ||
return showDialog<bool?>( | ||
context: context, | ||
builder: (context) { | ||
return ScaffoldMessenger( | ||
child: Builder( | ||
builder: (context) { | ||
return AlertDialog( | ||
insetPadding: const EdgeInsets.symmetric( | ||
horizontal: 10, | ||
), | ||
backgroundColor: aedappfm.AppThemeBase.backgroundPopupColor, | ||
contentPadding: const EdgeInsets.only( | ||
top: 10, | ||
), | ||
content: Container( | ||
color: Colors.transparent, | ||
padding: const EdgeInsets.symmetric( | ||
horizontal: 10, | ||
), | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
children: <Widget>[ | ||
Padding( | ||
padding: const EdgeInsets.all(10), | ||
child: Text( | ||
AppLocalizations.of(context)!.lowUCOWarningPopupTitle, | ||
style: Theme.of(context) | ||
.textTheme | ||
.titleMedium! | ||
.copyWith( | ||
fontSize: | ||
aedappfm.Responsive.fontSizeFromTextStyle( | ||
context, | ||
Theme.of(context).textTheme.titleMedium!, | ||
), | ||
), | ||
), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.all(10), | ||
child: Text( | ||
AppLocalizations.of(context)!.lowUCOWarningPopupDesc, | ||
softWrap: true, | ||
style: Theme.of(context) | ||
.textTheme | ||
.bodyMedium! | ||
.copyWith( | ||
fontSize: | ||
aedappfm.Responsive.fontSizeFromTextStyle( | ||
context, | ||
Theme.of(context).textTheme.bodyMedium!, | ||
), | ||
), | ||
), | ||
), | ||
const SizedBox( | ||
height: 20, | ||
), | ||
Container( | ||
constraints: const BoxConstraints( | ||
minWidth: 100, | ||
), | ||
width: 300, | ||
padding: const EdgeInsets.only( | ||
bottom: 20, | ||
), | ||
child: Row( | ||
children: [ | ||
Expanded( | ||
child: aedappfm.AppButton( | ||
labelBtn: AppLocalizations.of(context)!.no, | ||
onPressed: () async { | ||
context.pop(false); | ||
}, | ||
), | ||
), | ||
Expanded( | ||
child: aedappfm.AppButton( | ||
labelBtn: AppLocalizations.of(context)!.yes, | ||
onPressed: () async { | ||
context.pop(true); | ||
}, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
}, | ||
), | ||
); | ||
}, | ||
); | ||
} | ||
} |