收银台页面搭建及封装 dialog 公用函数且套入页面使用
This commit is contained in:
74
lib/pages/components/yy_alert_dialog_with_divider.dart
Normal file
74
lib/pages/components/yy_alert_dialog_with_divider.dart
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* @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();
|
||||
}
|
||||
Reference in New Issue
Block a user