| 123456789101112131415161718192021222324252627282930313233343536373839 |
- import 'package:flutter/material.dart';
- class Utils {
- static void showConfirmDialog(BuildContext context,String content, Function confirmCallback) {
- showDialog(context: context, builder: (context) {
- return new AlertDialog(
- title: new Text("提示"),
- content: new Text(content),
- actions: <Widget>[
- new FlatButton(
- onPressed: () {
- confirmCallback();
- Navigator.of(context).pop();
- },
- child: new Text("确认"),
- ),
- new FlatButton(
- onPressed: () {
- Navigator.of(context).pop();
- },
- child: new Text("取消"),
- ),
- ],
- );
- });
- }
- }
- class NetError implements Exception {
- String msg;
- NetError(this.msg);
- @override
- String toString() {
- return msg;
- }
- }
|