Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Upgrade to flutter_lints 2.0 #621

Merged
merged 4 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
844 changes: 413 additions & 431 deletions lib/codeviewer/code_segments.dart

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/data/gallery_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class ModelBinding extends StatefulWidget {
final Widget child;

@override
_ModelBindingState createState() => _ModelBindingState();
State<ModelBinding> createState() => _ModelBindingState();
}

class _ModelBindingState extends State<ModelBinding> {
Expand Down
2 changes: 1 addition & 1 deletion lib/deferred_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DeferredWidget extends StatefulWidget {
}

@override
_DeferredWidgetState createState() => _DeferredWidgetState();
State<DeferredWidget> createState() => _DeferredWidgetState();
}

class _DeferredWidgetState extends State<DeferredWidget> {
Expand Down
90 changes: 45 additions & 45 deletions lib/demos/cupertino/cupertino_alert_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CupertinoAlertDemo extends StatefulWidget {
final AlertDemoType type;

@override
_CupertinoAlertDemoState createState() => _CupertinoAlertDemoState();
State<CupertinoAlertDemo> createState() => _CupertinoAlertDemoState();
}

class _CupertinoAlertDemoState extends State<CupertinoAlertDemo>
Expand Down Expand Up @@ -104,52 +104,52 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo>
}

String _title(BuildContext context) {
final _localizations = GalleryLocalizations.of(context)!;
final localizations = GalleryLocalizations.of(context)!;
switch (widget.type) {
case AlertDemoType.alert:
return _localizations.demoCupertinoAlertTitle;
return localizations.demoCupertinoAlertTitle;
case AlertDemoType.alertTitle:
return _localizations.demoCupertinoAlertWithTitleTitle;
return localizations.demoCupertinoAlertWithTitleTitle;
case AlertDemoType.alertButtons:
return _localizations.demoCupertinoAlertButtonsTitle;
return localizations.demoCupertinoAlertButtonsTitle;
case AlertDemoType.alertButtonsOnly:
return _localizations.demoCupertinoAlertButtonsOnlyTitle;
return localizations.demoCupertinoAlertButtonsOnlyTitle;
case AlertDemoType.actionSheet:
return _localizations.demoCupertinoActionSheetTitle;
return localizations.demoCupertinoActionSheetTitle;
}
}

static Route<String> _alertDemoDialog(
BuildContext context,
Object? arguments,
) {
final _localizations = GalleryLocalizations.of(context)!;
final localizations = GalleryLocalizations.of(context)!;
return CupertinoDialogRoute<String>(
context: context,
builder: (context) => ApplyTextOptions(
child: CupertinoAlertDialog(
title: Text(_localizations.dialogDiscardTitle),
title: Text(localizations.dialogDiscardTitle),
actions: [
CupertinoDialogAction(
isDestructiveAction: true,
onPressed: () {
Navigator.of(
context,
).pop(_localizations.cupertinoAlertDiscard);
).pop(localizations.cupertinoAlertDiscard);
},
child: Text(
_localizations.cupertinoAlertDiscard,
localizations.cupertinoAlertDiscard,
),
),
CupertinoDialogAction(
isDefaultAction: true,
onPressed: () => Navigator.of(
context,
).pop(
_localizations.cupertinoAlertCancel,
localizations.cupertinoAlertCancel,
),
child: Text(
_localizations.cupertinoAlertCancel,
localizations.cupertinoAlertCancel,
),
),
],
Expand All @@ -162,36 +162,36 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo>
BuildContext context,
Object? arguments,
) {
final _localizations = GalleryLocalizations.of(context)!;
final localizations = GalleryLocalizations.of(context)!;
return CupertinoDialogRoute<String>(
context: context,
builder: (context) => ApplyTextOptions(
child: CupertinoAlertDialog(
title: Text(
_localizations.cupertinoAlertLocationTitle,
localizations.cupertinoAlertLocationTitle,
),
content: Text(
_localizations.cupertinoAlertLocationDescription,
localizations.cupertinoAlertLocationDescription,
),
actions: [
CupertinoDialogAction(
onPressed: () => Navigator.of(
context,
).pop(
_localizations.cupertinoAlertDontAllow,
localizations.cupertinoAlertDontAllow,
),
child: Text(
_localizations.cupertinoAlertDontAllow,
localizations.cupertinoAlertDontAllow,
),
),
CupertinoDialogAction(
onPressed: () => Navigator.of(
context,
).pop(
_localizations.cupertinoAlertAllow,
localizations.cupertinoAlertAllow,
),
child: Text(
_localizations.cupertinoAlertAllow,
localizations.cupertinoAlertAllow,
),
),
],
Expand All @@ -204,16 +204,16 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo>
BuildContext context,
Object? arguments,
) {
final _localizations = GalleryLocalizations.of(context)!;
final localizations = GalleryLocalizations.of(context)!;
return CupertinoDialogRoute<String>(
context: context,
builder: (context) => ApplyTextOptions(
child: CupertinoDessertDialog(
title: Text(
_localizations.cupertinoAlertFavoriteDessert,
localizations.cupertinoAlertFavoriteDessert,
),
content: Text(
_localizations.cupertinoAlertDessertDescription,
localizations.cupertinoAlertDessertDescription,
),
),
),
Expand All @@ -236,45 +236,45 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo>
BuildContext context,
Object? arguments,
) {
final _localizations = GalleryLocalizations.of(context)!;
final localizations = GalleryLocalizations.of(context)!;
return CupertinoModalPopupRoute<String>(
builder: (context) => ApplyTextOptions(
child: CupertinoActionSheet(
title: Text(
_localizations.cupertinoAlertFavoriteDessert,
localizations.cupertinoAlertFavoriteDessert,
),
message: Text(
_localizations.cupertinoAlertDessertDescription,
localizations.cupertinoAlertDessertDescription,
),
actions: [
CupertinoActionSheetAction(
onPressed: () => Navigator.of(
context,
).pop(
_localizations.cupertinoAlertCheesecake,
localizations.cupertinoAlertCheesecake,
),
child: Text(
_localizations.cupertinoAlertCheesecake,
localizations.cupertinoAlertCheesecake,
),
),
CupertinoActionSheetAction(
onPressed: () => Navigator.of(
context,
).pop(
_localizations.cupertinoAlertTiramisu,
localizations.cupertinoAlertTiramisu,
),
child: Text(
_localizations.cupertinoAlertTiramisu,
localizations.cupertinoAlertTiramisu,
),
),
CupertinoActionSheetAction(
onPressed: () => Navigator.of(
context,
).pop(
_localizations.cupertinoAlertApplePie,
localizations.cupertinoAlertApplePie,
),
child: Text(
_localizations.cupertinoAlertApplePie,
localizations.cupertinoAlertApplePie,
),
),
],
Expand All @@ -283,10 +283,10 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo>
onPressed: () => Navigator.of(
context,
).pop(
_localizations.cupertinoAlertCancel,
localizations.cupertinoAlertCancel,
),
child: Text(
_localizations.cupertinoAlertCancel,
localizations.cupertinoAlertCancel,
),
),
),
Expand Down Expand Up @@ -363,7 +363,7 @@ class CupertinoDessertDialog extends StatelessWidget {

@override
Widget build(BuildContext context) {
final _localizations = GalleryLocalizations.of(context)!;
final localizations = GalleryLocalizations.of(context)!;
return CupertinoAlertDialog(
title: title,
content: content,
Expand All @@ -373,47 +373,47 @@ class CupertinoDessertDialog extends StatelessWidget {
Navigator.of(
context,
).pop(
_localizations.cupertinoAlertCheesecake,
localizations.cupertinoAlertCheesecake,
);
},
child: Text(
_localizations.cupertinoAlertCheesecake,
localizations.cupertinoAlertCheesecake,
),
),
CupertinoDialogAction(
onPressed: () {
Navigator.of(
context,
).pop(
_localizations.cupertinoAlertTiramisu,
localizations.cupertinoAlertTiramisu,
);
},
child: Text(
_localizations.cupertinoAlertTiramisu,
localizations.cupertinoAlertTiramisu,
),
),
CupertinoDialogAction(
onPressed: () {
Navigator.of(
context,
).pop(
_localizations.cupertinoAlertApplePie,
localizations.cupertinoAlertApplePie,
);
},
child: Text(
_localizations.cupertinoAlertApplePie,
localizations.cupertinoAlertApplePie,
),
),
CupertinoDialogAction(
onPressed: () {
Navigator.of(
context,
).pop(
_localizations.cupertinoAlertChocolateBrownie,
localizations.cupertinoAlertChocolateBrownie,
);
},
child: Text(
_localizations.cupertinoAlertChocolateBrownie,
localizations.cupertinoAlertChocolateBrownie,
),
),
CupertinoDialogAction(
Expand All @@ -422,11 +422,11 @@ class CupertinoDessertDialog extends StatelessWidget {
Navigator.of(
context,
).pop(
_localizations.cupertinoAlertCancel,
localizations.cupertinoAlertCancel,
);
},
child: Text(
_localizations.cupertinoAlertCancel,
localizations.cupertinoAlertCancel,
),
),
],
Expand Down
8 changes: 4 additions & 4 deletions lib/demos/cupertino/cupertino_button_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ class CupertinoButtonDemo extends StatelessWidget {

@override
Widget build(BuildContext context) {
final _localizations = GalleryLocalizations.of(context)!;
final localizations = GalleryLocalizations.of(context)!;
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
automaticallyImplyLeading: false,
middle: Text(_localizations.demoCupertinoButtonsTitle),
middle: Text(localizations.demoCupertinoButtonsTitle),
),
child: Center(
child: Column(
Expand All @@ -26,14 +26,14 @@ class CupertinoButtonDemo extends StatelessWidget {
CupertinoButton(
onPressed: () {},
child: Text(
_localizations.cupertinoButton,
localizations.cupertinoButton,
),
),
const SizedBox(height: 16),
CupertinoButton.filled(
onPressed: () {},
child: Text(
_localizations.cupertinoButtonWithBackground,
localizations.cupertinoButtonWithBackground,
),
),
],
Expand Down
2 changes: 1 addition & 1 deletion lib/demos/cupertino/cupertino_picker_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CupertinoPickerDemo extends StatefulWidget {
const CupertinoPickerDemo({Key? key}) : super(key: key);

@override
_CupertinoPickerDemoState createState() => _CupertinoPickerDemoState();
State<CupertinoPickerDemo> createState() => _CupertinoPickerDemoState();
}

class _CupertinoPickerDemoState extends State<CupertinoPickerDemo> {
Expand Down
2 changes: 1 addition & 1 deletion lib/demos/cupertino/cupertino_refresh_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CupertinoRefreshControlDemo extends StatefulWidget {
const CupertinoRefreshControlDemo({Key? key}) : super(key: key);

@override
_CupertinoRefreshControlDemoState createState() =>
State<CupertinoRefreshControlDemo> createState() =>
_CupertinoRefreshControlDemoState();
}

Expand Down
2 changes: 1 addition & 1 deletion lib/demos/cupertino/cupertino_segmented_control_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CupertinoSegmentedControlDemo extends StatefulWidget {
const CupertinoSegmentedControlDemo({Key? key}) : super(key: key);

@override
_CupertinoSegmentedControlDemoState createState() =>
State<CupertinoSegmentedControlDemo> createState() =>
_CupertinoSegmentedControlDemoState();
}

Expand Down
Loading