Files
biz_xfj_cloud/lib/common/widgets/app/app_message_dialog.dart
T

49 lines
1.5 KiB
Dart

import 'package:ducafe_ui_core/ducafe_ui_core.dart';
import 'package:flutter/material.dart';
import 'package:forui/forui.dart';
import 'package:get/get.dart';
Future<bool> appMessageDialog(BuildContext context, String msg) async {
final theme = FTheme.of(context);
final res = await showAdaptiveDialog<bool>(
context: context,
builder: (context) => FDialog(
direction: Axis.vertical,
title: <Widget>[
FIcon(
FAssets.icons.circleAlert,
color: theme.colorScheme.primary,
size: theme.typography.xl2.fontSize,
).paddingOnly(top: 5.h),
Text("警告", style: theme.typography.xl).paddingOnly(left: 10.w),
].toRow(crossAxisAlignment: CrossAxisAlignment.center),
body: Text(msg, style: theme.typography.xl)
.width(context.width * 0.6)
.padding(vertical: 50.w)
.marginSymmetric(
vertical: 10.h,
),
actions: [
<Widget>[
FButton(
label: Text(
'确定',
style: theme.typography.base.copyWith(
color: theme.colorScheme.secondary,
),
),
onPress: () => Navigator.of(context).pop(true),
).flexible(flex: 1),
SizedBox(width: 10.w),
FButton(
style: FButtonStyle.outline,
label: Text('取消', style: theme.typography.base),
onPress: () => Navigator.of(context).pop(false),
).flexible(flex: 1),
].toRow(),
],
),
);
return res ?? false;
}