|
@@ -1304,7 +1304,7 @@ class DialogUtil { |
|
@@ -1304,7 +1304,7 @@ class DialogUtil { |
|
1304
|
color: MyColours.color_ffffff,
|
1304
|
color: MyColours.color_ffffff,
|
|
1305
|
child: Column(
|
1305
|
child: Column(
|
|
1306
|
children: <Widget>[
|
1306
|
children: <Widget>[
|
|
1307
|
- TableCalendar(
|
1307
|
+ TableCalendar(
|
|
1308
|
// rowHeight: ScreenUtil().setWidth(100),
|
1308
|
// rowHeight: ScreenUtil().setWidth(100),
|
|
1309
|
calendarController: _calendarController,
|
1309
|
calendarController: _calendarController,
|
|
1310
|
initialSelectedDay: selectDateTime,
|
1310
|
initialSelectedDay: selectDateTime,
|
|
@@ -1536,10 +1536,10 @@ class DialogUtil { |
|
@@ -1536,10 +1536,10 @@ class DialogUtil { |
|
1536
|
// bottom: 0,
|
1536
|
// bottom: 0,
|
|
1537
|
// top: ScreenUtil().setWidth(30),
|
1537
|
// top: ScreenUtil().setWidth(30),
|
|
1538
|
// child: buildMarker(date)),
|
1538
|
// child: buildMarker(date)),
|
|
1539
|
- // Align(
|
|
|
|
1540
|
- // alignment: Alignment.bottomCenter,
|
|
|
|
1541
|
- // child: buildMarker(date),
|
|
|
|
1542
|
- // )
|
1539
|
+ // Align(
|
|
|
|
1540
|
+ // alignment: Alignment.bottomCenter,
|
|
|
|
1541
|
+ // child: buildMarker(date),
|
|
|
|
1542
|
+ // )
|
|
1543
|
// );
|
1543
|
// );
|
|
1544
|
// }
|
1544
|
// }
|
|
1545
|
|
1545
|
|
|
@@ -2339,6 +2339,330 @@ class DialogUtil { |
|
@@ -2339,6 +2339,330 @@ class DialogUtil { |
|
2339
|
);
|
2339
|
);
|
|
2340
|
}
|
2340
|
}
|
|
2341
|
|
2341
|
|
|
|
|
2342
|
+ static Future festivalAlertDialog(
|
|
|
|
2343
|
+ BuildContext context, String name, double height,
|
|
|
|
2344
|
+ {CustomCallBack rCallback, double fontSize = 28}) async {
|
|
|
|
2345
|
+ final action = await showDialog(
|
|
|
|
2346
|
+ context: context,
|
|
|
|
2347
|
+ barrierDismissible: true,
|
|
|
|
2348
|
+ builder: (BuildContext context) {
|
|
|
|
2349
|
+ TextEditingController controller = TextEditingController();
|
|
|
|
2350
|
+ controller.text = name;
|
|
|
|
2351
|
+ return Scaffold(
|
|
|
|
2352
|
+ backgroundColor: Colors.transparent,
|
|
|
|
2353
|
+ body: Center(
|
|
|
|
2354
|
+ child: Container(
|
|
|
|
2355
|
+ padding:
|
|
|
|
2356
|
+ EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(72)),
|
|
|
|
2357
|
+ height: ScreenUtil().setWidth(height),
|
|
|
|
2358
|
+ decoration: BoxDecoration(
|
|
|
|
2359
|
+ borderRadius:
|
|
|
|
2360
|
+ BorderRadius.circular(ScreenUtil().setWidth(30))),
|
|
|
|
2361
|
+ child: Card(
|
|
|
|
2362
|
+ shape: RoundedRectangleBorder(
|
|
|
|
2363
|
+ borderRadius: BorderRadius.all(
|
|
|
|
2364
|
+ Radius.circular(ScreenUtil().setWidth(30)))), //设置圆角
|
|
|
|
2365
|
+ child: Padding(
|
|
|
|
2366
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
2367
|
+ horizontal: ScreenUtil().setWidth(40)),
|
|
|
|
2368
|
+ child: Column(
|
|
|
|
2369
|
+ children: [
|
|
|
|
2370
|
+ // VEmptyView(60),
|
|
|
|
2371
|
+ Stack(children: [
|
|
|
|
2372
|
+ Container(
|
|
|
|
2373
|
+ padding: EdgeInsets.only(
|
|
|
|
2374
|
+ top: ScreenUtil().setWidth(60),
|
|
|
|
2375
|
+ bottom: ScreenUtil().setWidth(50)),
|
|
|
|
2376
|
+ // color: Colors.red,
|
|
|
|
2377
|
+ alignment: Alignment.center,
|
|
|
|
2378
|
+ child: Text('纪念日名称',
|
|
|
|
2379
|
+ style: TextStyle(
|
|
|
|
2380
|
+ fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
2381
|
+ color: MyColours.color_353535)),
|
|
|
|
2382
|
+ ),
|
|
|
|
2383
|
+ Positioned(
|
|
|
|
2384
|
+ right: 0,
|
|
|
|
2385
|
+ top: ScreenUtil().setWidth(36),
|
|
|
|
2386
|
+ child: Text('删除',
|
|
|
|
2387
|
+ style: TextStyle(
|
|
|
|
2388
|
+ decoration: TextDecoration.underline,
|
|
|
|
2389
|
+ fontSize: ScreenUtil().setSp(26),
|
|
|
|
2390
|
+ color: MyColours.color_199095)))
|
|
|
|
2391
|
+ ]),
|
|
|
|
2392
|
+
|
|
|
|
2393
|
+ Container(
|
|
|
|
2394
|
+ height: ScreenUtil().setWidth(40),
|
|
|
|
2395
|
+ // color: Colors.red,
|
|
|
|
2396
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
2397
|
+ horizontal: ScreenUtil().setWidth(68)),
|
|
|
|
2398
|
+ alignment: Alignment.center,
|
|
|
|
2399
|
+ child: Material(
|
|
|
|
2400
|
+ color: Colors.transparent,
|
|
|
|
2401
|
+ child: TextField(
|
|
|
|
2402
|
+ controller: controller,
|
|
|
|
2403
|
+ maxLines: 1,
|
|
|
|
2404
|
+
|
|
|
|
2405
|
+ // //光标颜色
|
|
|
|
2406
|
+ // cursorColor:
|
|
|
|
2407
|
+ // widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
2408
|
+ // //输入文本的样式
|
|
|
|
2409
|
+ // inputFormatters: lenghtLimit
|
|
|
|
2410
|
+ // ? [
|
|
|
|
2411
|
+ // LengthLimitingTextInputFormatter(10),
|
|
|
|
2412
|
+ // ]
|
|
|
|
2413
|
+ // : [],
|
|
|
|
2414
|
+ textAlignVertical:
|
|
|
|
2415
|
+ TextAlignVertical.bottom,
|
|
|
|
2416
|
+ textAlign: TextAlign.center,
|
|
|
|
2417
|
+ style: TextStyle(
|
|
|
|
2418
|
+ fontSize: ScreenUtil().setSp(26),
|
|
|
|
2419
|
+ ),
|
|
|
|
2420
|
+ decoration: InputDecoration(
|
|
|
|
2421
|
+ border: OutlineInputBorder(
|
|
|
|
2422
|
+ borderSide: BorderSide.none),
|
|
|
|
2423
|
+ hintText: '例:本人生日',
|
|
|
|
2424
|
+ hintStyle: TextStyle(
|
|
|
|
2425
|
+ color: MyColours.color_999999,
|
|
|
|
2426
|
+ fontSize: ScreenUtil().setSp(26),
|
|
|
|
2427
|
+ ),
|
|
|
|
2428
|
+ enabledBorder: new UnderlineInputBorder(
|
|
|
|
2429
|
+ borderSide: BorderSide.none,
|
|
|
|
2430
|
+ ),
|
|
|
|
2431
|
+ focusedBorder: new UnderlineInputBorder(
|
|
|
|
2432
|
+ borderSide: BorderSide.none,
|
|
|
|
2433
|
+ ),
|
|
|
|
2434
|
+ ),
|
|
|
|
2435
|
+ onChanged: (value) {
|
|
|
|
2436
|
+ name = value;
|
|
|
|
2437
|
+ },
|
|
|
|
2438
|
+ onEditingComplete: () {
|
|
|
|
2439
|
+ FocusScope.of(context).requestFocus(
|
|
|
|
2440
|
+ FocusNode()); //点击空白处隐藏键盘
|
|
|
|
2441
|
+ },
|
|
|
|
2442
|
+ keyboardType: TextInputType.text))),
|
|
|
|
2443
|
+ // VEmptyView(28),
|
|
|
|
2444
|
+ MyDivider(ScreenUtil().setWidth(280 * 2),
|
|
|
|
2445
|
+ ScreenUtil().setWidth(2),
|
|
|
|
2446
|
+ color: MyColours.color_efefef),
|
|
|
|
2447
|
+ Container(
|
|
|
|
2448
|
+ padding: EdgeInsets.only(
|
|
|
|
2449
|
+ top: ScreenUtil().setWidth(40),
|
|
|
|
2450
|
+ bottom: ScreenUtil().setWidth(50)),
|
|
|
|
2451
|
+ // color: Colors.red,
|
|
|
|
2452
|
+ alignment: Alignment.center,
|
|
|
|
2453
|
+ child: Text('纪念日日期',
|
|
|
|
2454
|
+ style: TextStyle(
|
|
|
|
2455
|
+ fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
2456
|
+ color: MyColours.color_353535)),
|
|
|
|
2457
|
+ ),
|
|
|
|
2458
|
+ Row(
|
|
|
|
2459
|
+ children: [
|
|
|
|
2460
|
+ InkWell(
|
|
|
|
2461
|
+ child: Container(
|
|
|
|
2462
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
2463
|
+ horizontal: ScreenUtil().setWidth(10),
|
|
|
|
2464
|
+ vertical: ScreenUtil().setWidth(10)),
|
|
|
|
2465
|
+ decoration: BoxDecoration(
|
|
|
|
2466
|
+ color: true
|
|
|
|
2467
|
+ ? MyColours.color_199095
|
|
|
|
2468
|
+ : MyColours.color_ffffff,
|
|
|
|
2469
|
+ borderRadius: BorderRadius.only(
|
|
|
|
2470
|
+ topLeft: Radius.circular(
|
|
|
|
2471
|
+ ScreenUtil().setWidth(10)),
|
|
|
|
2472
|
+ bottomLeft: Radius.circular(
|
|
|
|
2473
|
+ ScreenUtil().setWidth(10))),
|
|
|
|
2474
|
+ border: Border.all(
|
|
|
|
2475
|
+ color: MyColours.color_199095,
|
|
|
|
2476
|
+ width: ScreenUtil().setWidth(2))),
|
|
|
|
2477
|
+ child: Text('公历',
|
|
|
|
2478
|
+ style: TextStyle(
|
|
|
|
2479
|
+ fontSize: ScreenUtil().setSp(28),
|
|
|
|
2480
|
+ color: true
|
|
|
|
2481
|
+ ? MyColours.color_ffffff
|
|
|
|
2482
|
+ : MyColours.color_333333)),
|
|
|
|
2483
|
+ )),
|
|
|
|
2484
|
+ InkWell(
|
|
|
|
2485
|
+ child: Container(
|
|
|
|
2486
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
2487
|
+ horizontal: ScreenUtil().setWidth(10),
|
|
|
|
2488
|
+ vertical: ScreenUtil().setWidth(10)),
|
|
|
|
2489
|
+ decoration: BoxDecoration(
|
|
|
|
2490
|
+ color: false
|
|
|
|
2491
|
+ ? MyColours.color_199095
|
|
|
|
2492
|
+ : MyColours.color_ffffff,
|
|
|
|
2493
|
+ borderRadius: BorderRadius.only(
|
|
|
|
2494
|
+ topRight: Radius.circular(
|
|
|
|
2495
|
+ ScreenUtil().setWidth(10)),
|
|
|
|
2496
|
+ bottomRight: Radius.circular(
|
|
|
|
2497
|
+ ScreenUtil().setWidth(10))),
|
|
|
|
2498
|
+ border: Border.all(
|
|
|
|
2499
|
+ color: MyColours.color_199095,
|
|
|
|
2500
|
+ width: ScreenUtil().setWidth(2))),
|
|
|
|
2501
|
+ child: Text('农历',
|
|
|
|
2502
|
+ style: TextStyle(
|
|
|
|
2503
|
+ fontSize: ScreenUtil().setSp(28),
|
|
|
|
2504
|
+ color: false
|
|
|
|
2505
|
+ ? MyColours.color_ffffff
|
|
|
|
2506
|
+ : MyColours.color_333333))),
|
|
|
|
2507
|
+ ),
|
|
|
|
2508
|
+ ],
|
|
|
|
2509
|
+ ),
|
|
|
|
2510
|
+ Row(
|
|
|
|
2511
|
+ children: [
|
|
|
|
2512
|
+ InkWell(
|
|
|
|
2513
|
+ child: Container(
|
|
|
|
2514
|
+ height: ScreenUtil().setWidth(47 * 2),
|
|
|
|
2515
|
+ alignment: Alignment.center,
|
|
|
|
2516
|
+ child: Text(
|
|
|
|
2517
|
+ '取消',
|
|
|
|
2518
|
+ style: TextStyle(
|
|
|
|
2519
|
+ color: MyColours.color_199095,
|
|
|
|
2520
|
+ fontSize: ScreenUtil().setWidth(34)),
|
|
|
|
2521
|
+ ),
|
|
|
|
2522
|
+ ),
|
|
|
|
2523
|
+ onTap: () {
|
|
|
|
2524
|
+ Navigator.of(context).pop();
|
|
|
|
2525
|
+ },
|
|
|
|
2526
|
+ ),
|
|
|
|
2527
|
+ InkWell(
|
|
|
|
2528
|
+ child: Container(
|
|
|
|
2529
|
+ height: ScreenUtil().setWidth(47 * 2),
|
|
|
|
2530
|
+ alignment: Alignment.center,
|
|
|
|
2531
|
+ child: Text(
|
|
|
|
2532
|
+ '保存',
|
|
|
|
2533
|
+ style: TextStyle(
|
|
|
|
2534
|
+ color: MyColours.color_199095,
|
|
|
|
2535
|
+ fontSize: ScreenUtil().setWidth(34)),
|
|
|
|
2536
|
+ ),
|
|
|
|
2537
|
+ ),
|
|
|
|
2538
|
+ onTap: () {
|
|
|
|
2539
|
+ if (name == '' || name.trim().length == 0) {
|
|
|
|
2540
|
+ Utils.showToast('请输入纪念日名称');
|
|
|
|
2541
|
+ return;
|
|
|
|
2542
|
+ }
|
|
|
|
2543
|
+ Navigator.of(context).pop();
|
|
|
|
2544
|
+ rCallback(name);
|
|
|
|
2545
|
+ },
|
|
|
|
2546
|
+ )
|
|
|
|
2547
|
+ ],
|
|
|
|
2548
|
+ )
|
|
|
|
2549
|
+ ],
|
|
|
|
2550
|
+ )),
|
|
|
|
2551
|
+ ),
|
|
|
|
2552
|
+ ),
|
|
|
|
2553
|
+ ));
|
|
|
|
2554
|
+ },
|
|
|
|
2555
|
+ );
|
|
|
|
2556
|
+ }
|
|
|
|
2557
|
+
|
|
|
|
2558
|
+ // static Future festivalAlertDialog(BuildContext context,
|
|
|
|
2559
|
+ // {String title = "标题",
|
|
|
|
2560
|
+ // String text = "内容",
|
|
|
|
2561
|
+ // String hintText = "内容",
|
|
|
|
2562
|
+ // String lTitle = "取消",
|
|
|
|
2563
|
+ // String rTitle = "确定",
|
|
|
|
2564
|
+ // String toast = '请输入',
|
|
|
|
2565
|
+ // VoidCallback lCallback,
|
|
|
|
2566
|
+ // bool lenghtLimit = false,
|
|
|
|
2567
|
+ // TextInputType keyboardType = TextInputType.text,
|
|
|
|
2568
|
+ // CustomCallBack rCallback}) {
|
|
|
|
2569
|
+ // String name = text;
|
|
|
|
2570
|
+ // TextEditingController controller = TextEditingController();
|
|
|
|
2571
|
+ // controller.text = text;
|
|
|
|
2572
|
+ // showCupertinoDialog(
|
|
|
|
2573
|
+ // context: context,
|
|
|
|
2574
|
+ // builder: (context) {
|
|
|
|
2575
|
+ // return Stack(children: [
|
|
|
|
2576
|
+ // CupertinoAlertDialog(
|
|
|
|
2577
|
+ // title: title != ''
|
|
|
|
2578
|
+ // ? Text(title,
|
|
|
|
2579
|
+ // style: TextStyle(
|
|
|
|
2580
|
+ // fontWeight: FontWeight.bold,
|
|
|
|
2581
|
+ // fontSize: ScreenUtil().setSp(30),
|
|
|
|
2582
|
+ // ))
|
|
|
|
2583
|
+ // : SizedBox(),
|
|
|
|
2584
|
+ // content: Material(
|
|
|
|
2585
|
+ // color: Colors.transparent,
|
|
|
|
2586
|
+ // child: TextField(
|
|
|
|
2587
|
+ // controller: controller,
|
|
|
|
2588
|
+ // maxLines: 1,
|
|
|
|
2589
|
+ // autofocus: true,
|
|
|
|
2590
|
+ // // //光标颜色
|
|
|
|
2591
|
+ // // cursorColor:
|
|
|
|
2592
|
+ // // widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
2593
|
+ // //输入文本的样式
|
|
|
|
2594
|
+ // inputFormatters: lenghtLimit
|
|
|
|
2595
|
+ // ? [
|
|
|
|
2596
|
+ // LengthLimitingTextInputFormatter(10),
|
|
|
|
2597
|
+ // ]
|
|
|
|
2598
|
+ // : [],
|
|
|
|
2599
|
+ // textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
2600
|
+ // textAlign: TextAlign.center,
|
|
|
|
2601
|
+ // style: TextStyle(
|
|
|
|
2602
|
+ // fontSize: ScreenUtil().setSp(28),
|
|
|
|
2603
|
+ // ),
|
|
|
|
2604
|
+ // decoration: InputDecoration(
|
|
|
|
2605
|
+ // border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
2606
|
+ // hintText: hintText,
|
|
|
|
2607
|
+ // hintStyle: TextStyle(
|
|
|
|
2608
|
+ // color: MyColours.color_999999,
|
|
|
|
2609
|
+ // fontSize: ScreenUtil().setSp(28),
|
|
|
|
2610
|
+ // ),
|
|
|
|
2611
|
+ // enabledBorder: new UnderlineInputBorder(
|
|
|
|
2612
|
+ // borderSide: BorderSide.none,
|
|
|
|
2613
|
+ // ),
|
|
|
|
2614
|
+ // focusedBorder: new UnderlineInputBorder(
|
|
|
|
2615
|
+ // borderSide: BorderSide.none,
|
|
|
|
2616
|
+ // ),
|
|
|
|
2617
|
+ // ),
|
|
|
|
2618
|
+ // onChanged: (value) {
|
|
|
|
2619
|
+ // name = value;
|
|
|
|
2620
|
+ // },
|
|
|
|
2621
|
+ // onEditingComplete: () {
|
|
|
|
2622
|
+ // FocusScope.of(context)
|
|
|
|
2623
|
+ // .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
2624
|
+ // },
|
|
|
|
2625
|
+ // keyboardType: keyboardType)),
|
|
|
|
2626
|
+ // actions: [
|
|
|
|
2627
|
+ // CupertinoDialogAction(
|
|
|
|
2628
|
+ // child: Text(lTitle,
|
|
|
|
2629
|
+ // style: TextStyle(
|
|
|
|
2630
|
+ // fontSize: ScreenUtil().setSp(34),
|
|
|
|
2631
|
+ // color: MyColours.color_666666)),
|
|
|
|
2632
|
+ // onPressed: () {
|
|
|
|
2633
|
+ // Navigator.of(context).pop();
|
|
|
|
2634
|
+ // lCallback();
|
|
|
|
2635
|
+ // },
|
|
|
|
2636
|
+ // ),
|
|
|
|
2637
|
+ // CupertinoDialogAction(
|
|
|
|
2638
|
+ // child: Text(rTitle,
|
|
|
|
2639
|
+ // style: TextStyle(
|
|
|
|
2640
|
+ // fontSize: ScreenUtil().setSp(34),
|
|
|
|
2641
|
+ // color: MyColours.color_199095)),
|
|
|
|
2642
|
+ // onPressed: () {
|
|
|
|
2643
|
+ // if (name == '' || name.trim().length == 0) {
|
|
|
|
2644
|
+ // Utils.showToast(toast);
|
|
|
|
2645
|
+ // return;
|
|
|
|
2646
|
+ // }
|
|
|
|
2647
|
+ // Navigator.of(context).pop();
|
|
|
|
2648
|
+ // rCallback(name);
|
|
|
|
2649
|
+ // },
|
|
|
|
2650
|
+ // ),
|
|
|
|
2651
|
+ // ],
|
|
|
|
2652
|
+ // ),
|
|
|
|
2653
|
+ // Positioned(
|
|
|
|
2654
|
+ // right: 0,
|
|
|
|
2655
|
+ // top: 0,
|
|
|
|
2656
|
+ // child: Text('删除',
|
|
|
|
2657
|
+ // style: TextStyle(
|
|
|
|
2658
|
+ // fontWeight: FontWeight.bold,
|
|
|
|
2659
|
+ // fontSize: ScreenUtil().setSp(30),
|
|
|
|
2660
|
+ // color: MyColours.color_199095)))
|
|
|
|
2661
|
+ // ]);
|
|
|
|
2662
|
+ // },
|
|
|
|
2663
|
+ // );
|
|
|
|
2664
|
+ // }
|
|
|
|
2665
|
+
|
|
2342
|
//输入弹框
|
2666
|
//输入弹框
|
|
2343
|
static Future textfeildAlertDialog(BuildContext context,
|
2667
|
static Future textfeildAlertDialog(BuildContext context,
|
|
2344
|
{String title = "标题",
|
2668
|
{String title = "标题",
|