Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mono0926 committed Mar 28, 2022
1 parent e97ab7c commit 6579121
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 34 deletions.
3 changes: 3 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# https://pub.dev/packages/pedantic_mono
include: package:pedantic_mono/analysis_options.yaml
analyzer:
exclude:
- '**/generated_plugin_registrant.dart'
8 changes: 5 additions & 3 deletions example/lib/pages/nested_navigator_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ class _RootPage extends StatelessWidget {
ElevatedButton(
child: const Text('Next Page'),
onPressed: () {
Navigator.of(context).push<void>(MaterialPageRoute(
builder: (context) => const _RootPage(),
));
Navigator.of(context).push<void>(
MaterialPageRoute(
builder: (context) => const _RootPage(),
),
);
},
),
],
Expand Down
34 changes: 20 additions & 14 deletions lib/src/alert_dialog/alert_dialog_action.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,29 +63,35 @@ extension AlertDialogActionListEx<T> on List<AlertDialogAction<T>> {
List<Widget> convertToCupertinoDialogActions({
required ActionCallback<T> onPressed,
}) =>
map((a) => a.convertToCupertinoDialogAction(
onPressed: onPressed,
)).toList();
map(
(a) => a.convertToCupertinoDialogAction(
onPressed: onPressed,
),
).toList();

List<Widget> convertToMaterialDialogActions({
required ActionCallback<T> onPressed,
required Color destructiveColor,
required bool fullyCapitalized,
}) =>
map((a) => a.convertToMaterialDialogAction(
onPressed: onPressed,
destructiveColor: destructiveColor,
fullyCapitalized: fullyCapitalized,
)).toList();
map(
(a) => a.convertToMaterialDialogAction(
onPressed: onPressed,
destructiveColor: destructiveColor,
fullyCapitalized: fullyCapitalized,
),
).toList();

List<SheetAction<T>> convertToSheetActions() =>
where((a) => a.key != OkCancelResult.cancel)
.map((a) => SheetAction(
key: a.key,
label: a.label,
isDefaultAction: a.isDefaultAction,
isDestructiveAction: a.isDestructiveAction,
))
.map(
(a) => SheetAction(
key: a.key,
label: a.label,
isDefaultAction: a.isDefaultAction,
isDestructiveAction: a.isDestructiveAction,
),
)
.toList();

String? findCancelLabel() {
Expand Down
24 changes: 13 additions & 11 deletions lib/src/alert_dialog/show_confirmation_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,19 @@ class _ConfirmationMaterialDialogState<T>
controller: _scrollController,
shrinkWrap: widget.shrinkWrap,
children: widget.actions
.map((action) => RadioListTile<T>(
title: Text(action.label),
value: action.key,
groupValue: _selectedKey,
onChanged: (value) {
setState(() {
_selectedKey = value;
});
},
toggleable: true,
))
.map(
(action) => RadioListTile<T>(
title: Text(action.label),
value: action.key,
groupValue: _selectedKey,
onChanged: (value) {
setState(() {
_selectedKey = value;
});
},
toggleable: true,
),
)
.toList(),
),
),
Expand Down
14 changes: 8 additions & 6 deletions lib/src/modal_action_sheet/cupertino_modal_action_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ class CupertinoModalActionSheet<T> extends StatelessWidget {
),
),
actions: actions
.map((a) => CupertinoActionSheetAction(
isDestructiveAction: a.isDestructiveAction,
isDefaultAction: a.isDefaultAction,
onPressed: () => onPressed(a.key),
child: Text(a.label),
))
.map(
(a) => CupertinoActionSheetAction(
isDestructiveAction: a.isDestructiveAction,
isDefaultAction: a.isDefaultAction,
onPressed: () => onPressed(a.key),
child: Text(a.label),
),
)
.toList(),
),
),
Expand Down

0 comments on commit 6579121

Please sign in to comment.