基础组件库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tip_dialog.dart 2.4 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import 'package:flutter/material.dart';
  2. import 'package:zhiying_comm/zhiying_comm.dart';
  3. class TipDialog extends StatelessWidget {
  4. String title;
  5. TipDialog({this.title = "温馨提示", this.content});
  6. String content;
  7. @override
  8. Widget build(BuildContext context) {
  9. return Scaffold(
  10. backgroundColor: Colors.transparent,
  11. body: Column(
  12. mainAxisAlignment: MainAxisAlignment.center,
  13. crossAxisAlignment: CrossAxisAlignment.center,
  14. children: <Widget>[
  15. Container(
  16. width: double.infinity,
  17. decoration: BoxDecoration(
  18. color: Colors.white, borderRadius: BorderRadius.circular(20)),
  19. margin: EdgeInsets.only(left: 91.w, right: 91.w),
  20. child: Column(
  21. children: <Widget>[
  22. Padding(
  23. padding: const EdgeInsets.only(top: 16),
  24. child: Text(
  25. title,
  26. style: TextStyle(fontSize: 30.sp,fontWeight: FontWeight.w400),
  27. ),
  28. ),
  29. Container(
  30. margin: EdgeInsets.all(16),
  31. constraints: BoxConstraints(minHeight: 100),
  32. child: Text(
  33. content,
  34. style: TextStyle(fontSize: 26.sp),
  35. ),
  36. ),
  37. Row(
  38. children: <Widget>[
  39. Expanded(
  40. child: Padding(
  41. padding: const EdgeInsets.only(
  42. left: 16, right: 16, bottom: 16),
  43. child: FlatButton(
  44. padding: EdgeInsets.only(top: 10, bottom: 10),
  45. color: HexColor.fromHex("#FFFF4242"),
  46. shape: RoundedRectangleBorder(
  47. borderRadius: BorderRadius.circular(50)),
  48. onPressed: () {
  49. Navigator.pop(context);
  50. },
  51. child: Text(
  52. "知道了",
  53. style: TextStyle(
  54. color: HexColor.fromHex("#FFFFFF"),
  55. fontSize: 26.sp),
  56. )),
  57. ))
  58. ],
  59. )
  60. ],
  61. ),
  62. )
  63. ],
  64. ),
  65. );
  66. }
  67. }