add delete dialog

null_safety
张萌 4 years ago
parent afac514016
commit c02a487fd5

@ -32,6 +32,17 @@ class _ExampleDialogState extends State<ExampleDialog> {
],
));
}),
ASButton.info(
title: '有title的对话框',
onPressed: () {
Get.dialog(ASDeleteDialog(
title: '你确定删除xxx',
boyd: '你确定删除xxxxxxxxxxxxxxxxxxxxx',
onpressed: () {
},
));
}),
],
),
);

@ -23,6 +23,7 @@ export 'pickers/as_show_city_picker.dart';
export 'dialog/as_dialog.dart';
export 'dialog/as_dialog_button.dart';
export 'dialog/as_delete_dialog.dart';
export 'list_tile/as_list_tile.dart';
export 'list_tile/as_option_tile.dart';

@ -0,0 +1,97 @@
import 'package:ansu_ui/styles/as_colors.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:ansu_ui/ansu_ui.dart';
class ASDeleteDialog extends StatelessWidget {
///
final String title;
/// ,widget
final dynamic boyd;
///
final Widget button;
///
final VoidCallback onpressed;
const ASDeleteDialog(
{Key key, this.title, this.boyd, this.button, this.onpressed})
: super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: Padding(
padding: EdgeInsets.all(24.w),
child: Material(
color: kForegroundColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.w),
),
child: Stack(
children: [
Positioned(
right: 0,
top: 0,
child: IconButton(
iconSize: 20.w,
icon: Icon(
CupertinoIcons.clear_circled,
color: Color(0xFF060606).withOpacity(0.85),
),
onPressed: () => Navigator.pop(context),
splashRadius: 16.w,
),
),
20.hb,
Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
margin:EdgeInsets.fromLTRB(24.w, 45.w, 24.w, 20.w) ,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
this.title == null
? SizedBox()
: Container(
margin: EdgeInsets.only(bottom: 15.w),
child: Text(
this.title,
style: TextStyle(
color: kTextColor,
fontSize: 18.sp,
fontWeight: FontWeight.bold),
),
),
this.boyd == null
? SizedBox()
: this.boyd is String
? Text(
this.boyd,
style: TextStyle(
color: kTextSubColor, fontSize: 16.sp),
)
: this.boyd,
],
),
),
this.button ??
ASDialogButton.outline(
title: '确认删除',
onPressed: this.onpressed,
),
20.hb
],
),
],
),
),
),
);
}
}
Loading…
Cancel
Save