Skip to content

Commit

Permalink
Add @useResult to each functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mono0926 committed Jan 17, 2023
1 parent e03d828 commit 61e11c3
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.8.1

- Add `@useResult` to each functions

## 1.8.0

- Support textCapitalization in DialogTextField (#91)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.8.0+1"
version: "1.8.1"
analyzer:
dependency: transitive
description:
Expand Down
2 changes: 2 additions & 0 deletions lib/src/alert_dialog/show_alert_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ 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
///
/// [useActionSheetForIOS] (default: false) only works for
/// iOS style. If it is set to true, [showModalActionSheet] is called
/// instead.
/// [actionsOverflowDirection] works only for Material style currently.
@useResult
Future<T?> showAlertDialog<T>({
required BuildContext context,
String? title,
Expand Down
2 changes: 2 additions & 0 deletions lib/src/alert_dialog/show_confirmation_dialog.dart
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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<T?> showConfirmationDialog<T>({
required BuildContext context,
required String title,
Expand Down
2 changes: 2 additions & 0 deletions lib/src/alert_dialog/show_ok_cancel_alert_dialog.dart
Original file line number Diff line number Diff line change
@@ -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
///
Expand All @@ -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<OkCancelResult> showOkCancelAlertDialog({
required BuildContext context,
String? title,
Expand Down
2 changes: 2 additions & 0 deletions lib/src/modal_action_sheet/modal_action_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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<T?> showModalActionSheet<T>({
required BuildContext context,
String? title,
Expand Down
2 changes: 2 additions & 0 deletions lib/src/text_input_dialog/show_text_answer_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:adaptive_dialog/adaptive_dialog.dart';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';

@useResult
Future<bool> showTextAnswerDialog({
required BuildContext context,
required String keyword,
Expand Down
2 changes: 2 additions & 0 deletions lib/src/text_input_dialog/show_text_input_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<List<String>?> showTextInputDialog({
required BuildContext context,
required List<DialogTextField> textFields,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 61e11c3

Please sign in to comment.