wmh_customalert 0.0.1 wmh_customalert: ^0.0.1 copied to clipboard
A customAlert for JiuJi.
import 'package:flutter/material.dart';
import 'package:wmh_customalert/wmh_customalert.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: implement build
return MaterialApp(
debugShowCheckedModeBanner: false,
home: MyAppStateful(),
);
}
}
class MyAppStateful extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyAppStateful> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: InkWell(
child: Container(
width: 100,
height: 100,
color: Colors.red,
),
onTap: () {
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return WmhCustomalert(alertType: AlertType.twoBtn, cancelTitle: '取消', confirmTitle: '好的', cancelCallBack: null, confirmCallBack: () {
print('hahahahah');
}, title: '温馨提示', content: '明天就礼拜五啦!!!',);
}
);
},
),
),
);
}
}