| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import 'package:deus_app/common/utils/CommonUtils.dart';
- import 'package:deus_app/common/utils/ConstantString.dart';
- import 'package:deus_app/common/utils/ToastUtils.dart';
- import 'package:flutter/cupertino.dart';
- import 'package:flutter/material.dart';
- class CloseTaskDialog {
- static void showCupertinoAlertDialog(
- BuildContext context, _CallBack onPressed) {
- String result = '';
- showDialog(
- context: context,
- barrierDismissible:false,
- builder: (BuildContext context) {
- return Theme(
- data: ThemeData(
- dialogBackgroundColor: Colors.white,
- dialogTheme: DialogTheme(backgroundColor: Colors.white)),
- child: CupertinoAlertDialog(
- title: Text(ConstantString.close_task),
- content: Column(
- children: <Widget>[
- SizedBox(
- height: 10,
- ),
- new TextField(
- maxLines: 3,
- decoration: InputDecoration(border: OutlineInputBorder()),
- style: TextStyle(fontSize: 14),
- onChanged: (value) {
- result = value;
- },
- )
- ],
- ),
- actions: <Widget>[
- CupertinoDialogAction(
- child: Text("取消"),
- onPressed: () {
- Navigator.pop(context);
- },
- ),
- CupertinoDialogAction(
- child: Text("确定"),
- onPressed: () {
- if (!CommonUtils.validationInput(result)) {
- showToast(ConstantString.notesNull);
- } else {
- onPressed(result);
- Navigator.pop(context);
- }
- },
- ),
- ],
- ));
- });
- }
- }
- typedef _CallBack = void Function(String msg);
|