|
1 | 1 | import 'dart:async'; |
2 | 2 |
|
3 | 3 | import 'package:flutter/material.dart'; |
4 | | -import 'package:fluttertoast/fluttertoast.dart'; |
5 | 4 | import 'package:gsy_github_app_flutter/common/localization/extension.dart'; |
6 | 5 | import 'package:gsy_github_app_flutter/common/repositories/issue_repository.dart'; |
| 6 | +import 'package:gsy_github_app_flutter/common/toast.dart'; |
7 | 7 | import 'package:gsy_github_app_flutter/model/issue.dart'; |
8 | 8 | import 'package:gsy_github_app_flutter/common/style/gsy_style.dart'; |
9 | 9 | import 'package:gsy_github_app_flutter/common/utils/common_utils.dart'; |
@@ -168,8 +168,7 @@ class _IssueDetailPageState extends State<IssueDetailPage> |
168 | 168 | }, |
169 | 169 | () { |
170 | 170 | if (contentData == null || contentData!.trim().isEmpty) { |
171 | | - Fluttertoast.showToast( |
172 | | - msg: context.l10n.issue_edit_issue_content_not_be_null); |
| 171 | + showToast(context.l10n.issue_edit_issue_content_not_be_null); |
173 | 172 | return; |
174 | 173 | } |
175 | 174 | CommonUtils.showLoadingDialog(context); |
@@ -217,13 +216,11 @@ class _IssueDetailPageState extends State<IssueDetailPage> |
217 | 216 | }, |
218 | 217 | () { |
219 | 218 | if (title == null || title!.trim().isEmpty) { |
220 | | - Fluttertoast.showToast( |
221 | | - msg: context.l10n.issue_edit_issue_title_not_be_null); |
| 219 | + showToast(context.l10n.issue_edit_issue_title_not_be_null); |
222 | 220 | return; |
223 | 221 | } |
224 | 222 | if (content == null || content!.trim().isEmpty) { |
225 | | - Fluttertoast.showToast( |
226 | | - msg: context.l10n.issue_edit_issue_content_not_be_null); |
| 223 | + showToast(context.l10n.issue_edit_issue_content_not_be_null); |
227 | 224 | return; |
228 | 225 | } |
229 | 226 | CommonUtils.showLoadingDialog(context); |
@@ -256,8 +253,7 @@ class _IssueDetailPageState extends State<IssueDetailPage> |
256 | 253 | }, |
257 | 254 | () { |
258 | 255 | if (content == null || content?.trim().isEmpty == true) { |
259 | | - Fluttertoast.showToast( |
260 | | - msg: context.l10n.issue_edit_issue_content_not_be_null); |
| 256 | + showToast(context.l10n.issue_edit_issue_content_not_be_null); |
261 | 257 | return; |
262 | 258 | } |
263 | 259 | CommonUtils.showLoadingDialog(context); |
|
0 commit comments