123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- import 'package:fis_i18n/i18n.dart';
- import 'package:flutter/material.dart';
- import 'package:flyinsonolite/controls/dialog/fisdialog.dart';
- import 'package:flyinsonolite/controls/text/fistext.dart';
- import 'package:flyinsonolite/infrastructure/scale.dart';
- import 'package:flyinsonolite/infrastructure/storage.dart';
- class DialogHelper {
- static Future showErrorDialog(BuildContext context, String message) async {
- await showDialog(
- context: context,
- builder: (context) {
- return LayoutBuilder(
- builder: (BuildContext context, BoxConstraints constraints) {
- return FISDialog(
- i18nBook.common.error.t,
- FISText(message,
- style: Storage.currentTheme.dialogStyle.messageTextStyle
- .copyWith(
- fontSize: Storage.currentTheme.dialogStyle
- .messageTextStyle.fontSize!.s)),
- true,
- true,
- minHeight: 150.s,
- );
- });
- },
- barrierDismissible: false);
- }
- static Future showConfirmDialog(
- BuildContext context, String message, VoidCallback onConfirm,
- {bool showConfirmButton = true,
- bool showCancelButton = true,
- bool showCloseButton = true}) async {
- await showDialog(
- context: context,
- builder: (context) {
- return LayoutBuilder(
- builder: (BuildContext context, BoxConstraints constraints) {
- return FISDialog(
- i18nBook.common.tip.t,
- FISText(message,
- style: Storage.currentTheme.dialogStyle.messageTextStyle
- .copyWith(
- fontSize: Storage.currentTheme.dialogStyle
- .messageTextStyle.fontSize!.s)),
- showConfirmButton,
- showCancelButton,
- onConfirm: onConfirm,
- showCloseButton: showCloseButton,
- minHeight: 150.s);
- });
- },
- barrierDismissible: false);
- }
- }
|