Files
gl_dao/lib/pages/components/yy_alert_dialog_with_divider.dart

75 lines
1.9 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* @Author: Aimee~
* @Date: 2022-06-06 13:31:27
* @LastEditTime: 2022-06-06 15:44:53
* @LastEditors: Aimee
* @FilePath: /gl_dao/lib/pages/components/yy_alert_dialog_with_divider.dart
* @Description: 弹窗样式
*/
import 'package:flutter/material.dart';
import 'package:flutter_custom_dialog/flutter_custom_dialog.dart';
import '../../main_color.dart';
YYDialog yYAlertDialogWithDivider(
BuildContext context, {
String text1 = '',
String text2 = '',
required String title,
String type = '', // 默认是问号成功显示success
VoidCallback? onCancel,
VoidCallback? onSure,
}) {
return YYDialog().build(context)
..width = MediaQuery.of(context).size.width * 0.8
..borderRadius = 4.0
..widget(
Opacity(
opacity: 0.5,
child: Container(
margin: const EdgeInsets.only(top: 21),
width: 50.0,
height: 50.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(150.0),
),
child: Image.asset(
type == ""
? "assets/images/order/icon_order_null.png"
: "assets/images/order/icon_order_success.png",
alignment: Alignment.center,
fit: BoxFit.cover,
repeat: ImageRepeat.noRepeat,
),
),
),
)
..text(
padding: const EdgeInsets.all(25.0),
alignment: Alignment.center,
text: title,
color: tTextColor333,
fontSize: 16.0,
fontWeight: FontWeight.w500,
)
..divider()
..doubleButton(
height: 60.0,
padding: const EdgeInsets.all(16.0),
gravity: Gravity.spaceEvenly,
withDivider: true,
text1: text1,
color1: tTextColor666,
fontSize1: 15.0,
fontWeight1: FontWeight.w400,
onTap1: onCancel,
text2: text2,
color2: tMainRedColor,
fontSize2: 15.0,
fontWeight2: FontWeight.w400,
onTap2: onSure,
)
..show();
}