Skip to content

Commit 2cbad4b

Browse files
authored
Final chapter: migrate api doc samples to super-parameters (#104007)
1 parent 7fdf747 commit 2cbad4b

File tree

352 files changed

+779
-788
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

352 files changed

+779
-788
lines changed

examples/api/analysis_options.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,3 @@ linter:
66
rules:
77
# Samples want to print things pretty often.
88
avoid_print: false
9-
# TODO(goderbauer): enable when super params are more established and
10-
# seeing them in the API samples is no longer surprising,
11-
# https://github.com/flutter/flutter/issues/101068
12-
use_super_parameters: false

examples/api/lib/animation/curves/curve2_d.0.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'package:flutter/material.dart';
99
void main() => runApp(const MyApp());
1010

1111
class MyApp extends StatelessWidget {
12-
const MyApp({Key? key}) : super(key: key);
12+
const MyApp({super.key});
1313

1414
static const String _title = 'Flutter Code Sample';
1515

@@ -43,12 +43,12 @@ final CatmullRomSpline path = CatmullRomSpline(
4343

4444
class FollowCurve2D extends StatefulWidget {
4545
const FollowCurve2D({
46-
Key? key,
46+
super.key,
4747
required this.path,
4848
this.curve = Curves.easeInOut,
4949
required this.child,
5050
this.duration = const Duration(seconds: 1),
51-
}) : super(key: key);
51+
});
5252

5353
final Curve2D path;
5454
final Curve curve;
@@ -97,7 +97,7 @@ class _FollowCurve2DState extends State<FollowCurve2D>
9797
}
9898

9999
class MyStatelessWidget extends StatelessWidget {
100-
const MyStatelessWidget({Key? key}) : super(key: key);
100+
const MyStatelessWidget({super.key});
101101

102102
@override
103103
Widget build(BuildContext context) {

examples/api/lib/cupertino/activity_indicator/cupertino_activity_indicator.0.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'package:flutter/cupertino.dart';
99
void main() => runApp(const CupertinoIndicatorApp());
1010

1111
class CupertinoIndicatorApp extends StatelessWidget {
12-
const CupertinoIndicatorApp({Key? key}) : super(key: key);
12+
const CupertinoIndicatorApp({super.key});
1313

1414
@override
1515
Widget build(BuildContext context) {
@@ -21,7 +21,7 @@ class CupertinoIndicatorApp extends StatelessWidget {
2121
}
2222

2323
class CupertinoIndicatorExample extends StatelessWidget {
24-
const CupertinoIndicatorExample({Key? key}) : super(key: key);
24+
const CupertinoIndicatorExample({super.key});
2525

2626
@override
2727
Widget build(BuildContext context) {

examples/api/lib/cupertino/bottom_tab_bar/cupertino_tab_bar.0.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'package:flutter/cupertino.dart';
99
void main() => runApp(const CupertinoTabBarApp());
1010

1111
class CupertinoTabBarApp extends StatelessWidget {
12-
const CupertinoTabBarApp({Key? key}) : super(key: key);
12+
const CupertinoTabBarApp({super.key});
1313

1414
@override
1515
Widget build(BuildContext context) {
@@ -21,7 +21,7 @@ class CupertinoTabBarApp extends StatelessWidget {
2121
}
2222

2323
class CupertinoTabBarExample extends StatelessWidget {
24-
const CupertinoTabBarExample({Key? key}) : super(key: key);
24+
const CupertinoTabBarExample({super.key});
2525

2626
@override
2727
Widget build(BuildContext context) {

examples/api/lib/cupertino/button/cupertino_button.0.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'package:flutter/cupertino.dart';
99
void main() => runApp(const CupertinoButtonApp());
1010

1111
class CupertinoButtonApp extends StatelessWidget {
12-
const CupertinoButtonApp({Key? key}) : super(key: key);
12+
const CupertinoButtonApp({super.key});
1313

1414
@override
1515
Widget build(BuildContext context) {
@@ -21,7 +21,7 @@ class CupertinoButtonApp extends StatelessWidget {
2121
}
2222

2323
class CupertinoButtonExample extends StatelessWidget {
24-
const CupertinoButtonExample({Key? key}) : super(key: key);
24+
const CupertinoButtonExample({super.key});
2525

2626
@override
2727
Widget build(BuildContext context) {

examples/api/lib/cupertino/context_menu/cupertino_context_menu.0.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import 'package:flutter/material.dart';
1010
void main() => runApp(const ContextMenuApp());
1111

1212
class ContextMenuApp extends StatelessWidget {
13-
const ContextMenuApp({Key? key}) : super(key: key);
13+
const ContextMenuApp({super.key});
1414

1515
@override
1616
Widget build(BuildContext context) {
@@ -22,7 +22,7 @@ class ContextMenuApp extends StatelessWidget {
2222
}
2323

2424
class ContextMenuExample extends StatelessWidget {
25-
const ContextMenuExample({Key? key}) : super(key: key);
25+
const ContextMenuExample({super.key});
2626

2727
@override
2828
Widget build(BuildContext context) {

examples/api/lib/cupertino/date_picker/cupertino_date_picker.0.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'package:flutter/cupertino.dart';
99
void main() => runApp(const DatePickerApp());
1010

1111
class DatePickerApp extends StatelessWidget {
12-
const DatePickerApp({Key? key}) : super(key: key);
12+
const DatePickerApp({super.key});
1313

1414
@override
1515
Widget build(BuildContext context) {
@@ -21,7 +21,7 @@ class DatePickerApp extends StatelessWidget {
2121
}
2222

2323
class DatePickerExample extends StatefulWidget {
24-
const DatePickerExample({Key? key}) : super(key: key);
24+
const DatePickerExample({super.key});
2525

2626
@override
2727
State<DatePickerExample> createState() => _DatePickerExampleState();

examples/api/lib/cupertino/date_picker/cupertino_timer_picker.0.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'package:flutter/cupertino.dart';
99
void main() => runApp(const TimerPickerApp());
1010

1111
class TimerPickerApp extends StatelessWidget {
12-
const TimerPickerApp({Key? key}) : super(key: key);
12+
const TimerPickerApp({super.key});
1313

1414
@override
1515
Widget build(BuildContext context) {
@@ -21,7 +21,7 @@ class TimerPickerApp extends StatelessWidget {
2121
}
2222

2323
class TimerPickerExample extends StatefulWidget {
24-
const TimerPickerExample({Key? key}) : super(key: key);
24+
const TimerPickerExample({super.key});
2525

2626
@override
2727
State<TimerPickerExample> createState() => _TimerPickerExampleState();

examples/api/lib/cupertino/dialog/cupertino_action_sheet.0.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'package:flutter/cupertino.dart';
99
void main() => runApp(const ActionSheetApp());
1010

1111
class ActionSheetApp extends StatelessWidget {
12-
const ActionSheetApp({Key? key}) : super(key: key);
12+
const ActionSheetApp({super.key});
1313

1414
@override
1515
Widget build(BuildContext context) {
@@ -21,7 +21,7 @@ class ActionSheetApp extends StatelessWidget {
2121
}
2222

2323
class ActionSheetExample extends StatelessWidget {
24-
const ActionSheetExample({Key? key}) : super(key: key);
24+
const ActionSheetExample({super.key});
2525

2626
// This shows a CupertinoModalPopup which hosts a CupertinoActionSheet.
2727
void _showActionSheet(BuildContext context) {

examples/api/lib/cupertino/dialog/cupertino_alert_dialog.0.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'package:flutter/cupertino.dart';
99
void main() => runApp(const AlertDialogApp());
1010

1111
class AlertDialogApp extends StatelessWidget {
12-
const AlertDialogApp({Key? key}) : super(key: key);
12+
const AlertDialogApp({super.key});
1313

1414
@override
1515
Widget build(BuildContext context) {
@@ -21,7 +21,7 @@ class AlertDialogApp extends StatelessWidget {
2121
}
2222

2323
class AlertDialogExample extends StatelessWidget {
24-
const AlertDialogExample({Key? key}) : super(key: key);
24+
const AlertDialogExample({super.key});
2525

2626
// This shows a CupertinoModalPopup which hosts a CupertinoAlertDialog.
2727
void _showAlertDialog(BuildContext context) {

0 commit comments

Comments
 (0)