From 61e11c3c294eff9fcd61940233366064ecb2999b Mon Sep 17 00:00:00 2001 From: mono Date: Tue, 17 Jan 2023 11:37:27 +0900 Subject: [PATCH] Add `@useResult` to each functions --- CHANGELOG.md | 5 +++++ example/pubspec.lock | 2 +- lib/src/alert_dialog/show_alert_dialog.dart | 2 ++ lib/src/alert_dialog/show_confirmation_dialog.dart | 2 ++ lib/src/alert_dialog/show_ok_cancel_alert_dialog.dart | 2 ++ lib/src/modal_action_sheet/modal_action_sheet.dart | 2 ++ lib/src/text_input_dialog/show_text_answer_dialog.dart | 2 ++ lib/src/text_input_dialog/show_text_input_dialog.dart | 2 ++ pubspec.yaml | 2 +- 9 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5656fff..8fbbe18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.8.1 + +- Add `@useResult` to each functions + ## 1.8.0 - Support textCapitalization in DialogTextField (#91) @@ -7,6 +11,7 @@ - Adde maxLength to fields (#84) - Expose route settings on all apis (#88) + ## 1.6.4 - Use accentColor for macOS by using dynamic_color diff --git a/example/pubspec.lock b/example/pubspec.lock index c49d4cd..fbab5fa 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -14,7 +14,7 @@ packages: path: ".." relative: true source: path - version: "1.8.0+1" + version: "1.8.1" analyzer: dependency: transitive description: diff --git a/lib/src/alert_dialog/show_alert_dialog.dart b/lib/src/alert_dialog/show_alert_dialog.dart index 54eaaa0..d47faa4 100644 --- a/lib/src/alert_dialog/show_alert_dialog.dart +++ b/lib/src/alert_dialog/show_alert_dialog.dart @@ -5,6 +5,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:intersperse/intersperse.dart'; import 'package:macos_ui/macos_ui.dart'; +import 'package:meta/meta.dart'; /// Show alert dialog, whose appearance is adaptive according to platform /// @@ -12,6 +13,7 @@ import 'package:macos_ui/macos_ui.dart'; /// iOS style. If it is set to true, [showModalActionSheet] is called /// instead. /// [actionsOverflowDirection] works only for Material style currently. +@useResult Future showAlertDialog({ required BuildContext context, String? title, diff --git a/lib/src/alert_dialog/show_confirmation_dialog.dart b/lib/src/alert_dialog/show_confirmation_dialog.dart index f727529..ad47b21 100644 --- a/lib/src/alert_dialog/show_confirmation_dialog.dart +++ b/lib/src/alert_dialog/show_confirmation_dialog.dart @@ -1,6 +1,7 @@ import 'package:adaptive_dialog/adaptive_dialog.dart'; import 'package:animations/animations.dart'; import 'package:flutter/material.dart'; +import 'package:meta/meta.dart'; /// Show [confirmation dialog](https://material.io/components/dialogs#confirmation-dialog), /// whose appearance is adaptive according to platform @@ -13,6 +14,7 @@ import 'package:flutter/material.dart'; /// for performance optimization. /// if [initialSelectedActionKey] is set, corresponding action is selected /// initially. This works only for Android style. +@useResult Future showConfirmationDialog({ required BuildContext context, required String title, diff --git a/lib/src/alert_dialog/show_ok_cancel_alert_dialog.dart b/lib/src/alert_dialog/show_ok_cancel_alert_dialog.dart index 0fba034..0cc4220 100644 --- a/lib/src/alert_dialog/show_ok_cancel_alert_dialog.dart +++ b/lib/src/alert_dialog/show_ok_cancel_alert_dialog.dart @@ -1,6 +1,7 @@ import 'package:adaptive_dialog/adaptive_dialog.dart'; import 'package:adaptive_dialog/src/extensions/extensions.dart'; import 'package:flutter/material.dart'; +import 'package:meta/meta.dart'; /// Show OK/Cancel alert dialog, whose appearance is adaptive according to platform /// @@ -11,6 +12,7 @@ import 'package:flutter/material.dart'; /// [defaultType] only works for cupertino style and if it is specified /// OK or Cancel button label will be changed to bold. /// [actionsOverflowDirection] works only for Material style currently. +@useResult Future showOkCancelAlertDialog({ required BuildContext context, String? title, diff --git a/lib/src/modal_action_sheet/modal_action_sheet.dart b/lib/src/modal_action_sheet/modal_action_sheet.dart index 0d17c47..5a71b81 100644 --- a/lib/src/modal_action_sheet/modal_action_sheet.dart +++ b/lib/src/modal_action_sheet/modal_action_sheet.dart @@ -2,6 +2,7 @@ import 'package:adaptive_dialog/adaptive_dialog.dart'; import 'package:adaptive_dialog/src/modal_action_sheet/material_modal_action_sheet.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:meta/meta.dart'; import 'cupertino_modal_action_sheet.dart'; @@ -11,6 +12,7 @@ export 'sheet_action.dart'; /// The [isDismissible] parameter only works for material style and it specifies /// whether the bottom sheet will be dismissed when user taps on the scrim. +@useResult Future showModalActionSheet({ required BuildContext context, String? title, diff --git a/lib/src/text_input_dialog/show_text_answer_dialog.dart b/lib/src/text_input_dialog/show_text_answer_dialog.dart index bb2cfd5..71b7ee9 100644 --- a/lib/src/text_input_dialog/show_text_answer_dialog.dart +++ b/lib/src/text_input_dialog/show_text_answer_dialog.dart @@ -1,6 +1,8 @@ import 'package:adaptive_dialog/adaptive_dialog.dart'; import 'package:flutter/material.dart'; +import 'package:meta/meta.dart'; +@useResult Future showTextAnswerDialog({ required BuildContext context, required String keyword, diff --git a/lib/src/text_input_dialog/show_text_input_dialog.dart b/lib/src/text_input_dialog/show_text_input_dialog.dart index cae10f7..e6eb8ca 100644 --- a/lib/src/text_input_dialog/show_text_input_dialog.dart +++ b/lib/src/text_input_dialog/show_text_input_dialog.dart @@ -5,10 +5,12 @@ import 'package:animations/animations.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:macos_ui/macos_ui.dart'; +import 'package:meta/meta.dart'; import 'macos_text_input_dialog.dart'; import 'material_text_input_dialog.dart'; +@useResult Future?> showTextInputDialog({ required BuildContext context, required List textFields, diff --git a/pubspec.yaml b/pubspec.yaml index 32b9ace..20e7521 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: adaptive_dialog description: Show alert dialog or modal action sheet adaptively according to platform. -version: 1.8.0+1 +version: 1.8.1 repository: https://github.com/mono0926/adaptive_dialog funding: - https://github.com/sponsors/mono0926