# Dialog 对话框

## 提示框
```dart
 _showTip() {
    MillDialog.tip(
      context,
      message: '你好',
      buttonText:  '确定',
    );
 }
```

![提示框](../../images/dialog1.jpg)

## 确认框
```dart
_showConfirm() {
    MillDialog.confirm(
      context,
      message: '你好',
      cancelText: 'CANCEL',
      confirmText: 'OK',
    );
 }
```

![提示框](../../images/dialog3.jpg)

## 带标题
title 字段设置标题
```dart
MillDialog.tip(
  context,
  buttonText: '确定',
  message: '你好',
  title: '这是标题',
);

MillDialog.confirm(
  context,
  message: '你好',
  title: 'Title'
);
```

![提示框](../../images/dialog2.jpg)


## 设置颜色
```dart
 _showColorTip() {
    MillDialog.tip(
      context,
      message: '竹外桃花三两枝，春江水暖鸭先知。蒌蒿满地芦芽短，正是河豚欲上时。',
      title: 'Tagore is a great poet',
      messageColor: Color(0xffee0a24),
      buttonTextColor: Color(0xff409eff),
      titleColor: Color(0xffee0a24),
      width: 320,
    );
  }


MillDialog.confirm(
  context,
  message: 'Tagore is a great poet',
  title: 'title',
  messageColor: Color(0xffee0a24),
  titleColor: Color(0xffee0a24),
  confirmTextColor: Color(0xffee0a24),
  cancelTextColor: Color(0xff333333),
  width: 320,
);
```

![提示框](../../images/dialog4.jpg)


## 设置按钮文字
cancelText 设置取消按钮文字， confirmText 设置确定按钮文字，buttonText 设置 tip 的关闭按钮文字。
```dart
 _showColorTip() {
    MillDialog.tip(
      context,
      message: '竹外桃花三两枝，春江水暖鸭先知。蒌蒿满地芦芽短，正是河豚欲上时。',
      title: 'Tagore is a great poet',
      messageColor: Color(0xffee0a24),
      buttonTextColor: Color(0xff409eff),
      titleColor: Color(0xffee0a24),
      buttonText: '我知道了',
      width: 320,
    );
  }


MillDialog.confirm(
  context,
  message: 'Tagore is a great poet',
  title: 'title',
  messageColor: Color(0xffee0a24),
  titleColor: Color(0xffee0a24),
  confirmText: 'AGREE',
  confirmTextColor: Color(0xffee0a24),
  cancelText: 'DISAGREE',
  cancelTextColor: Color(0xff333333),
  width: 320,
);
```


## Attributes



| 字段名称 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| message | 展示的文字 | String |  |
| title | 标题 | String |  |
| width | 宽度 | double | 286 |
| radius | 圆角 | double | 12 |
| barrierDismissible | 点击对话框(遮罩)是否关闭它 | bool | false |
| titleColor | 标题颜色 | Color | Color(0xff323233) |
| backgroundColor | 背景颜色 | Color | Color(0xffffffff) |
| messageColor | 字体颜色 | Color | Color(0xff646566) |
| onConfirm | 点击确定回调方法 | Function |  |
| **confirm 方法独有** |  |  |  |
| confirmTextColor | 确定按钮颜色 | Color | Color(0xff409eff) |
| cancelTextColor | 取消按钮颜色 | Color | Color(0xff333333) |
| confirmText | 确定按钮文案 | String | 确定 |
| cancelText | 取消按钮文案 | String | 取消 |
| onCancel | 取消回调 | Function |  |
| **tip 方法独有** |  |  |  |
| buttonText | 按钮文案 | String | 确定 |
| buttonTextColor | 按钮字体颜色 | Color | Color(0xff333333) |





