Rename Sample classes (#124080)
Rename Sample classes
diff --git a/examples/api/lib/animation/curves/curve2_d.0.dart b/examples/api/lib/animation/curves/curve2_d.0.dart
index 74b93a6..f2d0d81 100644
--- a/examples/api/lib/animation/curves/curve2_d.0.dart
+++ b/examples/api/lib/animation/curves/curve2_d.0.dart
@@ -2,22 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Curve2D].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Curve2D].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const Curve2DExampleApp());
- static const String _title = 'Flutter Code Sample';
+class Curve2DExampleApp extends StatelessWidget {
+ const Curve2DExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: Curve2DExample(),
);
}
}
@@ -59,8 +56,7 @@
State<FollowCurve2D> createState() => _FollowCurve2DState();
}
-class _FollowCurve2DState extends State<FollowCurve2D>
- with TickerProviderStateMixin {
+class _FollowCurve2DState extends State<FollowCurve2D> with TickerProviderStateMixin {
// The animation controller for this animation.
late AnimationController controller;
// The animation that will be used to apply the widget's animation curve.
@@ -87,8 +83,7 @@
@override
Widget build(BuildContext context) {
// Scale the path values to match the -1.0 to 1.0 domain of the Alignment widget.
- final Offset position =
- widget.path.transform(animation.value) * 2.0 - const Offset(1.0, 1.0);
+ final Offset position = widget.path.transform(animation.value) * 2.0 - const Offset(1.0, 1.0);
return Align(
alignment: Alignment(position.dx, position.dy),
child: widget.child,
@@ -96,8 +91,8 @@
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class Curve2DExample extends StatelessWidget {
+ const Curve2DExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/cupertino/activity_indicator/cupertino_activity_indicator.0.dart b/examples/api/lib/cupertino/activity_indicator/cupertino_activity_indicator.0.dart
index 5014879..a21e571 100644
--- a/examples/api/lib/cupertino/activity_indicator/cupertino_activity_indicator.0.dart
+++ b/examples/api/lib/cupertino/activity_indicator/cupertino_activity_indicator.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoActivityIndicator].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoActivityIndicator].
+
void main() => runApp(const CupertinoIndicatorApp());
class CupertinoIndicatorApp extends StatelessWidget {
@@ -69,7 +69,7 @@
),
],
),
- )
+ ),
);
}
}
diff --git a/examples/api/lib/cupertino/bottom_tab_bar/cupertino_tab_bar.0.dart b/examples/api/lib/cupertino/bottom_tab_bar/cupertino_tab_bar.0.dart
index 582bf25..4f145ea 100644
--- a/examples/api/lib/cupertino/bottom_tab_bar/cupertino_tab_bar.0.dart
+++ b/examples/api/lib/cupertino/bottom_tab_bar/cupertino_tab_bar.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoTabBar].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoTabBar].
+
void main() => runApp(const CupertinoTabBarApp());
class CupertinoTabBarApp extends StatelessWidget {
@@ -30,7 +30,7 @@
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(CupertinoIcons.star_fill),
- label: 'Favourites',
+ label: 'Favorites',
),
BottomNavigationBarItem(
icon: Icon(CupertinoIcons.clock_solid),
diff --git a/examples/api/lib/cupertino/button/cupertino_button.0.dart b/examples/api/lib/cupertino/button/cupertino_button.0.dart
index e8264b3..77581f6 100644
--- a/examples/api/lib/cupertino/button/cupertino_button.0.dart
+++ b/examples/api/lib/cupertino/button/cupertino_button.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoButton].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoButton].
+
void main() => runApp(const CupertinoButtonApp());
class CupertinoButtonApp extends StatelessWidget {
diff --git a/examples/api/lib/cupertino/context_menu/cupertino_context_menu.0.dart b/examples/api/lib/cupertino/context_menu/cupertino_context_menu.0.dart
index e989b91..f20ab23 100644
--- a/examples/api/lib/cupertino/context_menu/cupertino_context_menu.0.dart
+++ b/examples/api/lib/cupertino/context_menu/cupertino_context_menu.0.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoContextMenu].
-
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
+/// Flutter code sample for [CupertinoContextMenu].
+
void main() => runApp(const ContextMenuApp());
class ContextMenuApp extends StatelessWidget {
diff --git a/examples/api/lib/cupertino/context_menu/cupertino_context_menu.1.dart b/examples/api/lib/cupertino/context_menu/cupertino_context_menu.1.dart
index dc75a71..b54ab15 100644
--- a/examples/api/lib/cupertino/context_menu/cupertino_context_menu.1.dart
+++ b/examples/api/lib/cupertino/context_menu/cupertino_context_menu.1.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoContextMenu].
-
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
+/// Flutter code sample for [CupertinoContextMenu].
+
final DecorationTween _tween = DecorationTween(
begin: BoxDecoration(
color: CupertinoColors.systemYellow,
@@ -93,15 +93,12 @@
child: const Text('Delete'),
),
],
- builder:(BuildContext context, Animation<double> animation) {
- final Animation<Decoration> boxDecorationAnimation =
- _boxDecorationAnimation(animation);
+ builder: (BuildContext context, Animation<double> animation) {
+ final Animation<Decoration> boxDecorationAnimation = _boxDecorationAnimation(animation);
return Container(
decoration:
- animation.value < CupertinoContextMenu.animationOpensAt
- ? boxDecorationAnimation.value
- : null,
+ animation.value < CupertinoContextMenu.animationOpensAt ? boxDecorationAnimation.value : null,
child: Container(
decoration: BoxDecoration(
color: CupertinoColors.systemYellow,
diff --git a/examples/api/lib/cupertino/date_picker/cupertino_date_picker.0.dart b/examples/api/lib/cupertino/date_picker/cupertino_date_picker.0.dart
index a682f75..bc9acb3 100644
--- a/examples/api/lib/cupertino/date_picker/cupertino_date_picker.0.dart
+++ b/examples/api/lib/cupertino/date_picker/cupertino_date_picker.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoDatePicker].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoDatePicker].
+
void main() => runApp(const DatePickerApp());
class DatePickerApp extends StatelessWidget {
@@ -52,7 +52,7 @@
top: false,
child: child,
),
- )
+ ),
);
}
@@ -92,7 +92,8 @@
// In this example, the date is formatted manually. You can
// use the intl package to format the value based on the
// user's locale settings.
- child: Text('${date.month}-${date.day}-${date.year}',
+ child: Text(
+ '${date.month}-${date.day}-${date.year}',
style: const TextStyle(
fontSize: 22.0,
),
@@ -119,7 +120,8 @@
// In this example, the time value is formatted manually.
// You can use the intl package to format the value based on
// the user's locale settings.
- child: Text('${time.hour}:${time.minute}',
+ child: Text(
+ '${time.hour}:${time.minute}',
style: const TextStyle(
fontSize: 22.0,
),
@@ -145,7 +147,8 @@
// In this example, the time value is formatted manually. You
// can use the intl package to format the value based on the
// user's locale settings.
- child: Text('${dateTime.month}-${dateTime.day}-${dateTime.year} ${dateTime.hour}:${dateTime.minute}',
+ child: Text(
+ '${dateTime.month}-${dateTime.day}-${dateTime.year} ${dateTime.hour}:${dateTime.minute}',
style: const TextStyle(
fontSize: 22.0,
),
diff --git a/examples/api/lib/cupertino/date_picker/cupertino_timer_picker.0.dart b/examples/api/lib/cupertino/date_picker/cupertino_timer_picker.0.dart
index e27dbae..c71a911 100644
--- a/examples/api/lib/cupertino/date_picker/cupertino_timer_picker.0.dart
+++ b/examples/api/lib/cupertino/date_picker/cupertino_timer_picker.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoTimerPicker].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoTimerPicker].
+
void main() => runApp(const TimerPickerApp());
class TimerPickerApp extends StatelessWidget {
@@ -50,7 +50,7 @@
top: false,
child: child,
),
- )
+ ),
);
}
@@ -88,7 +88,8 @@
// In this example, the timer's value is formatted manually.
// You can use the intl package to format the value based on
// the user's locale settings.
- child: Text('$duration',
+ child: Text(
+ '$duration',
style: const TextStyle(
fontSize: 22.0,
),
diff --git a/examples/api/lib/cupertino/dialog/cupertino_action_sheet.0.dart b/examples/api/lib/cupertino/dialog/cupertino_action_sheet.0.dart
index 5da52bb..f215bd2 100644
--- a/examples/api/lib/cupertino/dialog/cupertino_action_sheet.0.dart
+++ b/examples/api/lib/cupertino/dialog/cupertino_action_sheet.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoActionSheet].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoActionSheet].
+
void main() => runApp(const ActionSheetApp());
class ActionSheetApp extends StatelessWidget {
diff --git a/examples/api/lib/cupertino/dialog/cupertino_alert_dialog.0.dart b/examples/api/lib/cupertino/dialog/cupertino_alert_dialog.0.dart
index 74a3d58..185b4e3 100644
--- a/examples/api/lib/cupertino/dialog/cupertino_alert_dialog.0.dart
+++ b/examples/api/lib/cupertino/dialog/cupertino_alert_dialog.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoAlertDialog].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoAlertDialog].
+
void main() => runApp(const AlertDialogApp());
class AlertDialogApp extends StatelessWidget {
diff --git a/examples/api/lib/cupertino/form_row/cupertino_form_row.0.dart b/examples/api/lib/cupertino/form_row/cupertino_form_row.0.dart
index bbc4197..982d3f0 100644
--- a/examples/api/lib/cupertino/form_row/cupertino_form_row.0.dart
+++ b/examples/api/lib/cupertino/form_row/cupertino_form_row.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoFormRow].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoFormRow].
+
void main() => runApp(const CupertinoFormRowApp());
class CupertinoFormRowApp extends StatelessWidget {
@@ -65,11 +65,7 @@
error: Text('Home network unavailable'),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
- children: <Widget>[
- Text('Not connected'),
- SizedBox(width: 5),
- Icon(CupertinoIcons.forward)
- ],
+ children: <Widget>[Text('Not connected'), SizedBox(width: 5), Icon(CupertinoIcons.forward)],
),
),
const CupertinoFormRow(
@@ -93,7 +89,7 @@
children: <Widget>[
Text('On'),
SizedBox(width: 5),
- Icon(CupertinoIcons.forward)
+ Icon(CupertinoIcons.forward),
],
),
),
diff --git a/examples/api/lib/cupertino/list_section/list_section_base.0.dart b/examples/api/lib/cupertino/list_section/list_section_base.0.dart
index dcdc6a2..c30d50a 100644
--- a/examples/api/lib/cupertino/list_section/list_section_base.0.dart
+++ b/examples/api/lib/cupertino/list_section/list_section_base.0.dart
@@ -2,28 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for base [CupertinoListSection] and [CupertinoListTile].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for base [CupertinoListSection] and [CupertinoListTile].
+
void main() => runApp(const CupertinoListSectionBaseApp());
class CupertinoListSectionBaseApp extends StatelessWidget {
const CupertinoListSectionBaseApp({super.key});
- static const String _title = 'Flutter Code Sample';
-
@override
Widget build(BuildContext context) {
return const CupertinoApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: ListSectionBaseExample(),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class ListSectionBaseExample extends StatelessWidget {
+ const ListSectionBaseExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/cupertino/list_section/list_section_inset.0.dart b/examples/api/lib/cupertino/list_section/list_section_inset.0.dart
index 3844514..d2d1105 100644
--- a/examples/api/lib/cupertino/list_section/list_section_inset.0.dart
+++ b/examples/api/lib/cupertino/list_section/list_section_inset.0.dart
@@ -2,28 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for inset [CupertinoListSection] and [CupertinoListTile].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for inset [CupertinoListSection] and [CupertinoListTile].
+
void main() => runApp(const CupertinoListSectionInsetApp());
class CupertinoListSectionInsetApp extends StatelessWidget {
const CupertinoListSectionInsetApp({super.key});
- static const String _title = 'Flutter Code Sample';
-
@override
Widget build(BuildContext context) {
return const CupertinoApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: ListSectionInsetExample(),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class ListSectionInsetExample extends StatelessWidget {
+ const ListSectionInsetExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/cupertino/nav_bar/cupertino_navigation_bar.0.dart b/examples/api/lib/cupertino/nav_bar/cupertino_navigation_bar.0.dart
index 4db7493..97a211c 100644
--- a/examples/api/lib/cupertino/nav_bar/cupertino_navigation_bar.0.dart
+++ b/examples/api/lib/cupertino/nav_bar/cupertino_navigation_bar.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoNavigationBar].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoNavigationBar].
+
void main() => runApp(const NavBarApp());
class NavBarApp extends StatelessWidget {
diff --git a/examples/api/lib/cupertino/nav_bar/cupertino_sliver_nav_bar.0.dart b/examples/api/lib/cupertino/nav_bar/cupertino_sliver_nav_bar.0.dart
index 9175381..bc897e1 100644
--- a/examples/api/lib/cupertino/nav_bar/cupertino_sliver_nav_bar.0.dart
+++ b/examples/api/lib/cupertino/nav_bar/cupertino_sliver_nav_bar.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoSliverNavigationBar].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoSliverNavigationBar].
+
void main() => runApp(const SliverNavBarApp());
class SliverNavBarApp extends StatelessWidget {
@@ -47,9 +47,14 @@
const Text('Drag me up', textAlign: TextAlign.center),
CupertinoButton.filled(
onPressed: () {
- Navigator.push(context, CupertinoPageRoute<Widget>(builder: (BuildContext context) {
- return const NextPage();
- }));
+ Navigator.push(
+ context,
+ CupertinoPageRoute<Widget>(
+ builder: (BuildContext context) {
+ return const NextPage();
+ },
+ ),
+ );
},
child: const Text('Go to Next Page'),
),
@@ -63,21 +68,19 @@
}
class NextPage extends StatelessWidget {
- const NextPage({ super.key });
+ const NextPage({super.key});
@override
Widget build(BuildContext context) {
final Brightness brightness = CupertinoTheme.brightnessOf(context);
- return CupertinoPageScaffold(
+ return CupertinoPageScaffold(
child: CustomScrollView(
slivers: <Widget>[
CupertinoSliverNavigationBar(
backgroundColor: CupertinoColors.systemYellow,
border: Border(
bottom: BorderSide(
- color: brightness == Brightness.light
- ? CupertinoColors.black
- : CupertinoColors.white,
+ color: brightness == Brightness.light ? CupertinoColors.black : CupertinoColors.white,
),
),
// The middle widget is visible in both collapsed and expanded states.
diff --git a/examples/api/lib/cupertino/page_scaffold/cupertino_page_scaffold.0.dart b/examples/api/lib/cupertino/page_scaffold/cupertino_page_scaffold.0.dart
index c7c4dcd..41c3c3b 100644
--- a/examples/api/lib/cupertino/page_scaffold/cupertino_page_scaffold.0.dart
+++ b/examples/api/lib/cupertino/page_scaffold/cupertino_page_scaffold.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoPageScaffold].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoPageScaffold].
+
void main() => runApp(const PageScaffoldApp());
class PageScaffoldApp extends StatelessWidget {
diff --git a/examples/api/lib/cupertino/picker/cupertino_picker.0.dart b/examples/api/lib/cupertino/picker/cupertino_picker.0.dart
index 73d57cc..4ab0a2e 100644
--- a/examples/api/lib/cupertino/picker/cupertino_picker.0.dart
+++ b/examples/api/lib/cupertino/picker/cupertino_picker.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoPicker].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoPicker].
+
const double _kItemExtent = 32.0;
const List<String> _fruitNames = <String>[
'Apple',
diff --git a/examples/api/lib/cupertino/radio/cupertino_radio.0.dart b/examples/api/lib/cupertino/radio/cupertino_radio.0.dart
index e30859f..6033b75 100644
--- a/examples/api/lib/cupertino/radio/cupertino_radio.0.dart
+++ b/examples/api/lib/cupertino/radio/cupertino_radio.0.dart
@@ -11,15 +11,13 @@
class CupertinoRadioApp extends StatelessWidget {
const CupertinoRadioApp({super.key});
- static const String _title = 'CuptertinoRadio Example';
-
@override
Widget build(BuildContext context) {
return const CupertinoApp(
theme: CupertinoThemeData(brightness: Brightness.light),
home: CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
- middle: Text(_title),
+ middle: Text('CupertinoRadio Example'),
),
child: SafeArea(
child: CupertinoRadioExample(),
diff --git a/examples/api/lib/cupertino/radio/cupertino_radio.toggleable.0.dart b/examples/api/lib/cupertino/radio/cupertino_radio.toggleable.0.dart
index 0cc210e..5a81881 100644
--- a/examples/api/lib/cupertino/radio/cupertino_radio.toggleable.0.dart
+++ b/examples/api/lib/cupertino/radio/cupertino_radio.toggleable.0.dart
@@ -11,14 +11,12 @@
class CupertinoRadioApp extends StatelessWidget {
const CupertinoRadioApp({super.key});
- static const String _title = 'CuptertinoRadio Toggleable Example';
-
@override
Widget build(BuildContext context) {
return const CupertinoApp(
home: CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
- middle: Text(_title),
+ middle: Text('CupertinoRadio Toggleable Example'),
),
child: SafeArea(
child: CupertinoRadioExample(),
diff --git a/examples/api/lib/cupertino/refresh/cupertino_sliver_refresh_control.0.dart b/examples/api/lib/cupertino/refresh/cupertino_sliver_refresh_control.0.dart
index ac5da6a..a7a8883 100644
--- a/examples/api/lib/cupertino/refresh/cupertino_sliver_refresh_control.0.dart
+++ b/examples/api/lib/cupertino/refresh/cupertino_sliver_refresh_control.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoSliverRefreshControl].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoSliverRefreshControl].
+
void main() => runApp(const RefreshControlApp());
class RefreshControlApp extends StatelessWidget {
diff --git a/examples/api/lib/cupertino/route/show_cupertino_dialog.0.dart b/examples/api/lib/cupertino/route/show_cupertino_dialog.0.dart
index a846728..06a2657 100644
--- a/examples/api/lib/cupertino/route/show_cupertino_dialog.0.dart
+++ b/examples/api/lib/cupertino/route/show_cupertino_dialog.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [showCupertinoDialog].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [showCupertinoDialog].
+
void main() => runApp(const CupertinoDialogApp());
class CupertinoDialogApp extends StatelessWidget {
@@ -42,8 +42,7 @@
}
@pragma('vm:entry-point')
- static Route<Object?> _dialogBuilder(
- BuildContext context, Object? arguments) {
+ static Route<Object?> _dialogBuilder(BuildContext context, Object? arguments) {
return CupertinoDialogRoute<void>(
context: context,
builder: (BuildContext context) {
diff --git a/examples/api/lib/cupertino/route/show_cupertino_modal_popup.0.dart b/examples/api/lib/cupertino/route/show_cupertino_modal_popup.0.dart
index 60cd006..188087e 100644
--- a/examples/api/lib/cupertino/route/show_cupertino_modal_popup.0.dart
+++ b/examples/api/lib/cupertino/route/show_cupertino_modal_popup.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [showCupertinoModalPopup].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [showCupertinoModalPopup].
+
void main() => runApp(const ModalPopupApp());
class ModalPopupApp extends StatelessWidget {
diff --git a/examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.0.dart b/examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.0.dart
index 277a89f..8f5855e 100644
--- a/examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.0.dart
+++ b/examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoScrollbar].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoScrollbar].
+
void main() => runApp(const ScrollbarApp());
class ScrollbarApp extends StatelessWidget {
diff --git a/examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.1.dart b/examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.1.dart
index efcfb1e..f8b1462e 100644
--- a/examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.1.dart
+++ b/examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoScrollbar].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoScrollbar].
+
void main() => runApp(const ScrollbarApp());
class ScrollbarApp extends StatelessWidget {
diff --git a/examples/api/lib/cupertino/search_field/cupertino_search_field.0.dart b/examples/api/lib/cupertino/search_field/cupertino_search_field.0.dart
index c2b2bed..01c956e 100644
--- a/examples/api/lib/cupertino/search_field/cupertino_search_field.0.dart
+++ b/examples/api/lib/cupertino/search_field/cupertino_search_field.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoSearchTextField].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoSearchTextField].
+
void main() => runApp(const SearchTextFieldApp());
class SearchTextFieldApp extends StatelessWidget {
diff --git a/examples/api/lib/cupertino/search_field/cupertino_search_field.1.dart b/examples/api/lib/cupertino/search_field/cupertino_search_field.1.dart
index 84ae329..6a106cc 100644
--- a/examples/api/lib/cupertino/search_field/cupertino_search_field.1.dart
+++ b/examples/api/lib/cupertino/search_field/cupertino_search_field.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoSearchTextField].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoSearchTextField].
+
void main() => runApp(const SearchTextFieldApp());
class SearchTextFieldApp extends StatelessWidget {
diff --git a/examples/api/lib/cupertino/segmented_control/cupertino_segmented_control.0.dart b/examples/api/lib/cupertino/segmented_control/cupertino_segmented_control.0.dart
index 9eedc9d..caad200 100644
--- a/examples/api/lib/cupertino/segmented_control/cupertino_segmented_control.0.dart
+++ b/examples/api/lib/cupertino/segmented_control/cupertino_segmented_control.0.dart
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoSegmentedControl].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoSegmentedControl].
+
enum Sky { midnight, viridian, cerulean }
-Map<Sky, Color> skyColors = <Sky, Color> {
+Map<Sky, Color> skyColors = <Sky, Color>{
Sky.midnight: const Color(0xff191970),
Sky.viridian: const Color(0xff40826d),
Sky.cerulean: const Color(0xff007ba7),
diff --git a/examples/api/lib/cupertino/segmented_control/cupertino_sliding_segmented_control.0.dart b/examples/api/lib/cupertino/segmented_control/cupertino_sliding_segmented_control.0.dart
index 7b98ec3..64f51a9 100644
--- a/examples/api/lib/cupertino/segmented_control/cupertino_sliding_segmented_control.0.dart
+++ b/examples/api/lib/cupertino/segmented_control/cupertino_sliding_segmented_control.0.dart
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoSlidingSegmentedControl].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoSlidingSegmentedControl].
+
enum Sky { midnight, viridian, cerulean }
-Map<Sky, Color> skyColors = <Sky, Color> {
+Map<Sky, Color> skyColors = <Sky, Color>{
Sky.midnight: const Color(0xff191970),
Sky.viridian: const Color(0xff40826d),
Sky.cerulean: const Color(0xff007ba7),
diff --git a/examples/api/lib/cupertino/slider/cupertino_slider.0.dart b/examples/api/lib/cupertino/slider/cupertino_slider.0.dart
index 1346806..d50faaf 100644
--- a/examples/api/lib/cupertino/slider/cupertino_slider.0.dart
+++ b/examples/api/lib/cupertino/slider/cupertino_slider.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoSlider].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoSlider].
+
void main() => runApp(const CupertinoSliderApp());
class CupertinoSliderApp extends StatelessWidget {
@@ -28,7 +28,7 @@
}
class _CupertinoSliderExampleState extends State<CupertinoSliderExample> {
- double _currentSliderValue = 0.0;
+ double _currentSliderValue = 0.0;
String? _sliderStatus;
@override
@@ -75,8 +75,8 @@
Text(
_sliderStatus ?? '',
style: CupertinoTheme.of(context).textTheme.textStyle.copyWith(
- fontSize: 12,
- ),
+ fontSize: 12,
+ ),
),
],
),
diff --git a/examples/api/lib/cupertino/switch/cupertino_switch.0.dart b/examples/api/lib/cupertino/switch/cupertino_switch.0.dart
index 8f5759f..9f40bf03 100644
--- a/examples/api/lib/cupertino/switch/cupertino_switch.0.dart
+++ b/examples/api/lib/cupertino/switch/cupertino_switch.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoSwitch].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoSwitch].
+
void main() => runApp(const CupertinoSwitchApp());
class CupertinoSwitchApp extends StatelessWidget {
diff --git a/examples/api/lib/cupertino/tab_scaffold/cupertino_tab_controller.0.dart b/examples/api/lib/cupertino/tab_scaffold/cupertino_tab_controller.0.dart
index fbc139e..0c67f83 100644
--- a/examples/api/lib/cupertino/tab_scaffold/cupertino_tab_controller.0.dart
+++ b/examples/api/lib/cupertino/tab_scaffold/cupertino_tab_controller.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoTabController].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoTabController].
+
void main() => runApp(const TabControllerApp());
class TabControllerApp extends StatelessWidget {
@@ -64,7 +64,7 @@
child: const Text('Go to first tab'),
),
],
- )
+ ),
);
},
);
diff --git a/examples/api/lib/cupertino/tab_scaffold/cupertino_tab_scaffold.0.dart b/examples/api/lib/cupertino/tab_scaffold/cupertino_tab_scaffold.0.dart
index 14be655..e69049c 100644
--- a/examples/api/lib/cupertino/tab_scaffold/cupertino_tab_scaffold.0.dart
+++ b/examples/api/lib/cupertino/tab_scaffold/cupertino_tab_scaffold.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoTabScaffold].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoTabScaffold].
+
void main() => runApp(const TabScaffoldApp());
class TabScaffoldApp extends StatelessWidget {
diff --git a/examples/api/lib/cupertino/text_field/cupertino_text_field.0.dart b/examples/api/lib/cupertino/text_field/cupertino_text_field.0.dart
index f33365a..70ddb14 100644
--- a/examples/api/lib/cupertino/text_field/cupertino_text_field.0.dart
+++ b/examples/api/lib/cupertino/text_field/cupertino_text_field.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoTextField].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoTextField].
+
void main() => runApp(const CupertinoTextFieldApp());
class CupertinoTextFieldApp extends StatelessWidget {
@@ -51,7 +51,7 @@
child: Center(
child: CupertinoTextField(
controller: _textController,
- )
+ ),
),
);
}
diff --git a/examples/api/lib/cupertino/text_form_field_row/cupertino_text_form_field_row.1.dart b/examples/api/lib/cupertino/text_form_field_row/cupertino_text_form_field_row.1.dart
index 73a2b73..4506b60 100644
--- a/examples/api/lib/cupertino/text_form_field_row/cupertino_text_form_field_row.1.dart
+++ b/examples/api/lib/cupertino/text_form_field_row/cupertino_text_form_field_row.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CupertinoTextFormFieldRow].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [CupertinoTextFormFieldRow].
+
void main() => runApp(const FormSectionApp());
class FormSectionApp extends StatelessWidget {
diff --git a/examples/api/lib/gestures/pointer_signal_resolver/pointer_signal_resolver.0.dart b/examples/api/lib/gestures/pointer_signal_resolver/pointer_signal_resolver.0.dart
index d2f5a22..ff1b060 100644
--- a/examples/api/lib/gestures/pointer_signal_resolver/pointer_signal_resolver.0.dart
+++ b/examples/api/lib/gestures/pointer_signal_resolver/pointer_signal_resolver.0.dart
@@ -2,24 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [PointerSignalResolver].
-
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [PointerSignalResolver].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const PointerSignalResolverExampleApp());
- static const String _title = 'Flutter Code Sample';
+class PointerSignalResolverExampleApp extends StatelessWidget {
+ const PointerSignalResolverExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: PointerSignalResolverExample(),
);
}
}
@@ -65,8 +62,7 @@
child: Listener(
onPointerSignal: (PointerSignalEvent event) {
if (widget.useResolver) {
- GestureBinding.instance.pointerSignalResolver.register(event,
- (PointerSignalEvent event) {
+ GestureBinding.instance.pointerSignalResolver.register(event, (PointerSignalEvent event) {
rotateColor();
});
} else {
@@ -85,14 +81,14 @@
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class PointerSignalResolverExample extends StatefulWidget {
+ const PointerSignalResolverExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<PointerSignalResolverExample> createState() => _PointerSignalResolverExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _PointerSignalResolverExampleState extends State<PointerSignalResolverExample> {
bool useResolver = false;
@override
diff --git a/examples/api/lib/material/about/about_list_tile.0.dart b/examples/api/lib/material/about/about_list_tile.0.dart
index 7b7e7e9..ca431cb 100644
--- a/examples/api/lib/material/about/about_list_tile.0.dart
+++ b/examples/api/lib/material/about/about_list_tile.0.dart
@@ -2,28 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AboutListTile].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [AboutListTile].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const AboutListTileExampleApp());
- static const String _title = 'Flutter Code Sample';
+class AboutListTileExampleApp extends StatelessWidget {
+ const AboutListTileExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: AboutListTileExample(),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class AboutListTileExample extends StatelessWidget {
+ const AboutListTileExample({super.key});
@override
Widget build(BuildContext context) {
@@ -39,9 +36,7 @@
text: "Flutter is Google's UI toolkit for building beautiful, "
'natively compiled applications for mobile, web, and desktop '
'from a single codebase. Learn more about Flutter at '),
- TextSpan(
- style: textStyle.copyWith(color: theme.colorScheme.primary),
- text: 'https://flutter.dev'),
+ TextSpan(style: textStyle.copyWith(color: theme.colorScheme.primary), text: 'https://flutter.dev'),
TextSpan(style: textStyle, text: '.'),
],
),
diff --git a/examples/api/lib/material/action_buttons/action_icon_theme.0.dart b/examples/api/lib/material/action_buttons/action_icon_theme.0.dart
index 44d28a2..653b6ee 100644
--- a/examples/api/lib/material/action_buttons/action_icon_theme.0.dart
+++ b/examples/api/lib/material/action_buttons/action_icon_theme.0.dart
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ActionIconTheme].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ActionIconTheme].
+
void main() {
- runApp(const MyApp());
+ runApp(const ActionIconThemeExampleApp());
}
class _CustomEndDrawerIcon extends StatelessWidget {
@@ -36,13 +36,12 @@
}
}
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+class ActionIconThemeExampleApp extends StatelessWidget {
+ const ActionIconThemeExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
useMaterial3: true,
diff --git a/examples/api/lib/material/animated_icon/animated_icon.0.dart b/examples/api/lib/material/animated_icon/animated_icon.0.dart
index 9e07162..c63df8b 100644
--- a/examples/api/lib/material/animated_icon/animated_icon.0.dart
+++ b/examples/api/lib/material/animated_icon/animated_icon.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AnimatedIcon].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [AnimatedIcon].
+
void main() {
runApp(const AnimatedIconApp());
}
@@ -44,8 +44,9 @@
controller = AnimationController(
vsync: this,
duration: const Duration(seconds: 2),
- )..forward()
- ..repeat(reverse: true);
+ )
+ ..forward()
+ ..repeat(reverse: true);
animation = Tween<double>(begin: 0.0, end: 1.0).animate(controller);
}
diff --git a/examples/api/lib/material/animated_icon/animated_icons_data.0.dart b/examples/api/lib/material/animated_icon/animated_icons_data.0.dart
index 6f06873..cc1ae2c 100644
--- a/examples/api/lib/material/animated_icon/animated_icons_data.0.dart
+++ b/examples/api/lib/material/animated_icon/animated_icons_data.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AnimatedIcon].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [AnimatedIcon].
+
final Map<String, AnimatedIconData> iconsList = <String, AnimatedIconData>{
'add_event': AnimatedIcons.add_event,
'arrow_menu': AnimatedIcons.arrow_menu,
@@ -61,8 +61,9 @@
controller = AnimationController(
vsync: this,
duration: const Duration(seconds: 2),
- )..forward()
- ..repeat(reverse: true);
+ )
+ ..forward()
+ ..repeat(reverse: true);
animation = Tween<double>(begin: 0.0, end: 1.0).animate(controller);
}
diff --git a/examples/api/lib/material/app_bar/app_bar.0.dart b/examples/api/lib/material/app_bar/app_bar.0.dart
index e079892..e64d3b8 100644
--- a/examples/api/lib/material/app_bar/app_bar.0.dart
+++ b/examples/api/lib/material/app_bar/app_bar.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AppBar].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [AppBar].
+
void main() => runApp(const AppBarApp());
class AppBarApp extends StatelessWidget {
@@ -32,8 +32,7 @@
icon: const Icon(Icons.add_alert),
tooltip: 'Show Snackbar',
onPressed: () {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(content: Text('This is a snackbar')));
+ ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('This is a snackbar')));
},
),
IconButton(
diff --git a/examples/api/lib/material/app_bar/app_bar.1.dart b/examples/api/lib/material/app_bar/app_bar.1.dart
index 2f4eb93..387ad18 100644
--- a/examples/api/lib/material/app_bar/app_bar.1.dart
+++ b/examples/api/lib/material/app_bar/app_bar.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AppBar].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [AppBar].
+
final List<int> _items = List<int>.generate(51, (int index) => index);
void main() => runApp(const AppBarApp());
diff --git a/examples/api/lib/material/app_bar/app_bar.2.dart b/examples/api/lib/material/app_bar/app_bar.2.dart
index 23632b4..1e0823c 100644
--- a/examples/api/lib/material/app_bar/app_bar.2.dart
+++ b/examples/api/lib/material/app_bar/app_bar.2.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AppBar].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [AppBar].
+
void main() => runApp(const AppBarApp());
class AppBarApp extends StatelessWidget {
diff --git a/examples/api/lib/material/app_bar/app_bar.3.dart b/examples/api/lib/material/app_bar/app_bar.3.dart
index e8624f1..4f7e8f5 100644
--- a/examples/api/lib/material/app_bar/app_bar.3.dart
+++ b/examples/api/lib/material/app_bar/app_bar.3.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AppBar].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [AppBar].
+
List<String> titles = <String>[
'Cloud',
'Beach',
@@ -80,7 +80,7 @@
ListView.builder(
itemCount: 25,
itemBuilder: (BuildContext context, int index) {
- return ListTile(
+ return ListTile(
tileColor: index.isOdd ? oddItemColor : evenItemColor,
title: Text('${titles[0]} $index'),
);
@@ -89,7 +89,7 @@
ListView.builder(
itemCount: 25,
itemBuilder: (BuildContext context, int index) {
- return ListTile(
+ return ListTile(
tileColor: index.isOdd ? oddItemColor : evenItemColor,
title: Text('${titles[1]} $index'),
);
@@ -98,7 +98,7 @@
ListView.builder(
itemCount: 25,
itemBuilder: (BuildContext context, int index) {
- return ListTile(
+ return ListTile(
tileColor: index.isOdd ? oddItemColor : evenItemColor,
title: Text('${titles[2]} $index'),
);
diff --git a/examples/api/lib/material/app_bar/sliver_app_bar.1.dart b/examples/api/lib/material/app_bar/sliver_app_bar.1.dart
index 1c8266e..9d7ad11 100644
--- a/examples/api/lib/material/app_bar/sliver_app_bar.1.dart
+++ b/examples/api/lib/material/app_bar/sliver_app_bar.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SliverAppBar].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [SliverAppBar].
+
void main() => runApp(const AppBarApp());
class AppBarApp extends StatelessWidget {
diff --git a/examples/api/lib/material/app_bar/sliver_app_bar.2.dart b/examples/api/lib/material/app_bar/sliver_app_bar.2.dart
index a5108d6..2185659 100644
--- a/examples/api/lib/material/app_bar/sliver_app_bar.2.dart
+++ b/examples/api/lib/material/app_bar/sliver_app_bar.2.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SliverAppBar.medium].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [SliverAppBar.medium].
+
void main() {
runApp(const AppBarMediumApp());
}
@@ -18,7 +18,7 @@
return MaterialApp(
theme: ThemeData(
useMaterial3: true,
- colorSchemeSeed: const Color(0xff6750A4)
+ colorSchemeSeed: const Color(0xff6750A4),
),
home: Material(
child: CustomScrollView(
diff --git a/examples/api/lib/material/app_bar/sliver_app_bar.3.dart b/examples/api/lib/material/app_bar/sliver_app_bar.3.dart
index fec0a73..30e2602 100644
--- a/examples/api/lib/material/app_bar/sliver_app_bar.3.dart
+++ b/examples/api/lib/material/app_bar/sliver_app_bar.3.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SliverAppBar.large].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [SliverAppBar.large].
+
void main() {
runApp(const AppBarLargeApp());
}
@@ -18,7 +18,7 @@
return MaterialApp(
theme: ThemeData(
useMaterial3: true,
- colorSchemeSeed: const Color(0xff6750A4)
+ colorSchemeSeed: const Color(0xff6750A4),
),
home: Material(
child: CustomScrollView(
diff --git a/examples/api/lib/material/autocomplete/autocomplete.0.dart b/examples/api/lib/material/autocomplete/autocomplete.0.dart
index 3c17423..21478ca 100644
--- a/examples/api/lib/material/autocomplete/autocomplete.0.dart
+++ b/examples/api/lib/material/autocomplete/autocomplete.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Autocomplete].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Autocomplete].
+
void main() => runApp(const AutocompleteExampleApp());
class AutocompleteExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/material/autocomplete/autocomplete.1.dart b/examples/api/lib/material/autocomplete/autocomplete.1.dart
index 09700bf..7e3798e 100644
--- a/examples/api/lib/material/autocomplete/autocomplete.1.dart
+++ b/examples/api/lib/material/autocomplete/autocomplete.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Autocomplete].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Autocomplete].
+
void main() => runApp(const AutocompleteExampleApp());
class AutocompleteExampleApp extends StatelessWidget {
@@ -73,9 +73,7 @@
return const Iterable<User>.empty();
}
return _userOptions.where((User option) {
- return option
- .toString()
- .contains(textEditingValue.text.toLowerCase());
+ return option.toString().contains(textEditingValue.text.toLowerCase());
});
},
onSelected: (User selection) {
diff --git a/examples/api/lib/material/banner/material_banner.0.dart b/examples/api/lib/material/banner/material_banner.0.dart
index 5569c04..fc3791f 100644
--- a/examples/api/lib/material/banner/material_banner.0.dart
+++ b/examples/api/lib/material/banner/material_banner.0.dart
@@ -2,28 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [MaterialBanner].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [MaterialBanner].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const MaterialBannerExampleApp());
- static const String _title = 'Flutter Code Sample';
+class MaterialBannerExampleApp extends StatelessWidget {
+ const MaterialBannerExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: MaterialBannerExample(),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class MaterialBannerExample extends StatelessWidget {
+ const MaterialBannerExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/banner/material_banner.1.dart b/examples/api/lib/material/banner/material_banner.1.dart
index 1811a30..ddba00b 100644
--- a/examples/api/lib/material/banner/material_banner.1.dart
+++ b/examples/api/lib/material/banner/material_banner.1.dart
@@ -2,28 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [MaterialBanner].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [MaterialBanner].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const MaterialBannerExampleApp());
- static const String _title = 'Flutter Code Sample';
+class MaterialBannerExampleApp extends StatelessWidget {
+ const MaterialBannerExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: MaterialBannerExample(),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class MaterialBannerExample extends StatelessWidget {
+ const MaterialBannerExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/bottom_app_bar/bottom_app_bar.1.dart b/examples/api/lib/material/bottom_app_bar/bottom_app_bar.1.dart
index 2e629db..a35c580 100644
--- a/examples/api/lib/material/bottom_app_bar/bottom_app_bar.1.dart
+++ b/examples/api/lib/material/bottom_app_bar/bottom_app_bar.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [BottomAppBar].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [BottomAppBar].
+
void main() {
runApp(const BottomAppBarDemo());
}
@@ -20,8 +20,7 @@
class _BottomAppBarDemoState extends State<BottomAppBarDemo> {
bool _showFab = true;
bool _showNotch = true;
- FloatingActionButtonLocation _fabLocation =
- FloatingActionButtonLocation.endDocked;
+ FloatingActionButtonLocation _fabLocation = FloatingActionButtonLocation.endDocked;
void _onShowNotchChanged(bool value) {
setState(() {
@@ -120,8 +119,7 @@
final FloatingActionButtonLocation fabLocation;
final NotchedShape? shape;
- static final List<FloatingActionButtonLocation> centerLocations =
- <FloatingActionButtonLocation>[
+ static final List<FloatingActionButtonLocation> centerLocations = <FloatingActionButtonLocation>[
FloatingActionButtonLocation.centerDocked,
FloatingActionButtonLocation.centerFloat,
];
diff --git a/examples/api/lib/material/bottom_app_bar/bottom_app_bar.2.dart b/examples/api/lib/material/bottom_app_bar/bottom_app_bar.2.dart
index 2e48077..1aa6b98 100644
--- a/examples/api/lib/material/bottom_app_bar/bottom_app_bar.2.dart
+++ b/examples/api/lib/material/bottom_app_bar/bottom_app_bar.2.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for BottomAppBar with Material 3
-
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
+/// Flutter code sample for [BottomAppBar] with Material 3.
+
void main() {
runApp(const BottomAppBarDemo());
}
@@ -37,9 +37,8 @@
bool _isElevated = true;
bool _isVisible = true;
- FloatingActionButtonLocation get _fabLocation => _isVisible
- ? FloatingActionButtonLocation.endContained
- : FloatingActionButtonLocation.endFloat;
+ FloatingActionButtonLocation get _fabLocation =>
+ _isVisible ? FloatingActionButtonLocation.endContained : FloatingActionButtonLocation.endFloat;
void _listen() {
final ScrollDirection direction = _controller.position.userScrollDirection;
diff --git a/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.0.dart b/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.0.dart
index 58e6d5e..4bdf47c 100644
--- a/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.0.dart
+++ b/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.0.dart
@@ -2,37 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [BottomNavigationBar].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [BottomNavigationBar].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const BottomNavigationBarExampleApp());
- static const String _title = 'Flutter Code Sample';
+class BottomNavigationBarExampleApp extends StatelessWidget {
+ const BottomNavigationBarExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: BottomNavigationBarExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class BottomNavigationBarExample extends StatefulWidget {
+ const BottomNavigationBarExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<BottomNavigationBarExample> createState() => _BottomNavigationBarExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _BottomNavigationBarExampleState extends State<BottomNavigationBarExample> {
int _selectedIndex = 0;
- static const TextStyle optionStyle =
- TextStyle(fontSize: 30, fontWeight: FontWeight.bold);
+ static const TextStyle optionStyle = TextStyle(fontSize: 30, fontWeight: FontWeight.bold);
static const List<Widget> _widgetOptions = <Widget>[
Text(
'Index 0: Home',
diff --git a/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.1.dart b/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.1.dart
index 1eb7b0d..f60330d 100644
--- a/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.1.dart
+++ b/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.1.dart
@@ -2,37 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [BottomNavigationBar].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [BottomNavigationBar].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const BottomNavigationBarExampleApp());
- static const String _title = 'Flutter Code Sample';
+class BottomNavigationBarExampleApp extends StatelessWidget {
+ const BottomNavigationBarExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: BottomNavigationBarExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class BottomNavigationBarExample extends StatefulWidget {
+ const BottomNavigationBarExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<BottomNavigationBarExample> createState() => _BottomNavigationBarExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _BottomNavigationBarExampleState extends State<BottomNavigationBarExample> {
int _selectedIndex = 0;
- static const TextStyle optionStyle =
- TextStyle(fontSize: 30, fontWeight: FontWeight.bold);
+ static const TextStyle optionStyle = TextStyle(fontSize: 30, fontWeight: FontWeight.bold);
static const List<Widget> _widgetOptions = <Widget>[
Text(
'Index 0: Home',
diff --git a/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.2.dart b/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.2.dart
index 9fc5fa2..560406e 100644
--- a/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.2.dart
+++ b/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.2.dart
@@ -2,34 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [BottomNavigationBar].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [BottomNavigationBar].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const BottomNavigationBarExampleApp());
- static const String _title = 'Flutter Code Sample';
+class BottomNavigationBarExampleApp extends StatelessWidget {
+ const BottomNavigationBarExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: BottomNavigationBarExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class BottomNavigationBarExample extends StatefulWidget {
+ const BottomNavigationBarExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<BottomNavigationBarExample> createState() => _BottomNavigationBarExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _BottomNavigationBarExampleState extends State<BottomNavigationBarExample> {
int _selectedIndex = 0;
final ScrollController _homeController = ScrollController();
diff --git a/examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.0.dart b/examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.0.dart
index 9508152..fef506c 100644
--- a/examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.0.dart
+++ b/examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [showModalBottomSheet].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [showModalBottomSheet].
+
void main() => runApp(const BottomSheetApp());
class BottomSheetApp extends StatelessWidget {
diff --git a/examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.1.dart b/examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.1.dart
index eb40ff7..096adc8 100644
--- a/examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.1.dart
+++ b/examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [showModalBottomSheet].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [showModalBottomSheet].
+
void main() => runApp(const BottomSheetApp());
class BottomSheetApp extends StatelessWidget {
diff --git a/examples/api/lib/material/button_style/button_style.0.dart b/examples/api/lib/material/button_style/button_style.0.dart
index 0cec279..03a4943 100644
--- a/examples/api/lib/material/button_style/button_style.0.dart
+++ b/examples/api/lib/material/button_style/button_style.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ElevatedButton].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ElevatedButton].
+
void main() {
runApp(const ButtonApp());
}
@@ -45,7 +45,7 @@
}
class ButtonTypesGroup extends StatelessWidget {
- const ButtonTypesGroup({ super.key, required this.enabled });
+ const ButtonTypesGroup({super.key, required this.enabled});
final bool enabled;
diff --git a/examples/api/lib/material/card/card.0.dart b/examples/api/lib/material/card/card.0.dart
index fcfaf6e..1b90628 100644
--- a/examples/api/lib/material/card/card.0.dart
+++ b/examples/api/lib/material/card/card.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Card].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Card].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const CardExampleApp());
- static const String _title = 'Flutter Code Sample';
+class CardExampleApp extends StatelessWidget {
+ const CardExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('Card Sample')),
+ body: const CardExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class CardExample extends StatelessWidget {
+ const CardExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/card/card.1.dart b/examples/api/lib/material/card/card.1.dart
index 931ada3..3be967d8 100644
--- a/examples/api/lib/material/card/card.1.dart
+++ b/examples/api/lib/material/card/card.1.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Card].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Card].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const CardExampleApp());
- static const String _title = 'Flutter Code Sample';
+class CardExampleApp extends StatelessWidget {
+ const CardExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('Card Sample')),
+ body: const CardExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class CardExample extends StatelessWidget {
+ const CardExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/card/card.2.dart b/examples/api/lib/material/card/card.2.dart
index 215398c..5334df9 100644
--- a/examples/api/lib/material/card/card.2.dart
+++ b/examples/api/lib/material/card/card.2.dart
@@ -2,11 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Card].
-
import 'package:flutter/material.dart';
-void main() { runApp(const CardExamplesApp()); }
+/// Flutter code sample for [Card].
+
+void main() {
+ runApp(const CardExamplesApp());
+}
class CardExamplesApp extends StatelessWidget {
const CardExamplesApp({super.key});
@@ -38,7 +40,7 @@
///
/// https://m3.material.io/components/cards/specs#a012d40d-7a5c-4b07-8740-491dec79d58b
class ElevatedCardExample extends StatelessWidget {
- const ElevatedCardExample({ super.key });
+ const ElevatedCardExample({super.key});
@override
Widget build(BuildContext context) {
@@ -61,7 +63,7 @@
///
/// https://m3.material.io/components/cards/specs#0f55bf62-edf2-4619-b00d-b9ed462f2c5a
class FilledCardExample extends StatelessWidget {
- const FilledCardExample({ super.key });
+ const FilledCardExample({super.key});
@override
Widget build(BuildContext context) {
@@ -86,7 +88,7 @@
///
/// https://m3.material.io/components/cards/specs#0f55bf62-edf2-4619-b00d-b9ed462f2c5a
class OutlinedCardExample extends StatelessWidget {
- const OutlinedCardExample({ super.key });
+ const OutlinedCardExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/checkbox/checkbox.0.dart b/examples/api/lib/material/checkbox/checkbox.0.dart
index 8597947..074e5ad 100644
--- a/examples/api/lib/material/checkbox/checkbox.0.dart
+++ b/examples/api/lib/material/checkbox/checkbox.0.dart
@@ -2,39 +2,36 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Checkbox].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Checkbox].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const CheckboxExampleApp());
- static const String _title = 'Flutter Code Sample';
+class CheckboxExampleApp extends StatelessWidget {
+ const CheckboxExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('Checkbox Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: CheckboxExample(),
),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class CheckboxExample extends StatefulWidget {
+ const CheckboxExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<CheckboxExample> createState() => _CheckboxExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _CheckboxExampleState extends State<CheckboxExample> {
bool isChecked = false;
@override
diff --git a/examples/api/lib/material/checkbox/checkbox.1.dart b/examples/api/lib/material/checkbox/checkbox.1.dart
index 77c83ad..9593bac 100644
--- a/examples/api/lib/material/checkbox/checkbox.1.dart
+++ b/examples/api/lib/material/checkbox/checkbox.1.dart
@@ -2,40 +2,38 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for M3 Checkbox with error state
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for M3 [Checkbox] with error state.
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const CheckboxExampleApp());
- static const String _title = 'Flutter Code Sample';
+class CheckboxExampleApp extends StatelessWidget {
+ const CheckboxExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(useMaterial3: true, colorSchemeSeed: const Color(0xff6750a4)),
- title: _title,
+ title: 'Checkbox Sample',
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('Checkbox Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: CheckboxExample(),
),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class CheckboxExample extends StatefulWidget {
+ const CheckboxExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<CheckboxExample> createState() => _CheckboxExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _CheckboxExampleState extends State<CheckboxExample> {
bool? isChecked = true;
@override
diff --git a/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.0.dart b/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.0.dart
index 47c3241..bf67c15 100644
--- a/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.0.dart
+++ b/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.0.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CheckboxListTile].
-
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart' show timeDilation;
+/// Flutter code sample for [CheckboxListTile].
+
void main() => runApp(const CheckboxListTileApp());
class CheckboxListTileApp extends StatelessWidget {
diff --git a/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.1.dart b/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.1.dart
index a97d57a..8d3808f 100644
--- a/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.1.dart
+++ b/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CheckboxListTile].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [CheckboxListTile].
+
void main() => runApp(const CheckboxListTileApp());
class CheckboxListTileApp extends StatelessWidget {
@@ -57,7 +57,8 @@
});
},
title: const Text('Headline'),
- subtitle: const Text('Longer supporting text to demonstrate how the text wraps and the checkbox is centered vertically with the text.'),
+ subtitle: const Text(
+ 'Longer supporting text to demonstrate how the text wraps and the checkbox is centered vertically with the text.'),
),
const Divider(height: 0),
CheckboxListTile(
@@ -68,7 +69,8 @@
});
},
title: const Text('Headline'),
- subtitle: const Text("Longer supporting text to demonstrate how the text wraps and how setting 'CheckboxListTile.isThreeLine = true' aligns the checkbox to the top vertically with the text."),
+ subtitle: const Text(
+ "Longer supporting text to demonstrate how the text wraps and how setting 'CheckboxListTile.isThreeLine = true' aligns the checkbox to the top vertically with the text."),
isThreeLine: true,
),
const Divider(height: 0),
diff --git a/examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.0.dart b/examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.0.dart
index 891d918..50705bc 100644
--- a/examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.0.dart
+++ b/examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.0.dart
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for custom labeled checkbox.
-
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
+/// Flutter code sample for custom labeled checkbox.
+
void main() => runApp(const LabeledCheckboxApp());
class LabeledCheckboxApp extends StatelessWidget {
diff --git a/examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.1.dart b/examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.1.dart
index 181e485..f1866cf 100644
--- a/examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.1.dart
+++ b/examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for custom labeled checkbox.
-
import 'package:flutter/material.dart';
+/// Flutter code sample for custom labeled checkbox.
+
void main() => runApp(const LabeledCheckboxApp());
class LabeledCheckboxApp extends StatelessWidget {
diff --git a/examples/api/lib/material/chip/deletable_chip_attributes.on_deleted.0.dart b/examples/api/lib/material/chip/deletable_chip_attributes.on_deleted.0.dart
index 01b24a0..6c91b2d 100644
--- a/examples/api/lib/material/chip/deletable_chip_attributes.on_deleted.0.dart
+++ b/examples/api/lib/material/chip/deletable_chip_attributes.on_deleted.0.dart
@@ -2,25 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [DeletableChipAttributes.onDeleted].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [DeletableChipAttributes.onDeleted].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const OnDeletedExampleApp());
- static const String _title = 'Flutter Code Sample';
+class OnDeletedExampleApp extends StatelessWidget {
+ const OnDeletedExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('DeletableChipAttributes.onDeleted Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: OnDeletedExample(),
),
),
);
@@ -75,14 +72,14 @@
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class OnDeletedExample extends StatefulWidget {
+ const OnDeletedExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<OnDeletedExample> createState() => _OnDeletedExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _OnDeletedExampleState extends State<OnDeletedExample> {
@override
Widget build(BuildContext context) {
return const CastList();
diff --git a/examples/api/lib/material/choice_chip/choice_chip.0.dart b/examples/api/lib/material/choice_chip/choice_chip.0.dart
index a7b4442..097c198 100644
--- a/examples/api/lib/material/choice_chip/choice_chip.0.dart
+++ b/examples/api/lib/material/choice_chip/choice_chip.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ActionChoice].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ActionChoice].
+
void main() => runApp(const ChipApp());
class ChipApp extends StatelessWidget {
diff --git a/examples/api/lib/material/color_scheme/dynamic_content_color.0.dart b/examples/api/lib/material/color_scheme/dynamic_content_color.0.dart
index 62ff25c..94a0ce0 100644
--- a/examples/api/lib/material/color_scheme/dynamic_content_color.0.dart
+++ b/examples/api/lib/material/color_scheme/dynamic_content_color.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ColorScheme.fromImageProvider] with content-based dynamic color.
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ColorScheme.fromImageProvider] with content-based dynamic color.
+
const Widget divider = SizedBox(height: 10);
const double narrowScreenWidthThreshold = 400;
const double imageSize = 150;
@@ -16,12 +16,18 @@
DynamicColorExample({super.key});
final List<ImageProvider> images = <NetworkImage>[
- const NetworkImage('https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_1.png'),
- const NetworkImage('https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_2.png'),
- const NetworkImage('https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_3.png'),
- const NetworkImage('https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_4.png'),
- const NetworkImage('https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_5.png'),
- const NetworkImage('https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_6.png'),
+ const NetworkImage(
+ 'https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_1.png'),
+ const NetworkImage(
+ 'https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_2.png'),
+ const NetworkImage(
+ 'https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_3.png'),
+ const NetworkImage(
+ 'https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_4.png'),
+ const NetworkImage(
+ 'https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_5.png'),
+ const NetworkImage(
+ 'https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_6.png'),
];
@override
@@ -69,9 +75,7 @@
padding: const EdgeInsets.symmetric(vertical: 15),
child: Text(
brightness,
- style: TextStyle(
- fontWeight: FontWeight.bold,
- color: colorScheme.onSecondaryContainer),
+ style: TextStyle(fontWeight: FontWeight.bold, color: colorScheme.onSecondaryContainer),
),
);
}
@@ -84,7 +88,6 @@
}
return MaterialApp(
- title: 'Content Based Dynamic Color',
theme: ThemeData(useMaterial3: true, colorScheme: colorScheme),
debugShowCheckedModeBanner: false,
home: Builder(
@@ -125,21 +128,17 @@
Expanded(
child: ColoredBox(
color: colorScheme.background,
- child: LayoutBuilder(builder: (BuildContext context,
- BoxConstraints constraints) {
- if (constraints.maxWidth <
- narrowScreenWidthThreshold) {
+ child: LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) {
+ if (constraints.maxWidth < narrowScreenWidthThreshold) {
return SingleChildScrollView(
child: Column(
children: <Widget>[
divider,
- schemeLabel(
- 'Light ColorScheme', colorScheme),
+ schemeLabel('Light ColorScheme', colorScheme),
schemeView(lightTheme),
divider,
divider,
- schemeLabel(
- 'Dark ColorScheme', colorScheme),
+ schemeLabel('Dark ColorScheme', colorScheme),
schemeView(darkTheme),
],
),
@@ -155,9 +154,7 @@
Expanded(
child: Column(
children: <Widget>[
- schemeLabel(
- 'Light ColorScheme',
- colorScheme),
+ schemeLabel('Light ColorScheme', colorScheme),
schemeView(lightTheme),
],
),
@@ -165,9 +162,7 @@
Expanded(
child: Column(
children: <Widget>[
- schemeLabel(
- 'Dark ColorScheme',
- colorScheme),
+ schemeLabel('Dark ColorScheme', colorScheme),
schemeView(darkTheme),
],
),
@@ -193,8 +188,7 @@
Future<void> _updateImage(ImageProvider provider) async {
final ColorScheme newColorScheme = await ColorScheme.fromImageProvider(
- provider: provider,
- brightness: isLight ? Brightness.light : Brightness.dark);
+ provider: provider, brightness: isLight ? Brightness.light : Brightness.dark);
setState(() {
selectedImage = widget.images.indexOf(provider);
currentColorScheme = newColorScheme;
@@ -203,30 +197,25 @@
// For small screens, have two rows of image selection. For wide screens,
// fit them onto one row.
- Widget _imagesRow(BuildContext context, List<ImageProvider> images,
- ColorScheme colorScheme) {
+ Widget _imagesRow(BuildContext context, List<ImageProvider> images, ColorScheme colorScheme) {
final double windowHeight = MediaQuery.of(context).size.height;
final double windowWidth = MediaQuery.of(context).size.width;
return Padding(
padding: const EdgeInsets.all(8.0),
- child: LayoutBuilder(
- builder: (BuildContext context, BoxConstraints constraints) {
+ child: LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) {
if (constraints.maxWidth > 800) {
return _adaptiveLayoutImagesRow(images, colorScheme, windowHeight);
} else {
return Column(children: <Widget>[
- _adaptiveLayoutImagesRow(
- images.sublist(0, 3), colorScheme, windowWidth),
- _adaptiveLayoutImagesRow(
- images.sublist(3), colorScheme, windowWidth),
+ _adaptiveLayoutImagesRow(images.sublist(0, 3), colorScheme, windowWidth),
+ _adaptiveLayoutImagesRow(images.sublist(3), colorScheme, windowWidth),
]);
}
}),
);
}
- Widget _adaptiveLayoutImagesRow(
- List<ImageProvider> images, ColorScheme colorScheme, double windowWidth) {
+ Widget _adaptiveLayoutImagesRow(List<ImageProvider> images, ColorScheme colorScheme, double windowWidth) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: images
@@ -268,18 +257,10 @@
return Column(
children: <Widget>[
ColorGroup(children: <ColorChip>[
+ ColorChip(label: 'primary', color: colorScheme.primary, onColor: colorScheme.onPrimary),
+ ColorChip(label: 'onPrimary', color: colorScheme.onPrimary, onColor: colorScheme.primary),
ColorChip(
- label: 'primary',
- color: colorScheme.primary,
- onColor: colorScheme.onPrimary),
- ColorChip(
- label: 'onPrimary',
- color: colorScheme.onPrimary,
- onColor: colorScheme.primary),
- ColorChip(
- label: 'primaryContainer',
- color: colorScheme.primaryContainer,
- onColor: colorScheme.onPrimaryContainer),
+ label: 'primaryContainer', color: colorScheme.primaryContainer, onColor: colorScheme.onPrimaryContainer),
ColorChip(
label: 'onPrimaryContainer',
color: colorScheme.onPrimaryContainer,
@@ -287,14 +268,8 @@
]),
divider,
ColorGroup(children: <ColorChip>[
- ColorChip(
- label: 'secondary',
- color: colorScheme.secondary,
- onColor: colorScheme.onSecondary),
- ColorChip(
- label: 'onSecondary',
- color: colorScheme.onSecondary,
- onColor: colorScheme.secondary),
+ ColorChip(label: 'secondary', color: colorScheme.secondary, onColor: colorScheme.onSecondary),
+ ColorChip(label: 'onSecondary', color: colorScheme.onSecondary, onColor: colorScheme.secondary),
ColorChip(
label: 'secondaryContainer',
color: colorScheme.secondaryContainer,
@@ -307,14 +282,8 @@
divider,
ColorGroup(
children: <ColorChip>[
- ColorChip(
- label: 'tertiary',
- color: colorScheme.tertiary,
- onColor: colorScheme.onTertiary),
- ColorChip(
- label: 'onTertiary',
- color: colorScheme.onTertiary,
- onColor: colorScheme.tertiary),
+ ColorChip(label: 'tertiary', color: colorScheme.tertiary, onColor: colorScheme.onTertiary),
+ ColorChip(label: 'onTertiary', color: colorScheme.onTertiary, onColor: colorScheme.tertiary),
ColorChip(
label: 'tertiaryContainer',
color: colorScheme.tertiaryContainer,
@@ -328,56 +297,30 @@
divider,
ColorGroup(
children: <ColorChip>[
+ ColorChip(label: 'error', color: colorScheme.error, onColor: colorScheme.onError),
+ ColorChip(label: 'onError', color: colorScheme.onError, onColor: colorScheme.error),
ColorChip(
- label: 'error',
- color: colorScheme.error,
- onColor: colorScheme.onError),
+ label: 'errorContainer', color: colorScheme.errorContainer, onColor: colorScheme.onErrorContainer),
ColorChip(
- label: 'onError',
- color: colorScheme.onError,
- onColor: colorScheme.error),
- ColorChip(
- label: 'errorContainer',
- color: colorScheme.errorContainer,
- onColor: colorScheme.onErrorContainer),
- ColorChip(
- label: 'onErrorContainer',
- color: colorScheme.onErrorContainer,
- onColor: colorScheme.errorContainer),
+ label: 'onErrorContainer', color: colorScheme.onErrorContainer, onColor: colorScheme.errorContainer),
],
),
divider,
ColorGroup(
children: <ColorChip>[
- ColorChip(
- label: 'background',
- color: colorScheme.background,
- onColor: colorScheme.onBackground),
- ColorChip(
- label: 'onBackground',
- color: colorScheme.onBackground,
- onColor: colorScheme.background),
+ ColorChip(label: 'background', color: colorScheme.background, onColor: colorScheme.onBackground),
+ ColorChip(label: 'onBackground', color: colorScheme.onBackground, onColor: colorScheme.background),
],
),
divider,
ColorGroup(
children: <ColorChip>[
+ ColorChip(label: 'surface', color: colorScheme.surface, onColor: colorScheme.onSurface),
+ ColorChip(label: 'onSurface', color: colorScheme.onSurface, onColor: colorScheme.surface),
ColorChip(
- label: 'surface',
- color: colorScheme.surface,
- onColor: colorScheme.onSurface),
+ label: 'surfaceVariant', color: colorScheme.surfaceVariant, onColor: colorScheme.onSurfaceVariant),
ColorChip(
- label: 'onSurface',
- color: colorScheme.onSurface,
- onColor: colorScheme.surface),
- ColorChip(
- label: 'surfaceVariant',
- color: colorScheme.surfaceVariant,
- onColor: colorScheme.onSurfaceVariant),
- ColorChip(
- label: 'onSurfaceVariant',
- color: colorScheme.onSurfaceVariant,
- onColor: colorScheme.surfaceVariant),
+ label: 'onSurfaceVariant', color: colorScheme.onSurfaceVariant, onColor: colorScheme.surfaceVariant),
],
),
divider,
@@ -386,17 +329,10 @@
ColorChip(label: 'outline', color: colorScheme.outline),
ColorChip(label: 'shadow', color: colorScheme.shadow),
ColorChip(
- label: 'inverseSurface',
- color: colorScheme.inverseSurface,
- onColor: colorScheme.onInverseSurface),
+ label: 'inverseSurface', color: colorScheme.inverseSurface, onColor: colorScheme.onInverseSurface),
ColorChip(
- label: 'onInverseSurface',
- color: colorScheme.onInverseSurface,
- onColor: colorScheme.inverseSurface),
- ColorChip(
- label: 'inversePrimary',
- color: colorScheme.inversePrimary,
- onColor: colorScheme.primary),
+ label: 'onInverseSurface', color: colorScheme.onInverseSurface, onColor: colorScheme.inverseSurface),
+ ColorChip(label: 'inversePrimary', color: colorScheme.inversePrimary, onColor: colorScheme.primary),
],
),
],
@@ -412,8 +348,7 @@
@override
Widget build(BuildContext context) {
return RepaintBoundary(
- child:
- Card(clipBehavior: Clip.antiAlias, child: Column(children: children)),
+ child: Card(clipBehavior: Clip.antiAlias, child: Column(children: children)),
);
}
}
diff --git a/examples/api/lib/material/context_menu/context_menu_controller.0.dart b/examples/api/lib/material/context_menu/context_menu_controller.0.dart
index 9e128ea..99e77ec 100644
--- a/examples/api/lib/material/context_menu/context_menu_controller.0.dart
+++ b/examples/api/lib/material/context_menu/context_menu_controller.0.dart
@@ -9,25 +9,24 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-void main() => runApp(const MyApp());
+void main() => runApp(const ContextMenuControllerExampleApp());
/// A builder that includes an Offset to draw the context menu at.
typedef ContextMenuBuilder = Widget Function(BuildContext context, Offset offset);
-class MyApp extends StatefulWidget {
- const MyApp({super.key});
+class ContextMenuControllerExampleApp extends StatefulWidget {
+ const ContextMenuControllerExampleApp({super.key});
@override
- State<MyApp> createState() => _MyAppState();
+ State<ContextMenuControllerExampleApp> createState() => _ContextMenuControllerExampleAppState();
}
-class _MyAppState extends State<MyApp> {
- void _showDialog (BuildContext context) {
+class _ContextMenuControllerExampleAppState extends State<ContextMenuControllerExampleApp> {
+ void _showDialog(BuildContext context) {
Navigator.of(context).push(
DialogRoute<void>(
context: context,
- builder: (BuildContext context) =>
- const AlertDialog(title: Text('You clicked print!')),
+ builder: (BuildContext context) => const AlertDialog(title: Text('You clicked print!')),
),
);
}
@@ -82,7 +81,8 @@
child: ListView(
children: <Widget>[
Container(height: 20.0),
- const Text('Right click (desktop) or long press (mobile) anywhere, not just on this text, to show the custom menu.'),
+ const Text(
+ 'Right click (desktop) or long press (mobile) anywhere, not just on this text, to show the custom menu.'),
],
),
),
diff --git a/examples/api/lib/material/context_menu/editable_text_toolbar_builder.0.dart b/examples/api/lib/material/context_menu/editable_text_toolbar_builder.0.dart
index 7a4f079..138c14d 100644
--- a/examples/api/lib/material/context_menu/editable_text_toolbar_builder.0.dart
+++ b/examples/api/lib/material/context_menu/editable_text_toolbar_builder.0.dart
@@ -10,16 +10,16 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-void main() => runApp(const MyApp());
+void main() => runApp(const EditableTextToolbarBuilderExampleApp());
-class MyApp extends StatefulWidget {
- const MyApp({super.key});
+class EditableTextToolbarBuilderExampleApp extends StatefulWidget {
+ const EditableTextToolbarBuilderExampleApp({super.key});
@override
- State<MyApp> createState() => _MyAppState();
+ State<EditableTextToolbarBuilderExampleApp> createState() => _EditableTextToolbarBuilderExampleAppState();
}
-class _MyAppState extends State<MyApp> {
+class _EditableTextToolbarBuilderExampleAppState extends State<EditableTextToolbarBuilderExampleApp> {
final TextEditingController _controller = TextEditingController(
text: 'Right click (desktop) or long press (mobile) to see the menu with custom buttons.',
);
diff --git a/examples/api/lib/material/context_menu/editable_text_toolbar_builder.1.dart b/examples/api/lib/material/context_menu/editable_text_toolbar_builder.1.dart
index 588fca6..c7c16f0 100644
--- a/examples/api/lib/material/context_menu/editable_text_toolbar_builder.1.dart
+++ b/examples/api/lib/material/context_menu/editable_text_toolbar_builder.1.dart
@@ -9,30 +9,28 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-void main() => runApp(const MyApp());
+void main() => runApp(const EditableTextToolbarBuilderExampleApp());
const String emailAddress = 'me@example.com';
const String text = 'Select the email address and open the menu: $emailAddress';
-class MyApp extends StatefulWidget {
- const MyApp({super.key});
+class EditableTextToolbarBuilderExampleApp extends StatefulWidget {
+ const EditableTextToolbarBuilderExampleApp({super.key});
@override
- State<MyApp> createState() => _MyAppState();
+ State<EditableTextToolbarBuilderExampleApp> createState() => _EditableTextToolbarBuilderExampleAppState();
}
-class _MyAppState extends State<MyApp> {
-
+class _EditableTextToolbarBuilderExampleAppState extends State<EditableTextToolbarBuilderExampleApp> {
final TextEditingController _controller = TextEditingController(
text: text,
);
- void _showDialog (BuildContext context) {
+ void _showDialog(BuildContext context) {
Navigator.of(context).push(
DialogRoute<void>(
context: context,
- builder: (BuildContext context) =>
- const AlertDialog(title: Text('You clicked send email!')),
+ builder: (BuildContext context) => const AlertDialog(title: Text('You clicked send email!')),
),
);
}
@@ -69,20 +67,22 @@
TextField(
controller: _controller,
contextMenuBuilder: (BuildContext context, EditableTextState editableTextState) {
- final List<ContextMenuButtonItem> buttonItems =
- editableTextState.contextMenuButtonItems;
+ final List<ContextMenuButtonItem> buttonItems = editableTextState.contextMenuButtonItems;
// Here we add an "Email" button to the default TextField
// context menu for the current platform, but only if an email
// address is currently selected.
final TextEditingValue value = _controller.value;
if (_isValidEmail(value.selection.textInside(value.text))) {
- buttonItems.insert(0, ContextMenuButtonItem(
- label: 'Send email',
- onPressed: () {
- ContextMenuController.removeAny();
- _showDialog(context);
- },
- ));
+ buttonItems.insert(
+ 0,
+ ContextMenuButtonItem(
+ label: 'Send email',
+ onPressed: () {
+ ContextMenuController.removeAny();
+ _showDialog(context);
+ },
+ ),
+ );
}
return AdaptiveTextSelectionToolbar.buttonItems(
anchors: editableTextState.contextMenuAnchors,
diff --git a/examples/api/lib/material/context_menu/editable_text_toolbar_builder.2.dart b/examples/api/lib/material/context_menu/editable_text_toolbar_builder.2.dart
index dcc9f1b..25fa236 100644
--- a/examples/api/lib/material/context_menu/editable_text_toolbar_builder.2.dart
+++ b/examples/api/lib/material/context_menu/editable_text_toolbar_builder.2.dart
@@ -9,16 +9,16 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-void main() => runApp(const MyApp());
+void main() => runApp(const EditableTextToolbarBuilderExampleApp());
-class MyApp extends StatefulWidget {
- const MyApp({super.key});
+class EditableTextToolbarBuilderExampleApp extends StatefulWidget {
+ const EditableTextToolbarBuilderExampleApp({super.key});
@override
- State<MyApp> createState() => _MyAppState();
+ State<EditableTextToolbarBuilderExampleApp> createState() => _EditableTextToolbarBuilderExampleAppState();
}
-class _MyAppState extends State<MyApp> {
+class _EditableTextToolbarBuilderExampleAppState extends State<EditableTextToolbarBuilderExampleApp> {
final TextEditingController _controller = TextEditingController(
text: 'Right click (desktop) or long press (mobile) to see the menu with a custom toolbar.',
);
diff --git a/examples/api/lib/material/context_menu/selectable_region_toolbar_builder.0.dart b/examples/api/lib/material/context_menu/selectable_region_toolbar_builder.0.dart
index 91137ce..a63b625 100644
--- a/examples/api/lib/material/context_menu/selectable_region_toolbar_builder.0.dart
+++ b/examples/api/lib/material/context_menu/selectable_region_toolbar_builder.0.dart
@@ -9,24 +9,24 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-void main() => runApp(const MyApp());
+void main() => runApp(const SelectableRegionToolbarBuilderExampleApp());
-const String text = 'I am some text inside of SelectionArea. Right click (desktop) or long press (mobile) me to show the customized context menu.';
+const String text =
+ 'I am some text inside of SelectionArea. Right click (desktop) or long press (mobile) me to show the customized context menu.';
-class MyApp extends StatefulWidget {
- const MyApp({super.key});
+class SelectableRegionToolbarBuilderExampleApp extends StatefulWidget {
+ const SelectableRegionToolbarBuilderExampleApp({super.key});
@override
- State<MyApp> createState() => _MyAppState();
+ State<SelectableRegionToolbarBuilderExampleApp> createState() => _SelectableRegionToolbarBuilderExampleAppState();
}
-class _MyAppState extends State<MyApp> {
- void _showDialog (BuildContext context) {
+class _SelectableRegionToolbarBuilderExampleAppState extends State<SelectableRegionToolbarBuilderExampleApp> {
+ void _showDialog(BuildContext context) {
Navigator.of(context).push(
DialogRoute<void>(
context: context,
- builder: (BuildContext context) =>
- const AlertDialog(title: Text('You clicked print!')),
+ builder: (BuildContext context) => const AlertDialog(title: Text('You clicked print!')),
),
);
}
diff --git a/examples/api/lib/material/data_table/data_table.0.dart b/examples/api/lib/material/data_table/data_table.0.dart
index f9707cd..2d1ff24 100644
--- a/examples/api/lib/material/data_table/data_table.0.dart
+++ b/examples/api/lib/material/data_table/data_table.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [DataTable].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [DataTable].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const DataTableExampleApp());
- static const String _title = 'Flutter Code Sample';
+class DataTableExampleApp extends StatelessWidget {
+ const DataTableExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('DataTable Sample')),
+ body: const DataTableExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class DataTableExample extends StatelessWidget {
+ const DataTableExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/data_table/data_table.1.dart b/examples/api/lib/material/data_table/data_table.1.dart
index 219db6e..cdb47e7 100644
--- a/examples/api/lib/material/data_table/data_table.1.dart
+++ b/examples/api/lib/material/data_table/data_table.1.dart
@@ -2,37 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [DataTable].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [DataTable].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const DataTableExampleApp());
- static const String _title = 'Flutter Code Sample';
+class DataTableExampleApp extends StatelessWidget {
+ const DataTableExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatefulWidget(),
+ appBar: AppBar(title: const Text('DataTable Sample')),
+ body: const DataTableExample(),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class DataTableExample extends StatefulWidget {
+ const DataTableExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<DataTableExample> createState() => _DataTableExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _DataTableExampleState extends State<DataTableExample> {
static const int numItems = 10;
List<bool> selected = List<bool>.generate(numItems, (int index) => false);
@@ -49,8 +46,7 @@
rows: List<DataRow>.generate(
numItems,
(int index) => DataRow(
- color: MaterialStateProperty.resolveWith<Color?>(
- (Set<MaterialState> states) {
+ color: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
// All rows will have the same selected color.
if (states.contains(MaterialState.selected)) {
return Theme.of(context).colorScheme.primary.withOpacity(0.08);
diff --git a/examples/api/lib/material/date_picker/show_date_picker.0.dart b/examples/api/lib/material/date_picker/show_date_picker.0.dart
index 79b658c..cd6b8d5 100644
--- a/examples/api/lib/material/date_picker/show_date_picker.0.dart
+++ b/examples/api/lib/material/date_picker/show_date_picker.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [showDatePicker].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [showDatePicker].
+
void main() => runApp(const DatePickerApp());
class DatePickerApp extends StatelessWidget {
@@ -31,17 +31,14 @@
}
/// RestorationProperty objects can be used because of RestorationMixin.
-class _DatePickerExampleState extends State<DatePickerExample>
- with RestorationMixin {
+class _DatePickerExampleState extends State<DatePickerExample> with RestorationMixin {
// In this example, the restoration ID for the mixin is passed in through
// the [StatefulWidget]'s constructor.
@override
String? get restorationId => widget.restorationId;
- final RestorableDateTime _selectedDate =
- RestorableDateTime(DateTime(2021, 7, 25));
- late final RestorableRouteFuture<DateTime?> _restorableDatePickerRouteFuture =
- RestorableRouteFuture<DateTime?>(
+ final RestorableDateTime _selectedDate = RestorableDateTime(DateTime(2021, 7, 25));
+ late final RestorableRouteFuture<DateTime?> _restorableDatePickerRouteFuture = RestorableRouteFuture<DateTime?>(
onComplete: _selectDate,
onPresent: (NavigatorState navigator, Object? arguments) {
return navigator.restorablePush(
@@ -73,8 +70,7 @@
@override
void restoreState(RestorationBucket? oldBucket, bool initialRestore) {
registerForRestoration(_selectedDate, 'selected_date');
- registerForRestoration(
- _restorableDatePickerRouteFuture, 'date_picker_route_future');
+ registerForRestoration(_restorableDatePickerRouteFuture, 'date_picker_route_future');
}
void _selectDate(DateTime? newSelectedDate) {
@@ -82,8 +78,8 @@
setState(() {
_selectedDate.value = newSelectedDate;
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
- content: Text(
- 'Selected: ${_selectedDate.value.day}/${_selectedDate.value.month}/${_selectedDate.value.year}'),
+ content:
+ Text('Selected: ${_selectedDate.value.day}/${_selectedDate.value.month}/${_selectedDate.value.year}'),
));
});
}
diff --git a/examples/api/lib/material/date_picker/show_date_range_picker.0.dart b/examples/api/lib/material/date_picker/show_date_range_picker.0.dart
index 873ce9a..9efd6d0 100644
--- a/examples/api/lib/material/date_picker/show_date_range_picker.0.dart
+++ b/examples/api/lib/material/date_picker/show_date_range_picker.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [showDateRangePicker].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [showDateRangePicker].
+
void main() => runApp(const DatePickerApp());
class DatePickerApp extends StatelessWidget {
@@ -21,7 +21,6 @@
}
}
-
class DatePickerExample extends StatefulWidget {
const DatePickerExample({super.key, this.restorationId});
@@ -32,24 +31,19 @@
}
/// RestorationProperty objects can be used because of RestorationMixin.
-class _DatePickerExampleState extends State<DatePickerExample>
- with RestorationMixin {
+class _DatePickerExampleState extends State<DatePickerExample> with RestorationMixin {
// In this example, the restoration ID for the mixin is passed in through
// the [StatefulWidget]'s constructor.
@override
String? get restorationId => widget.restorationId;
- final RestorableDateTimeN _startDate =
- RestorableDateTimeN(DateTime(2021));
- final RestorableDateTimeN _endDate =
- RestorableDateTimeN(DateTime(2021, 1, 5));
- late final RestorableRouteFuture<DateTimeRange?>
- _restorableDateRangePickerRouteFuture =
+ final RestorableDateTimeN _startDate = RestorableDateTimeN(DateTime(2021));
+ final RestorableDateTimeN _endDate = RestorableDateTimeN(DateTime(2021, 1, 5));
+ late final RestorableRouteFuture<DateTimeRange?> _restorableDateRangePickerRouteFuture =
RestorableRouteFuture<DateTimeRange?>(
onComplete: _selectDateRange,
onPresent: (NavigatorState navigator, Object? arguments) {
- return navigator
- .restorablePush(_dateRangePickerRoute, arguments: <String, dynamic>{
+ return navigator.restorablePush(_dateRangePickerRoute, arguments: <String, dynamic>{
'initialStartDate': _startDate.value?.millisecondsSinceEpoch,
'initialEndDate': _endDate.value?.millisecondsSinceEpoch,
});
@@ -69,8 +63,7 @@
void restoreState(RestorationBucket? oldBucket, bool initialRestore) {
registerForRestoration(_startDate, 'start_date');
registerForRestoration(_endDate, 'end_date');
- registerForRestoration(
- _restorableDateRangePickerRouteFuture, 'date_picker_route_future');
+ registerForRestoration(_restorableDateRangePickerRouteFuture, 'date_picker_route_future');
}
@pragma('vm:entry-point')
@@ -83,8 +76,7 @@
builder: (BuildContext context) {
return DateRangePickerDialog(
restorationId: 'date_picker_dialog',
- initialDateRange:
- _initialDateTimeRange(arguments! as Map<dynamic, dynamic>),
+ initialDateRange: _initialDateTimeRange(arguments! as Map<dynamic, dynamic>),
firstDate: DateTime(2021),
currentDate: DateTime(2021, 1, 25),
lastDate: DateTime(2022),
@@ -94,13 +86,10 @@
}
static DateTimeRange? _initialDateTimeRange(Map<dynamic, dynamic> arguments) {
- if (arguments['initialStartDate'] != null &&
- arguments['initialEndDate'] != null) {
+ if (arguments['initialStartDate'] != null && arguments['initialEndDate'] != null) {
return DateTimeRange(
- start: DateTime.fromMillisecondsSinceEpoch(
- arguments['initialStartDate'] as int),
- end: DateTime.fromMillisecondsSinceEpoch(
- arguments['initialEndDate'] as int),
+ start: DateTime.fromMillisecondsSinceEpoch(arguments['initialStartDate'] as int),
+ end: DateTime.fromMillisecondsSinceEpoch(arguments['initialEndDate'] as int),
);
}
diff --git a/examples/api/lib/material/dialog/alert_dialog.0.dart b/examples/api/lib/material/dialog/alert_dialog.0.dart
index 98745b5..82b0708 100644
--- a/examples/api/lib/material/dialog/alert_dialog.0.dart
+++ b/examples/api/lib/material/dialog/alert_dialog.0.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AlertDialog].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [AlertDialog].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const AlertDialogExampleApp());
+
+class AlertDialogExampleApp extends StatelessWidget {
+ const AlertDialogExampleApp({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/dialog/alert_dialog.1.dart b/examples/api/lib/material/dialog/alert_dialog.1.dart
index aef1273..0785b5e 100644
--- a/examples/api/lib/material/dialog/alert_dialog.1.dart
+++ b/examples/api/lib/material/dialog/alert_dialog.1.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AlertDialog].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [AlertDialog].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const AlertDialogExampleApp());
+
+class AlertDialogExampleApp extends StatelessWidget {
+ const AlertDialogExampleApp({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/dialog/dialog.0.dart b/examples/api/lib/material/dialog/dialog.0.dart
index aa20856..4dbda85 100644
--- a/examples/api/lib/material/dialog/dialog.0.dart
+++ b/examples/api/lib/material/dialog/dialog.0.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Dialog].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Dialog].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const DialogExampleApp());
+
+class DialogExampleApp extends StatelessWidget {
+ const DialogExampleApp({super.key});
@override
Widget build(BuildContext context) {
@@ -42,7 +42,7 @@
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
- const Text('This is a typical dialog.'),
+ const Text('This is a typical dialog.'),
const SizedBox(height: 15),
TextButton(
onPressed: () {
@@ -66,7 +66,7 @@
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
- const Text('This is a fullscreen dialog.'),
+ const Text('This is a fullscreen dialog.'),
const SizedBox(height: 15),
TextButton(
onPressed: () {
diff --git a/examples/api/lib/material/dialog/show_dialog.0.dart b/examples/api/lib/material/dialog/show_dialog.0.dart
index 2ef272e..614e40b 100644
--- a/examples/api/lib/material/dialog/show_dialog.0.dart
+++ b/examples/api/lib/material/dialog/show_dialog.0.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [showDialog].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [showDialog].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ShowDialogExampleApp());
+
+class ShowDialogExampleApp extends StatelessWidget {
+ const ShowDialogExampleApp({super.key});
@override
Widget build(BuildContext context) {
@@ -42,10 +42,11 @@
return AlertDialog(
title: const Text('Basic dialog title'),
content: const Text(
- 'A dialog is a type of modal window that\n'
- 'appears in front of app content to\n'
- 'provide critical information, or prompt\n'
- 'for a decision to be made.'),
+ 'A dialog is a type of modal window that\n'
+ 'appears in front of app content to\n'
+ 'provide critical information, or prompt\n'
+ 'for a decision to be made.',
+ ),
actions: <Widget>[
TextButton(
style: TextButton.styleFrom(
diff --git a/examples/api/lib/material/dialog/show_dialog.1.dart b/examples/api/lib/material/dialog/show_dialog.1.dart
index 50d1748..73b6807 100644
--- a/examples/api/lib/material/dialog/show_dialog.1.dart
+++ b/examples/api/lib/material/dialog/show_dialog.1.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [showDialog].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [showDialog].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ShowDialogExampleApp());
+
+class ShowDialogExampleApp extends StatelessWidget {
+ const ShowDialogExampleApp({super.key});
@override
Widget build(BuildContext context) {
@@ -43,10 +43,11 @@
return AlertDialog(
title: const Text('Basic dialog title'),
content: const Text(
- 'A dialog is a type of modal window that\n'
- 'appears in front of app content to\n'
- 'provide critical information, or prompt\n'
- 'for a decision to be made.'),
+ 'A dialog is a type of modal window that\n'
+ 'appears in front of app content to\n'
+ 'provide critical information, or prompt\n'
+ 'for a decision to be made.',
+ ),
actions: <Widget>[
TextButton(
style: TextButton.styleFrom(
diff --git a/examples/api/lib/material/dialog/show_dialog.2.dart b/examples/api/lib/material/dialog/show_dialog.2.dart
index 3cb8755..f76a84e 100644
--- a/examples/api/lib/material/dialog/show_dialog.2.dart
+++ b/examples/api/lib/material/dialog/show_dialog.2.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [showDialog].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [showDialog].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ShowDialogExampleApp());
+
+class ShowDialogExampleApp extends StatelessWidget {
+ const ShowDialogExampleApp({super.key});
@override
Widget build(BuildContext context) {
@@ -39,18 +39,18 @@
}
@pragma('vm:entry-point')
- static Route<Object?> _dialogBuilder(
- BuildContext context, Object? arguments) {
+ static Route<Object?> _dialogBuilder(BuildContext context, Object? arguments) {
return DialogRoute<void>(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Basic dialog title'),
content: const Text(
- 'A dialog is a type of modal window that\n'
- 'appears in front of app content to\n'
- 'provide critical information, or prompt\n'
- 'for a decision to be made.'),
+ 'A dialog is a type of modal window that\n'
+ 'appears in front of app content to\n'
+ 'provide critical information, or prompt\n'
+ 'for a decision to be made.',
+ ),
actions: <Widget>[
TextButton(
style: TextButton.styleFrom(
diff --git a/examples/api/lib/material/divider/divider.0.dart b/examples/api/lib/material/divider/divider.0.dart
index 7c87236..15cb5af 100644
--- a/examples/api/lib/material/divider/divider.0.dart
+++ b/examples/api/lib/material/divider/divider.0.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Divider].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Divider].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const DividerExampleApp());
+
+class DividerExampleApp extends StatelessWidget {
+ const DividerExampleApp({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/divider/divider.1.dart b/examples/api/lib/material/divider/divider.1.dart
index bf4da00..ae91b18 100644
--- a/examples/api/lib/material/divider/divider.1.dart
+++ b/examples/api/lib/material/divider/divider.1.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Divider].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Divider].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const DividerExampleApp());
+
+class DividerExampleApp extends StatelessWidget {
+ const DividerExampleApp({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/divider/vertical_divider.0.dart b/examples/api/lib/material/divider/vertical_divider.0.dart
index 512283f..cf1c988 100644
--- a/examples/api/lib/material/divider/vertical_divider.0.dart
+++ b/examples/api/lib/material/divider/vertical_divider.0.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [VerticalDivider].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [VerticalDivider].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const VerticalDividerExampleApp());
+
+class VerticalDividerExampleApp extends StatelessWidget {
+ const VerticalDividerExampleApp({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/divider/vertical_divider.1.dart b/examples/api/lib/material/divider/vertical_divider.1.dart
index 563649c..a272b7e 100644
--- a/examples/api/lib/material/divider/vertical_divider.1.dart
+++ b/examples/api/lib/material/divider/vertical_divider.1.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Divider].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Divider].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const VerticalDividerExampleApp());
+
+class VerticalDividerExampleApp extends StatelessWidget {
+ const VerticalDividerExampleApp({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/dropdown/dropdown_button.0.dart b/examples/api/lib/material/dropdown/dropdown_button.0.dart
index fb8647f..15d1ccb 100644
--- a/examples/api/lib/material/dropdown/dropdown_button.0.dart
+++ b/examples/api/lib/material/dropdown/dropdown_button.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [DropdownButton].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [DropdownButton].
+
const List<String> list = <String>['One', 'Two', 'Three', 'Four'];
void main() => runApp(const DropdownButtonApp());
diff --git a/examples/api/lib/material/dropdown/dropdown_button.selected_item_builder.0.dart b/examples/api/lib/material/dropdown/dropdown_button.selected_item_builder.0.dart
index ee453fe..1c4f832 100644
--- a/examples/api/lib/material/dropdown/dropdown_button.selected_item_builder.0.dart
+++ b/examples/api/lib/material/dropdown/dropdown_button.selected_item_builder.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [DropdownButton.selectedItemBuilder].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [DropdownButton.selectedItemBuilder].
+
Map<String, String> cities = <String, String>{
'New York': 'NYC',
'Los Angeles': 'LA',
@@ -61,7 +61,7 @@
// Here custom text style, alignment and layout size can be applied
// to selected item string.
return Container(
- alignment:Alignment.centerLeft,
+ alignment: Alignment.centerLeft,
constraints: const BoxConstraints(minWidth: 100),
child: Text(
item,
diff --git a/examples/api/lib/material/dropdown/dropdown_button.style.0.dart b/examples/api/lib/material/dropdown/dropdown_button.style.0.dart
index f17f272..825e9fc 100644
--- a/examples/api/lib/material/dropdown/dropdown_button.style.0.dart
+++ b/examples/api/lib/material/dropdown/dropdown_button.style.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [DropdownButton.style].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [DropdownButton.style].
+
void main() => runApp(const DropdownButtonApp());
class DropdownButtonApp extends StatelessWidget {
diff --git a/examples/api/lib/material/dropdown_menu/dropdown_menu.0.dart b/examples/api/lib/material/dropdown_menu/dropdown_menu.0.dart
index d1aa12b..8a8e51b 100644
--- a/examples/api/lib/material/dropdown_menu/dropdown_menu.0.dart
+++ b/examples/api/lib/material/dropdown_menu/dropdown_menu.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [DropdownMenu]s. The first dropdown menu has an outlined border
// which is the default configuration, and the second one has a filled input decoration.
import 'package:flutter/material.dart';
+/// Flutter code sample for [DropdownMenu]s. The first dropdown menu has an outlined border.
+
void main() => runApp(const DropdownMenuExample());
class DropdownMenuExample extends StatefulWidget {
@@ -27,7 +28,8 @@
final List<DropdownMenuEntry<ColorLabel>> colorEntries = <DropdownMenuEntry<ColorLabel>>[];
for (final ColorLabel color in ColorLabel.values) {
colorEntries.add(
- DropdownMenuEntry<ColorLabel>(value: color, label: color.label, enabled: color.label != 'Grey'));
+ DropdownMenuEntry<ColorLabel>(value: color, label: color.label, enabled: color.label != 'Grey'),
+ );
}
final List<DropdownMenuEntry<IconLabel>> iconEntries = <DropdownMenuEntry<IconLabel>>[];
@@ -38,7 +40,7 @@
return MaterialApp(
theme: ThemeData(
useMaterial3: true,
- colorSchemeSeed: Colors.green
+ colorSchemeSeed: Colors.green,
),
home: Scaffold(
body: SafeArea(
@@ -69,7 +71,8 @@
dropdownMenuEntries: iconEntries,
inputDecorationTheme: const InputDecorationTheme(
filled: true,
- contentPadding: EdgeInsets.symmetric(vertical: 5.0)),
+ contentPadding: EdgeInsets.symmetric(vertical: 5.0),
+ ),
onSelected: (IconLabel? icon) {
setState(() {
selectedIcon = icon;
@@ -86,12 +89,17 @@
Text('You selected a ${selectedColor?.label} ${selectedIcon?.label}'),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 5),
- child: Icon(selectedIcon?.icon, color: selectedColor?.color,))
+ child: Icon(
+ selectedIcon?.icon,
+ color: selectedColor?.color,
+ ),
+ )
],
)
- else const Text('Please select a color and an icon.')
+ else
+ const Text('Please select a color and an icon.')
],
- )
+ ),
),
),
);
@@ -112,7 +120,10 @@
enum IconLabel {
smile('Smile', Icons.sentiment_satisfied_outlined),
- cloud('Cloud', Icons.cloud_outlined,),
+ cloud(
+ 'Cloud',
+ Icons.cloud_outlined,
+ ),
brush('Brush', Icons.brush_outlined),
heart('Heart', Icons.favorite);
diff --git a/examples/api/lib/material/elevated_button/elevated_button.0.dart b/examples/api/lib/material/elevated_button/elevated_button.0.dart
index e9dd017..ece62f4 100644
--- a/examples/api/lib/material/elevated_button/elevated_button.0.dart
+++ b/examples/api/lib/material/elevated_button/elevated_button.0.dart
@@ -2,41 +2,37 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ElevatedButton].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [ElevatedButton].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ElevatedButtonExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ElevatedButtonExampleApp extends StatelessWidget {
+ const ElevatedButtonExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatefulWidget(),
+ appBar: AppBar(title: const Text('ElevatedButton Sample')),
+ body: const ElevatedButtonExample(),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class ElevatedButtonExample extends StatefulWidget {
+ const ElevatedButtonExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<ElevatedButtonExample> createState() => _ElevatedButtonExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _ElevatedButtonExampleState extends State<ElevatedButtonExample> {
@override
Widget build(BuildContext context) {
- final ButtonStyle style =
- ElevatedButton.styleFrom(textStyle: const TextStyle(fontSize: 20));
+ final ButtonStyle style = ElevatedButton.styleFrom(textStyle: const TextStyle(fontSize: 20));
return Center(
child: Column(
diff --git a/examples/api/lib/material/expansion_panel/expansion_panel_list.0.dart b/examples/api/lib/material/expansion_panel/expansion_panel_list.0.dart
index cefe748..740250e 100644
--- a/examples/api/lib/material/expansion_panel/expansion_panel_list.0.dart
+++ b/examples/api/lib/material/expansion_panel/expansion_panel_list.0.dart
@@ -2,24 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ExpansionPanelList].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [ExpansionPanelList].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ExpansionPanelListExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ExpansionPanelListExampleApp extends StatelessWidget {
+ const ExpansionPanelListExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatefulWidget(),
+ appBar: AppBar(title: const Text('ExpansionPanelList Sample')),
+ body: const ExpansionPanelListExample(),
),
);
}
@@ -47,14 +44,14 @@
});
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class ExpansionPanelListExample extends StatefulWidget {
+ const ExpansionPanelListExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<ExpansionPanelListExample> createState() => _ExpansionPanelListExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _ExpansionPanelListExampleState extends State<ExpansionPanelListExample> {
final List<Item> _data = generateItems(8);
@override
@@ -82,8 +79,7 @@
},
body: ListTile(
title: Text(item.expandedValue),
- subtitle:
- const Text('To delete this panel, tap the trash can icon'),
+ subtitle: const Text('To delete this panel, tap the trash can icon'),
trailing: const Icon(Icons.delete),
onTap: () {
setState(() {
diff --git a/examples/api/lib/material/expansion_panel/expansion_panel_list.expansion_panel_list_radio.0.dart b/examples/api/lib/material/expansion_panel/expansion_panel_list.expansion_panel_list_radio.0.dart
index b8c25e0..db7ec03 100644
--- a/examples/api/lib/material/expansion_panel/expansion_panel_list.expansion_panel_list_radio.0.dart
+++ b/examples/api/lib/material/expansion_panel/expansion_panel_list.expansion_panel_list_radio.0.dart
@@ -2,24 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ExpansionPanelList.ExpansionPanelList.radio].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [ExpansionPanelList.ExpansionPanelList.radio].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ExpansionPanelListRadioExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ExpansionPanelListRadioExampleApp extends StatelessWidget {
+ const ExpansionPanelListRadioExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatefulWidget(),
+ appBar: AppBar(title: const Text('ExpansionPanelList.radio Sample')),
+ body: const ExpansionPanelListRadioExample(),
),
);
}
@@ -48,14 +45,14 @@
});
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class ExpansionPanelListRadioExample extends StatefulWidget {
+ const ExpansionPanelListRadioExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<ExpansionPanelListRadioExample> createState() => _ExpansionPanelListRadioExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _ExpansionPanelListRadioExampleState extends State<ExpansionPanelListRadioExample> {
final List<Item> _data = generateItems(8);
@override
@@ -80,13 +77,11 @@
},
body: ListTile(
title: Text(item.expandedValue),
- subtitle:
- const Text('To delete this panel, tap the trash can icon'),
+ subtitle: const Text('To delete this panel, tap the trash can icon'),
trailing: const Icon(Icons.delete),
onTap: () {
setState(() {
- _data
- .removeWhere((Item currentItem) => item == currentItem);
+ _data.removeWhere((Item currentItem) => item == currentItem);
});
}));
}).toList(),
diff --git a/examples/api/lib/material/expansion_tile/expansion_tile.0.dart b/examples/api/lib/material/expansion_tile/expansion_tile.0.dart
index 6a26514..384c889 100644
--- a/examples/api/lib/material/expansion_tile/expansion_tile.0.dart
+++ b/examples/api/lib/material/expansion_tile/expansion_tile.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ExpansionTile].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ExpansionTile].
+
void main() => runApp(const ExpansionTileApp());
class ExpansionTileApp extends StatelessWidget {
@@ -48,9 +48,7 @@
title: const Text('ExpansionTile 2'),
subtitle: const Text('Custom expansion arrow icon'),
trailing: Icon(
- _customTileExpanded
- ? Icons.arrow_drop_down_circle
- : Icons.arrow_drop_down,
+ _customTileExpanded ? Icons.arrow_drop_down_circle : Icons.arrow_drop_down,
),
children: const <Widget>[
ListTile(title: Text('This is tile number 2')),
diff --git a/examples/api/lib/material/expansion_tile/expansion_tile.1.dart b/examples/api/lib/material/expansion_tile/expansion_tile.1.dart
index 66de0ee..76799ec 100644
--- a/examples/api/lib/material/expansion_tile/expansion_tile.1.dart
+++ b/examples/api/lib/material/expansion_tile/expansion_tile.1.dart
@@ -2,16 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ExpansionTile] and [ExpansionTileController]
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ExpansionTile] and [ExpansionTileController].
+
void main() {
runApp(const ExpansionTileControllerApp());
}
class ExpansionTileControllerApp extends StatefulWidget {
- const ExpansionTileControllerApp({ super.key });
+ const ExpansionTileControllerApp({super.key});
@override
State<ExpansionTileControllerApp> createState() => _ExpansionTileControllerAppState();
@@ -23,10 +23,9 @@
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: 'Flutter Code Sample for ExpansionTileController.',
theme: ThemeData(useMaterial3: true),
home: Scaffold(
- appBar: AppBar(title: const Text('ExpansionTileController Example')),
+ appBar: AppBar(title: const Text('ExpansionTileController Sample')),
body: Column(
children: <Widget>[
// A controller has been provided to the ExpansionTile because it's
diff --git a/examples/api/lib/material/filled_button/filled_button.0.dart b/examples/api/lib/material/filled_button/filled_button.0.dart
index 36e8e83..7b0ca19 100644
--- a/examples/api/lib/material/filled_button/filled_button.0.dart
+++ b/examples/api/lib/material/filled_button/filled_button.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FilledButton].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [FilledButton].
+
void main() {
runApp(const FilledButtonApp());
}
diff --git a/examples/api/lib/material/filter_chip/filter_chip.0.dart b/examples/api/lib/material/filter_chip/filter_chip.0.dart
index d3da52f..acf72b1 100644
--- a/examples/api/lib/material/filter_chip/filter_chip.0.dart
+++ b/examples/api/lib/material/filter_chip/filter_chip.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FilterChip].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [FilterChip].
+
enum ExerciseFilter { walking, running, cycling, hiking }
void main() => runApp(const ChipApp());
@@ -67,8 +67,7 @@
),
const SizedBox(height: 10.0),
Text(
- 'Looking for: ${filters.map(
- (ExerciseFilter e) => e.name).join(', ')}',
+ 'Looking for: ${filters.map((ExerciseFilter e) => e.name).join(', ')}',
style: textTheme.labelLarge,
),
],
diff --git a/examples/api/lib/material/flexible_space_bar/flexible_space_bar.0.dart b/examples/api/lib/material/flexible_space_bar/flexible_space_bar.0.dart
index 48cf73b..b1649af 100644
--- a/examples/api/lib/material/flexible_space_bar/flexible_space_bar.0.dart
+++ b/examples/api/lib/material/flexible_space_bar/flexible_space_bar.0.dart
@@ -2,21 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FlexibleSpaceBar].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MaterialApp(home: MyApp()));
+/// Flutter code sample for [FlexibleSpaceBar].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const MaterialApp(home: FlexibleSpaceBarExampleApp()));
+
+class FlexibleSpaceBarExampleApp extends StatelessWidget {
+ const FlexibleSpaceBarExampleApp({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: CustomScrollView(
- physics: const BouncingScrollPhysics(
- parent: AlwaysScrollableScrollPhysics()),
+ physics: const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),
slivers: <Widget>[
SliverAppBar(
stretch: true,
diff --git a/examples/api/lib/material/floating_action_button/floating_action_button.0.dart b/examples/api/lib/material/floating_action_button/floating_action_button.0.dart
index 63a9aa6..26b2a5b 100644
--- a/examples/api/lib/material/floating_action_button/floating_action_button.0.dart
+++ b/examples/api/lib/material/floating_action_button/floating_action_button.0.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FloatingActionButton].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [FloatingActionButton].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const FloatingActionButtonExampleApp());
+
+class FloatingActionButtonExampleApp extends StatelessWidget {
+ const FloatingActionButtonExampleApp({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/floating_action_button/floating_action_button.1.dart b/examples/api/lib/material/floating_action_button/floating_action_button.1.dart
index 79eaa06..7180a52 100644
--- a/examples/api/lib/material/floating_action_button/floating_action_button.1.dart
+++ b/examples/api/lib/material/floating_action_button/floating_action_button.1.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FloatingActionButton].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [FloatingActionButton].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const FloatingActionButtonExampleApp());
+
+class FloatingActionButtonExampleApp extends StatelessWidget {
+ const FloatingActionButtonExampleApp({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/floating_action_button/floating_action_button.2.dart b/examples/api/lib/material/floating_action_button/floating_action_button.2.dart
index 30e6f75..4eedfc1 100644
--- a/examples/api/lib/material/floating_action_button/floating_action_button.2.dart
+++ b/examples/api/lib/material/floating_action_button/floating_action_button.2.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FloatingActionButton].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [FloatingActionButton].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const FloatingActionButtonExampleApp());
+
+class FloatingActionButtonExampleApp extends StatelessWidget {
+ const FloatingActionButtonExampleApp({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/floating_action_button/floating_action_button.3.dart b/examples/api/lib/material/floating_action_button/floating_action_button.3.dart
index 5d88caf..9650247 100644
--- a/examples/api/lib/material/floating_action_button/floating_action_button.3.dart
+++ b/examples/api/lib/material/floating_action_button/floating_action_button.3.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FloatingActionButton].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [FloatingActionButton].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const FloatingActionButtonExampleApp());
+
+class FloatingActionButtonExampleApp extends StatelessWidget {
+ const FloatingActionButtonExampleApp({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/floating_action_button_location/standard_fab_location.0.dart b/examples/api/lib/material/floating_action_button_location/standard_fab_location.0.dart
index 2cb8105..ce77bf7 100644
--- a/examples/api/lib/material/floating_action_button_location/standard_fab_location.0.dart
+++ b/examples/api/lib/material/floating_action_button_location/standard_fab_location.0.dart
@@ -2,40 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [StandardFabLocation].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [StandardFabLocation].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const StandardFabLocationExampleApp());
- static const String _title = 'Flutter Code Sample';
+class StandardFabLocationExampleApp extends StatelessWidget {
+ const StandardFabLocationExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: StandardFabLocationExample(),
);
}
}
-class AlmostEndFloatFabLocation extends StandardFabLocation
- with FabEndOffsetX, FabFloatOffsetY {
+class AlmostEndFloatFabLocation extends StandardFabLocation with FabEndOffsetX, FabFloatOffsetY {
@override
- double getOffsetX(
- ScaffoldPrelayoutGeometry scaffoldGeometry, double adjustment) {
- final double directionalAdjustment =
- scaffoldGeometry.textDirection == TextDirection.ltr ? -50.0 : 50.0;
- return super.getOffsetX(scaffoldGeometry, adjustment) +
- directionalAdjustment;
+ double getOffsetX(ScaffoldPrelayoutGeometry scaffoldGeometry, double adjustment) {
+ final double directionalAdjustment = scaffoldGeometry.textDirection == TextDirection.ltr ? -50.0 : 50.0;
+ return super.getOffsetX(scaffoldGeometry, adjustment) + directionalAdjustment;
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class StandardFabLocationExample extends StatelessWidget {
+ const StandardFabLocationExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/icon_button/icon_button.0.dart b/examples/api/lib/material/icon_button/icon_button.0.dart
index 5a03a44..309d4ce 100644
--- a/examples/api/lib/material/icon_button/icon_button.0.dart
+++ b/examples/api/lib/material/icon_button/icon_button.0.dart
@@ -2,25 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [IconButton].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [IconButton].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const IconButtonExampleApp());
- static const String _title = 'Flutter Code Sample';
+class IconButtonExampleApp extends StatelessWidget {
+ const IconButtonExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('IconButton Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: IconButtonExample(),
),
),
);
@@ -29,14 +26,14 @@
double _volume = 0.0;
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class IconButtonExample extends StatefulWidget {
+ const IconButtonExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<IconButtonExample> createState() => _IconButtonExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _IconButtonExampleState extends State<IconButtonExample> {
@override
Widget build(BuildContext context) {
return Column(
diff --git a/examples/api/lib/material/icon_button/icon_button.1.dart b/examples/api/lib/material/icon_button/icon_button.1.dart
index 6b8ec04..2bc28d1 100644
--- a/examples/api/lib/material/icon_button/icon_button.1.dart
+++ b/examples/api/lib/material/icon_button/icon_button.1.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [IconButton].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [IconButton].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const IconButtonExampleApp());
- static const String _title = 'Flutter Code Sample';
+class IconButtonExampleApp extends StatelessWidget {
+ const IconButtonExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('IconButton Sample')),
+ body: const IconButtonExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class IconButtonExample extends StatelessWidget {
+ const IconButtonExample({super.key});
@override
@override
diff --git a/examples/api/lib/material/icon_button/icon_button.2.dart b/examples/api/lib/material/icon_button/icon_button.2.dart
index 91c66f5..e057781 100644
--- a/examples/api/lib/material/icon_button/icon_button.2.dart
+++ b/examples/api/lib/material/icon_button/icon_button.2.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [IconButton].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [IconButton].
+
void main() {
runApp(const IconButtonApp());
}
@@ -45,7 +45,7 @@
}
class ButtonTypesGroup extends StatelessWidget {
- const ButtonTypesGroup({ super.key, required this.enabled });
+ const ButtonTypesGroup({super.key, required this.enabled});
final bool enabled;
diff --git a/examples/api/lib/material/icon_button/icon_button.3.dart b/examples/api/lib/material/icon_button/icon_button.3.dart
index 6eb6884..00ff53f 100644
--- a/examples/api/lib/material/icon_button/icon_button.3.dart
+++ b/examples/api/lib/material/icon_button/icon_button.3.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [IconButton] with toggle feature.
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [IconButton] with toggle feature.
+
void main() {
runApp(const IconButtonToggleApp());
}
@@ -134,7 +134,7 @@
),
],
),
- ]
+ ],
);
}
}
diff --git a/examples/api/lib/material/ink/ink.image_clip.0.dart b/examples/api/lib/material/ink/ink.image_clip.0.dart
index 5a39b61..c4a58d9 100644
--- a/examples/api/lib/material/ink/ink.image_clip.0.dart
+++ b/examples/api/lib/material/ink/ink.image_clip.0.dart
@@ -2,26 +2,27 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Image.frameBuilder].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Image.frameBuilder].
+
void main() {
- runApp(MaterialApp(
- title: 'Flutter Code Sample',
- home: Scaffold(
- appBar: AppBar(title: const Text('Flutter Code Sample')),
- body: const Center(
- child: MyStatelessWidget(
- image: NetworkImage('https://flutter.github.io/assets-for-api-docs/assets/widgets/puffin.jpg'),
+ runApp(
+ MaterialApp(
+ home: Scaffold(
+ appBar: AppBar(title: const Text('Image.frameBuilder Sample')),
+ body: const Center(
+ child: ImageClipExample(
+ image: NetworkImage('https://flutter.github.io/assets-for-api-docs/assets/widgets/puffin.jpg'),
+ ),
),
),
),
- ));
+ );
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key, required this.image});
+class ImageClipExample extends StatelessWidget {
+ const ImageClipExample({super.key, required this.image});
final ImageProvider image;
diff --git a/examples/api/lib/material/ink/ink.image_clip.1.dart b/examples/api/lib/material/ink/ink.image_clip.1.dart
index 334d631..aa981eb 100644
--- a/examples/api/lib/material/ink/ink.image_clip.1.dart
+++ b/examples/api/lib/material/ink/ink.image_clip.1.dart
@@ -2,17 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Image.frameBuilder].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Image.frameBuilder].
+
void main() {
runApp(MaterialApp(
- title: 'Flutter Code Sample',
home: Scaffold(
- appBar: AppBar(title: const Text('Flutter Code Sample')),
+ appBar: AppBar(title: const Text('Image.frameBuilder Sample')),
body: const Center(
- child: MyStatelessWidget(
+ child: ImageClipExample(
image: NetworkImage('https://flutter.github.io/assets-for-api-docs/assets/widgets/puffin.jpg'),
),
),
@@ -20,8 +19,8 @@
));
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key, required this.image});
+class ImageClipExample extends StatelessWidget {
+ const ImageClipExample({super.key, required this.image});
final ImageProvider image;
diff --git a/examples/api/lib/material/ink_well/ink_well.0.dart b/examples/api/lib/material/ink_well/ink_well.0.dart
index 36712b2..723bfd1 100644
--- a/examples/api/lib/material/ink_well/ink_well.0.dart
+++ b/examples/api/lib/material/ink_well/ink_well.0.dart
@@ -2,39 +2,36 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InkWell].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InkWell].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const InkWellExampleApp());
- static const String _title = 'Flutter Code Sample';
+class InkWellExampleApp extends StatelessWidget {
+ const InkWellExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('InkWell Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: InkWellExample(),
),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class InkWellExample extends StatefulWidget {
+ const InkWellExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<InkWellExample> createState() => _InkWellExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _InkWellExampleState extends State<InkWellExample> {
double sideLength = 50;
@override
diff --git a/examples/api/lib/material/input_decorator/input_decoration.0.dart b/examples/api/lib/material/input_decorator/input_decoration.0.dart
index e6c4b67..5145459 100644
--- a/examples/api/lib/material/input_decorator/input_decoration.0.dart
+++ b/examples/api/lib/material/input_decorator/input_decoration.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InputDecoration].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InputDecoration].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const InputDecorationExampleApp());
- static const String _title = 'Flutter Code Sample';
+class InputDecorationExampleApp extends StatelessWidget {
+ const InputDecorationExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('InputDecoration Sample')),
+ body: const InputDecorationExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class InputDecorationExample extends StatelessWidget {
+ const InputDecorationExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/input_decorator/input_decoration.1.dart b/examples/api/lib/material/input_decorator/input_decoration.1.dart
index cb0412a..15e8fea 100644
--- a/examples/api/lib/material/input_decorator/input_decoration.1.dart
+++ b/examples/api/lib/material/input_decorator/input_decoration.1.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InputDecoration].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InputDecoration].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const InputDecorationExampleApp());
- static const String _title = 'Flutter Code Sample';
+class InputDecorationExampleApp extends StatelessWidget {
+ const InputDecorationExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('InputDecoration Sample')),
+ body: const InputDecorationExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class InputDecorationExample extends StatelessWidget {
+ const InputDecorationExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/input_decorator/input_decoration.2.dart b/examples/api/lib/material/input_decorator/input_decoration.2.dart
index 331493b..ce9493f 100644
--- a/examples/api/lib/material/input_decorator/input_decoration.2.dart
+++ b/examples/api/lib/material/input_decorator/input_decoration.2.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InputDecoration].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InputDecoration].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const InputDecorationExampleApp());
- static const String _title = 'Flutter Code Sample';
+class InputDecorationExampleApp extends StatelessWidget {
+ const InputDecorationExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('InputDecoration Sample')),
+ body: const InputDecorationExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class InputDecorationExample extends StatelessWidget {
+ const InputDecorationExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/input_decorator/input_decoration.3.dart b/examples/api/lib/material/input_decorator/input_decoration.3.dart
index ad67a95..ce63e2e 100644
--- a/examples/api/lib/material/input_decorator/input_decoration.3.dart
+++ b/examples/api/lib/material/input_decorator/input_decoration.3.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InputDecoration].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InputDecoration].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const InputDecorationExampleApp());
- static const String _title = 'Flutter Code Sample';
+class InputDecorationExampleApp extends StatelessWidget {
+ const InputDecorationExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('InputDecoration Sample')),
+ body: const InputDecorationExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class InputDecorationExample extends StatelessWidget {
+ const InputDecorationExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/input_decorator/input_decoration.floating_label_style_error.0.dart b/examples/api/lib/material/input_decorator/input_decoration.floating_label_style_error.0.dart
index 98e5c90..a7a3f2b 100644
--- a/examples/api/lib/material/input_decorator/input_decoration.floating_label_style_error.0.dart
+++ b/examples/api/lib/material/input_decorator/input_decoration.floating_label_style_error.0.dart
@@ -2,23 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InputDecorator].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InputDecorator].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const FloatingLabelStyleErrorExampleApp());
- static const String _title = 'Flutter Code Sample';
+class FloatingLabelStyleErrorExampleApp extends StatelessWidget {
+ const FloatingLabelStyleErrorExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('InputDecorator Sample')),
body: const Center(
child: InputDecoratorExample(),
),
@@ -41,9 +38,10 @@
// is in its error state.
floatingLabelStyle: MaterialStateTextStyle.resolveWith(
(Set<MaterialState> states) {
- final Color color = states.contains(MaterialState.error) ? Theme.of(context).colorScheme.error: Colors.orange;
+ final Color color =
+ states.contains(MaterialState.error) ? Theme.of(context).colorScheme.error : Colors.orange;
return TextStyle(color: color, letterSpacing: 1.3);
- }
+ },
),
),
validator: (String? value) {
diff --git a/examples/api/lib/material/input_decorator/input_decoration.label.0.dart b/examples/api/lib/material/input_decorator/input_decoration.label.0.dart
index 9852129..f819967 100644
--- a/examples/api/lib/material/input_decorator/input_decoration.label.0.dart
+++ b/examples/api/lib/material/input_decorator/input_decoration.label.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InputDecoration.label].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InputDecoration.label].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const LabelExampleApp());
- static const String _title = 'Flutter Code Sample';
+class LabelExampleApp extends StatelessWidget {
+ const LabelExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('InputDecoration.label Sample')),
+ body: const LabelExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class LabelExample extends StatelessWidget {
+ const LabelExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/input_decorator/input_decoration.label_style_error.0.dart b/examples/api/lib/material/input_decorator/input_decoration.label_style_error.0.dart
index 5655ece..a87a056 100644
--- a/examples/api/lib/material/input_decorator/input_decoration.label_style_error.0.dart
+++ b/examples/api/lib/material/input_decorator/input_decoration.label_style_error.0.dart
@@ -2,23 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InputDecorator].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InputDecorator].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const LabelStyleErrorExampleApp());
- static const String _title = 'Flutter Code Sample';
+class LabelStyleErrorExampleApp extends StatelessWidget {
+ const LabelStyleErrorExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('InputDecorator Sample')),
body: const Center(
child: InputDecoratorExample(),
),
@@ -41,9 +38,10 @@
// is in its error state.
labelStyle: MaterialStateTextStyle.resolveWith(
(Set<MaterialState> states) {
- final Color color = states.contains(MaterialState.error) ? Theme.of(context).colorScheme.error: Colors.orange;
+ final Color color =
+ states.contains(MaterialState.error) ? Theme.of(context).colorScheme.error : Colors.orange;
return TextStyle(color: color, letterSpacing: 1.3);
- }
+ },
),
),
validator: (String? value) {
diff --git a/examples/api/lib/material/input_decorator/input_decoration.material_state.0.dart b/examples/api/lib/material/input_decorator/input_decoration.material_state.0.dart
index 1d621c0..e7b6072 100644
--- a/examples/api/lib/material/input_decorator/input_decoration.material_state.0.dart
+++ b/examples/api/lib/material/input_decorator/input_decoration.material_state.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InputDecoration].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InputDecoration].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const MaterialStateExampleApp());
- static const String _title = 'Flutter Code Sample';
+class MaterialStateExampleApp extends StatelessWidget {
+ const MaterialStateExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('InputDecoration Sample')),
+ body: const MaterialStateExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class MaterialStateExample extends StatelessWidget {
+ const MaterialStateExample({super.key});
@override
Widget build(BuildContext context) {
@@ -37,7 +34,8 @@
prefixIconColor: MaterialStateColor.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.focused)) {
return Colors.green;
- } if (states.contains(MaterialState.error)) {
+ }
+ if (states.contains(MaterialState.error)) {
return Colors.red;
}
return Colors.grey;
diff --git a/examples/api/lib/material/input_decorator/input_decoration.material_state.1.dart b/examples/api/lib/material/input_decorator/input_decoration.material_state.1.dart
index 6de8207..5a1930d 100644
--- a/examples/api/lib/material/input_decorator/input_decoration.material_state.1.dart
+++ b/examples/api/lib/material/input_decorator/input_decoration.material_state.1.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InputDecoration].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InputDecoration].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const MaterialStateExampleApp());
- static const String _title = 'Flutter Code Sample';
+class MaterialStateExampleApp extends StatelessWidget {
+ const MaterialStateExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('InputDecoration Sample')),
+ body: const MaterialStateExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class MaterialStateExample extends StatelessWidget {
+ const MaterialStateExample({super.key});
@override
Widget build(BuildContext context) {
@@ -34,15 +31,18 @@
return Theme(
data: themeData.copyWith(
inputDecorationTheme: themeData.inputDecorationTheme.copyWith(
- prefixIconColor: MaterialStateColor.resolveWith((Set<MaterialState> states) {
- if (states.contains(MaterialState.focused)) {
- return Colors.green;
- } if (states.contains(MaterialState.error)) {
- return Colors.red;
- }
- return Colors.grey;
- }),
- )
+ prefixIconColor: MaterialStateColor.resolveWith(
+ (Set<MaterialState> states) {
+ if (states.contains(MaterialState.focused)) {
+ return Colors.green;
+ }
+ if (states.contains(MaterialState.error)) {
+ return Colors.red;
+ }
+ return Colors.grey;
+ },
+ ),
+ ),
),
child: TextFormField(
initialValue: 'abc',
diff --git a/examples/api/lib/material/input_decorator/input_decoration.prefix_icon.0.dart b/examples/api/lib/material/input_decorator/input_decoration.prefix_icon.0.dart
index 42cc45f..1a45563 100644
--- a/examples/api/lib/material/input_decorator/input_decoration.prefix_icon.0.dart
+++ b/examples/api/lib/material/input_decorator/input_decoration.prefix_icon.0.dart
@@ -2,19 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InputDecorator].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InputDecorator].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const PrefixIconExampleApp());
+
+class PrefixIconExampleApp extends StatelessWidget {
+ const PrefixIconExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: 'Input Decorator Sample',
home: Scaffold(body: InputDecoratorExample()),
);
}
diff --git a/examples/api/lib/material/input_decorator/input_decoration.prefix_icon_constraints.0.dart b/examples/api/lib/material/input_decorator/input_decoration.prefix_icon_constraints.0.dart
index 99ee08b..eb781af 100644
--- a/examples/api/lib/material/input_decorator/input_decoration.prefix_icon_constraints.0.dart
+++ b/examples/api/lib/material/input_decorator/input_decoration.prefix_icon_constraints.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InputDecoration.prefixIconConstraints].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InputDecoration.prefixIconConstraints].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const PrefixIconConstraintsExampleApp());
- static const String _title = 'Flutter Code Sample';
+class PrefixIconConstraintsExampleApp extends StatelessWidget {
+ const PrefixIconConstraintsExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('InputDecoration Sample')),
+ body: const PrefixIconConstraintsExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class PrefixIconConstraintsExample extends StatelessWidget {
+ const PrefixIconConstraintsExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/input_decorator/input_decoration.suffix_icon.0.dart b/examples/api/lib/material/input_decorator/input_decoration.suffix_icon.0.dart
index 83e1acc..eeda669 100644
--- a/examples/api/lib/material/input_decorator/input_decoration.suffix_icon.0.dart
+++ b/examples/api/lib/material/input_decorator/input_decoration.suffix_icon.0.dart
@@ -2,19 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InputDecorator].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InputDecorator].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SuffixIconExampleApp());
+
+class SuffixIconExampleApp extends StatelessWidget {
+ const SuffixIconExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: 'Input Decorator Sample',
home: Scaffold(body: InputDecoratorExample()),
);
}
diff --git a/examples/api/lib/material/input_decorator/input_decoration.suffix_icon_constraints.0.dart b/examples/api/lib/material/input_decorator/input_decoration.suffix_icon_constraints.0.dart
index 1103c6d..df1422d 100644
--- a/examples/api/lib/material/input_decorator/input_decoration.suffix_icon_constraints.0.dart
+++ b/examples/api/lib/material/input_decorator/input_decoration.suffix_icon_constraints.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InputDecoration.suffixIconConstraints].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InputDecoration.suffixIconConstraints].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SuffixIconConstraintsExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SuffixIconConstraintsExampleApp extends StatelessWidget {
+ const SuffixIconConstraintsExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('InputDecoration Sample')),
+ body: const SuffixIconConstraintsExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class SuffixIconConstraintsExample extends StatelessWidget {
+ const SuffixIconConstraintsExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/list_tile/custom_list_item.0.dart b/examples/api/lib/material/list_tile/custom_list_item.0.dart
index 9c5a117..891f803 100644
--- a/examples/api/lib/material/list_tile/custom_list_item.0.dart
+++ b/examples/api/lib/material/list_tile/custom_list_item.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for custom list items.
-
import 'package:flutter/material.dart';
+/// Flutter code sample for custom list items.
+
void main() => runApp(const CustomListItemApp());
class CustomListItemApp extends StatelessWidget {
diff --git a/examples/api/lib/material/list_tile/custom_list_item.1.dart b/examples/api/lib/material/list_tile/custom_list_item.1.dart
index 19477cd..d04b261 100644
--- a/examples/api/lib/material/list_tile/custom_list_item.1.dart
+++ b/examples/api/lib/material/list_tile/custom_list_item.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for custom list items.
-
import 'package:flutter/material.dart';
+/// Flutter code sample for custom list items.
+
void main() => runApp(const CustomListItemApp());
class CustomListItemApp extends StatelessWidget {
diff --git a/examples/api/lib/material/list_tile/list_tile.0.dart b/examples/api/lib/material/list_tile/list_tile.0.dart
index 996c6e3..50e7122 100644
--- a/examples/api/lib/material/list_tile/list_tile.0.dart
+++ b/examples/api/lib/material/list_tile/list_tile.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ListTile].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ListTile].
+
void main() => runApp(const ListTileApp());
class ListTileApp extends StatelessWidget {
@@ -86,8 +86,9 @@
subtitle: const Text('Tap here for Hero transition'),
tileColor: Colors.cyan,
onTap: () {
- Navigator.push(context, MaterialPageRoute<Widget>(
- builder: (BuildContext context) {
+ Navigator.push(
+ context,
+ MaterialPageRoute<Widget>(builder: (BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('ListTile Hero')),
body: Center(
diff --git a/examples/api/lib/material/list_tile/list_tile.1.dart b/examples/api/lib/material/list_tile/list_tile.1.dart
index 389977e..3ad480a 100644
--- a/examples/api/lib/material/list_tile/list_tile.1.dart
+++ b/examples/api/lib/material/list_tile/list_tile.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ListTile].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ListTile].
+
void main() => runApp(const ListTileApp());
class ListTileApp extends StatelessWidget {
@@ -67,9 +67,7 @@
child: ListTile(
leading: FlutterLogo(size: 72.0),
title: Text('Three-line ListTile'),
- subtitle: Text(
- 'A sufficiently long subtitle warrants three lines.'
- ),
+ subtitle: Text('A sufficiently long subtitle warrants three lines.'),
trailing: Icon(Icons.more_vert),
isThreeLine: true,
),
diff --git a/examples/api/lib/material/list_tile/list_tile.2.dart b/examples/api/lib/material/list_tile/list_tile.2.dart
index ad8a25d..7caa7ff 100644
--- a/examples/api/lib/material/list_tile/list_tile.2.dart
+++ b/examples/api/lib/material/list_tile/list_tile.2.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ListTile].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ListTile].
+
void main() => runApp(const ListTileApp());
class ListTileApp extends StatelessWidget {
@@ -30,29 +30,25 @@
body: ListView(
children: const <Widget>[
ListTile(
- leading: CircleAvatar(
- child: Text('A')
- ),
+ leading: CircleAvatar(child: Text('A')),
title: Text('Headline'),
subtitle: Text('Supporting text'),
trailing: Icon(Icons.favorite_rounded),
),
Divider(height: 0),
ListTile(
- leading: CircleAvatar(
- child: Text('B')
- ),
+ leading: CircleAvatar(child: Text('B')),
title: Text('Headline'),
- subtitle: Text('Longer supporting text to demonstrate how the text wraps and how the leading and trailing widgets are centered vertically with the text.'),
+ subtitle: Text(
+ 'Longer supporting text to demonstrate how the text wraps and how the leading and trailing widgets are centered vertically with the text.'),
trailing: Icon(Icons.favorite_rounded),
),
Divider(height: 0),
ListTile(
- leading: CircleAvatar(
- child: Text('C')
- ),
+ leading: CircleAvatar(child: Text('C')),
title: Text('Headline'),
- subtitle: Text("Longer supporting text to demonstrate how the text wraps and how setting 'ListTile.isThreeLine = true' aligns leading and trailing widgets to the top vertically with the text."),
+ subtitle: Text(
+ "Longer supporting text to demonstrate how the text wraps and how setting 'ListTile.isThreeLine = true' aligns leading and trailing widgets to the top vertically with the text."),
trailing: Icon(Icons.favorite_rounded),
isThreeLine: true,
),
diff --git a/examples/api/lib/material/list_tile/list_tile.3.dart b/examples/api/lib/material/list_tile/list_tile.3.dart
index d0d47b8..82f3264 100644
--- a/examples/api/lib/material/list_tile/list_tile.3.dart
+++ b/examples/api/lib/material/list_tile/list_tile.3.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ListTile].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ListTile].
+
void main() => runApp(const ListTileApp());
class ListTileApp extends StatelessWidget {
diff --git a/examples/api/lib/material/list_tile/list_tile.4.dart b/examples/api/lib/material/list_tile/list_tile.4.dart
index d7c2453..9ad3494 100644
--- a/examples/api/lib/material/list_tile/list_tile.4.dart
+++ b/examples/api/lib/material/list_tile/list_tile.4.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ListTile].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ListTile].
+
void main() => runApp(const ListTileApp());
class ListTileApp extends StatelessWidget {
@@ -41,10 +41,11 @@
titleAlignment: titleAlignment,
leading: Checkbox(
value: true,
- onChanged:(bool? value) { },
+ onChanged: (bool? value) {},
),
title: const Text('Headline Text'),
- subtitle: const Text('Tapping on the trailing widget will show a menu that allows you to change the title alignment. The title alignment is set to threeLine by default if `ThemeData.useMaterial3` is true. Otherwise, defaults to titleHeight.'),
+ subtitle: const Text(
+ 'Tapping on the trailing widget will show a menu that allows you to change the title alignment. The title alignment is set to threeLine by default if `ThemeData.useMaterial3` is true. Otherwise, defaults to titleHeight.'),
trailing: PopupMenuButton<ListTileTitleAlignment>(
onSelected: (ListTileTitleAlignment? value) {
setState(() {
diff --git a/examples/api/lib/material/list_tile/list_tile.selected.0.dart b/examples/api/lib/material/list_tile/list_tile.selected.0.dart
index 7ff56ac..513bdde 100644
--- a/examples/api/lib/material/list_tile/list_tile.selected.0.dart
+++ b/examples/api/lib/material/list_tile/list_tile.selected.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ListTile.selected].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ListTile.selected].
+
void main() => runApp(const ListTileApp());
class ListTileApp extends StatelessWidget {
@@ -19,6 +19,7 @@
);
}
}
+
class LisTileExample extends StatefulWidget {
const LisTileExample({super.key});
diff --git a/examples/api/lib/material/material_state/material_state_border_side.0.dart b/examples/api/lib/material/material_state/material_state_border_side.0.dart
index 4cb49e2..dadd03d 100644
--- a/examples/api/lib/material/material_state/material_state_border_side.0.dart
+++ b/examples/api/lib/material/material_state/material_state_border_side.0.dart
@@ -2,39 +2,36 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [MaterialStateBorderSide].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [MaterialStateBorderSide].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const MaterialStateBorderSideExampleApp());
- static const String _title = 'Flutter Code Sample';
+class MaterialStateBorderSideExampleApp extends StatelessWidget {
+ const MaterialStateBorderSideExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('MaterialStateBorderSide Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: MaterialStateBorderSideExample(),
),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class MaterialStateBorderSideExample extends StatefulWidget {
+ const MaterialStateBorderSideExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<MaterialStateBorderSideExample> createState() => _MaterialStateBorderSideExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _MaterialStateBorderSideExampleState extends State<MaterialStateBorderSideExample> {
bool isSelected = true;
@override
diff --git a/examples/api/lib/material/material_state/material_state_mouse_cursor.0.dart b/examples/api/lib/material/material_state/material_state_mouse_cursor.0.dart
index fc4af22..446f8e0 100644
--- a/examples/api/lib/material/material_state/material_state_mouse_cursor.0.dart
+++ b/examples/api/lib/material/material_state/material_state_mouse_cursor.0.dart
@@ -2,25 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [MaterialStateMouseCursor].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [MaterialStateMouseCursor].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const MaterialStateMouseCursorExampleApp());
- static const String _title = 'Flutter Code Sample';
+class MaterialStateMouseCursorExampleApp extends StatelessWidget {
+ const MaterialStateMouseCursorExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('MaterialStateMouseCursor Sample')),
body: const Center(
- child: MyStatelessWidget(),
+ child: MaterialStateMouseCursorExample(),
),
),
);
@@ -42,8 +39,8 @@
String get debugDescription => 'ListTileCursor()';
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class MaterialStateMouseCursorExample extends StatelessWidget {
+ const MaterialStateMouseCursorExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/material_state/material_state_outlined_border.0.dart b/examples/api/lib/material/material_state/material_state_outlined_border.0.dart
index 337534b..525bafc 100644
--- a/examples/api/lib/material/material_state/material_state_outlined_border.0.dart
+++ b/examples/api/lib/material/material_state/material_state_outlined_border.0.dart
@@ -2,28 +2,24 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [MaterialStateOutlinedBorder].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [MaterialStateOutlinedBorder].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const MaterialStateOutlinedBorderExampleApp());
- static const String _title = 'Flutter Code Sample';
+class MaterialStateOutlinedBorderExampleApp extends StatelessWidget {
+ const MaterialStateOutlinedBorderExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: MaterialStateOutlinedBorderExample(),
);
}
}
-class SelectedBorder extends RoundedRectangleBorder
- implements MaterialStateOutlinedBorder {
+class SelectedBorder extends RoundedRectangleBorder implements MaterialStateOutlinedBorder {
const SelectedBorder();
@override
@@ -35,14 +31,14 @@
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class MaterialStateOutlinedBorderExample extends StatefulWidget {
+ const MaterialStateOutlinedBorderExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<MaterialStateOutlinedBorderExample> createState() => _MaterialStateOutlinedBorderExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _MaterialStateOutlinedBorderExampleState extends State<MaterialStateOutlinedBorderExample> {
bool isSelected = true;
@override
diff --git a/examples/api/lib/material/material_state/material_state_property.0.dart b/examples/api/lib/material/material_state/material_state_property.0.dart
index a55baec..0840d58 100644
--- a/examples/api/lib/material/material_state/material_state_property.0.dart
+++ b/examples/api/lib/material/material_state/material_state_property.0.dart
@@ -2,33 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [MaterialStateProperty].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [MaterialStateProperty].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const MaterialStatePropertyExampleApp());
- static const String _title = 'Flutter Code Sample';
+class MaterialStatePropertyExampleApp extends StatelessWidget {
+ const MaterialStatePropertyExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('MaterialStateProperty Sample')),
body: const Center(
- child: MyStatelessWidget(),
+ child: MaterialStatePropertyExample(),
),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class MaterialStatePropertyExample extends StatelessWidget {
+ const MaterialStatePropertyExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/menu_anchor/checkbox_menu_button.0.dart b/examples/api/lib/material/menu_anchor/checkbox_menu_button.0.dart
index fc89517..6279b6e 100644
--- a/examples/api/lib/material/menu_anchor/checkbox_menu_button.0.dart
+++ b/examples/api/lib/material/menu_anchor/checkbox_menu_button.0.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CheckboxMenuButton].
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
+/// Flutter code sample for [CheckboxMenuButton].
+
void main() => runApp(const MenuApp());
class MyCheckboxMenu extends StatefulWidget {
diff --git a/examples/api/lib/material/menu_anchor/menu_accelerator_label.0.dart b/examples/api/lib/material/menu_anchor/menu_accelerator_label.0.dart
index 9bcb1e7..16869c6 100644
--- a/examples/api/lib/material/menu_anchor/menu_accelerator_label.0.dart
+++ b/examples/api/lib/material/menu_anchor/menu_accelerator_label.0.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [MenuAcceleratorLabel].
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
+/// Flutter code sample for [MenuAcceleratorLabel].
+
void main() => runApp(const MenuAcceleratorApp());
class MyMenuBar extends StatelessWidget {
diff --git a/examples/api/lib/material/menu_anchor/menu_anchor.0.dart b/examples/api/lib/material/menu_anchor/menu_anchor.0.dart
index 3edac65..0b3c374 100644
--- a/examples/api/lib/material/menu_anchor/menu_anchor.0.dart
+++ b/examples/api/lib/material/menu_anchor/menu_anchor.0.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [MenuAnchor].
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
+/// Flutter code sample for [MenuAnchor].
+
void main() => runApp(const MenuApp());
/// An enhanced enum to define the available menus and their shortcuts.
@@ -98,16 +98,18 @@
child: Text(MenuEntry.about.label),
onPressed: () => _activate(MenuEntry.about),
),
- if (_showingMessage) MenuItemButton(
- onPressed: () => _activate(MenuEntry.hideMessage),
- shortcut: MenuEntry.hideMessage.shortcut,
- child: Text(MenuEntry.hideMessage.label),
- ),
- if (!_showingMessage) MenuItemButton(
- onPressed: () => _activate(MenuEntry.showMessage),
- shortcut: MenuEntry.showMessage.shortcut,
- child: Text(MenuEntry.showMessage.label),
- ),
+ if (_showingMessage)
+ MenuItemButton(
+ onPressed: () => _activate(MenuEntry.hideMessage),
+ shortcut: MenuEntry.hideMessage.shortcut,
+ child: Text(MenuEntry.hideMessage.label),
+ ),
+ if (!_showingMessage)
+ MenuItemButton(
+ onPressed: () => _activate(MenuEntry.showMessage),
+ shortcut: MenuEntry.showMessage.shortcut,
+ child: Text(MenuEntry.showMessage.label),
+ ),
SubmenuButton(
menuChildren: <Widget>[
MenuItemButton(
diff --git a/examples/api/lib/material/menu_anchor/menu_anchor.1.dart b/examples/api/lib/material/menu_anchor/menu_anchor.1.dart
index 32254d5..b465094 100644
--- a/examples/api/lib/material/menu_anchor/menu_anchor.1.dart
+++ b/examples/api/lib/material/menu_anchor/menu_anchor.1.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [MenuAnchor].
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
+/// Flutter code sample for [MenuAnchor].
+
void main() => runApp(const ContextMenuApp());
/// An enhanced enum to define the available menus and their shortcuts.
@@ -101,16 +101,18 @@
child: Text(MenuEntry.about.label),
onPressed: () => _activate(MenuEntry.about),
),
- if (_showingMessage) MenuItemButton(
- onPressed: () => _activate(MenuEntry.hideMessage),
- shortcut: MenuEntry.hideMessage.shortcut,
- child: Text(MenuEntry.hideMessage.label),
- ),
- if (!_showingMessage) MenuItemButton(
- onPressed: () => _activate(MenuEntry.showMessage),
- shortcut: MenuEntry.showMessage.shortcut,
- child: Text(MenuEntry.showMessage.label),
- ),
+ if (_showingMessage)
+ MenuItemButton(
+ onPressed: () => _activate(MenuEntry.hideMessage),
+ shortcut: MenuEntry.hideMessage.shortcut,
+ child: Text(MenuEntry.hideMessage.label),
+ ),
+ if (!_showingMessage)
+ MenuItemButton(
+ onPressed: () => _activate(MenuEntry.showMessage),
+ shortcut: MenuEntry.showMessage.shortcut,
+ child: Text(MenuEntry.showMessage.label),
+ ),
SubmenuButton(
menuChildren: <Widget>[
MenuItemButton(
diff --git a/examples/api/lib/material/menu_anchor/menu_bar.0.dart b/examples/api/lib/material/menu_anchor/menu_bar.0.dart
index da14368..23ccec1 100644
--- a/examples/api/lib/material/menu_anchor/menu_bar.0.dart
+++ b/examples/api/lib/material/menu_anchor/menu_bar.0.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [MenuBar].
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
+/// Flutter code sample for [MenuBar].
+
void main() => runApp(const MenuBarApp());
/// A class for consolidating the definition of menu entries.
diff --git a/examples/api/lib/material/menu_anchor/radio_menu_button.0.dart b/examples/api/lib/material/menu_anchor/radio_menu_button.0.dart
index 6e36147..2044892 100644
--- a/examples/api/lib/material/menu_anchor/radio_menu_button.0.dart
+++ b/examples/api/lib/material/menu_anchor/radio_menu_button.0.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RadioMenuButton].
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
+/// Flutter code sample for [RadioMenuButton].
+
void main() => runApp(const MenuApp());
class MyRadioMenu extends StatefulWidget {
@@ -29,10 +29,10 @@
void didChangeDependencies() {
super.didChangeDependencies();
_entry = ShortcutRegistry.of(context).addAll(<ShortcutActivator, VoidCallbackIntent>{
- _redShortcut: VoidCallbackIntent(() => _setBackgroundColor(Colors.red)),
- _greenShortcut: VoidCallbackIntent(() => _setBackgroundColor(Colors.green)),
- _blueShortcut: VoidCallbackIntent(() => _setBackgroundColor(Colors.blue)),
- });
+ _redShortcut: VoidCallbackIntent(() => _setBackgroundColor(Colors.red)),
+ _greenShortcut: VoidCallbackIntent(() => _setBackgroundColor(Colors.green)),
+ _blueShortcut: VoidCallbackIntent(() => _setBackgroundColor(Colors.blue)),
+ });
}
@override
diff --git a/examples/api/lib/material/navigation_bar/navigation_bar.0.dart b/examples/api/lib/material/navigation_bar/navigation_bar.0.dart
index 422a08e..689b973 100644
--- a/examples/api/lib/material/navigation_bar/navigation_bar.0.dart
+++ b/examples/api/lib/material/navigation_bar/navigation_bar.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [NavigationBar].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [NavigationBar].
+
void main() => runApp(const NavigationBarApp());
class NavigationBarApp extends StatelessWidget {
diff --git a/examples/api/lib/material/navigation_bar/navigation_bar.1.dart b/examples/api/lib/material/navigation_bar/navigation_bar.1.dart
index acd3005..edd5e2d 100644
--- a/examples/api/lib/material/navigation_bar/navigation_bar.1.dart
+++ b/examples/api/lib/material/navigation_bar/navigation_bar.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [NavigationBar].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [NavigationBar].
+
void main() => runApp(const NavigationBarApp());
class NavigationBarApp extends StatelessWidget {
diff --git a/examples/api/lib/material/navigation_bar/navigation_bar.2.dart b/examples/api/lib/material/navigation_bar/navigation_bar.2.dart
index e430eb4..7af02cf 100644
--- a/examples/api/lib/material/navigation_bar/navigation_bar.2.dart
+++ b/examples/api/lib/material/navigation_bar/navigation_bar.2.dart
@@ -2,16 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [NavigationBar] with nested [Navigator] destinations.
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [NavigationBar] with nested [Navigator] destinations.
+
void main() {
runApp(const MaterialApp(home: Home()));
}
class Home extends StatefulWidget {
- const Home({ super.key });
+ const Home({super.key});
@override
State<Home> createState() => _HomeState();
@@ -32,10 +32,11 @@
int selectedIndex = 0;
AnimationController buildFaderController() {
- final AnimationController controller = AnimationController(vsync: this, duration: const Duration(milliseconds: 200));
+ final AnimationController controller =
+ AnimationController(vsync: this, duration: const Duration(milliseconds: 200));
controller.addStatusListener((AnimationStatus status) {
if (status == AnimationStatus.dismissed) {
- setState(() { }); // Rebuild unselected destinations offstage.
+ setState(() {}); // Rebuild unselected destinations offstage.
}
});
return controller;
@@ -44,8 +45,10 @@
@override
void initState() {
super.initState();
- navigatorKeys = List<GlobalKey<NavigatorState>>.generate(allDestinations.length, (int index) => GlobalKey()).toList();
- destinationFaders = List<AnimationController>.generate(allDestinations.length, (int index) => buildFaderController()).toList();
+ navigatorKeys =
+ List<GlobalKey<NavigatorState>>.generate(allDestinations.length, (int index) => GlobalKey()).toList();
+ destinationFaders =
+ List<AnimationController>.generate(allDestinations.length, (int index) => buildFaderController()).toList();
destinationFaders[selectedIndex].value = 1.0;
destinationViews = allDestinations.map((Destination destination) {
return FadeTransition(
@@ -53,7 +56,7 @@
child: DestinationView(
destination: destination,
navigatorKey: navigatorKeys[destination.index],
- )
+ ),
);
}).toList();
}
@@ -126,7 +129,7 @@
}
class RootPage extends StatelessWidget {
- const RootPage({ super.key, required this.destination });
+ const RootPage({super.key, required this.destination});
final Destination destination;
@@ -135,7 +138,9 @@
title: Text('${destination.title} AlertDialog'),
actions: <Widget>[
TextButton(
- onPressed: () { Navigator.pop(context); },
+ onPressed: () {
+ Navigator.pop(context);
+ },
child: const Text('OK'),
),
],
@@ -228,7 +233,7 @@
}
class ListPage extends StatelessWidget {
- const ListPage({ super.key, required this.destination });
+ const ListPage({super.key, required this.destination});
final Destination destination;
@@ -255,7 +260,7 @@
child: OutlinedButton(
style: buttonStyle.copyWith(
backgroundColor: MaterialStatePropertyAll<Color>(
- Color.lerp(destination.color[100], Colors.white, index / itemCount)!
+ Color.lerp(destination.color[100], Colors.white, index / itemCount)!,
),
),
onPressed: () {
@@ -272,7 +277,7 @@
}
class TextPage extends StatefulWidget {
- const TextPage({ super.key, required this.destination });
+ const TextPage({super.key, required this.destination});
final Destination destination;
@@ -349,7 +354,7 @@
return MaterialPageRoute<void>(
settings: settings,
builder: (BuildContext context) {
- switch(settings.name) {
+ switch (settings.name) {
case '/':
return RootPage(destination: widget.destination);
case '/list':
diff --git a/examples/api/lib/material/navigation_drawer/navigation_drawer.0.dart b/examples/api/lib/material/navigation_drawer/navigation_drawer.0.dart
index 5a69c74..446cd13 100644
--- a/examples/api/lib/material/navigation_drawer/navigation_drawer.0.dart
+++ b/examples/api/lib/material/navigation_drawer/navigation_drawer.0.dart
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [NavigationDrawer] .
-
// Builds an adaptive navigation widget layout. When the screen width is less than
// 450, A [NavigationBar] will be displayed. Otherwise, a [NavigationRail] will be
// displayed on the left side, and also a button to open the [NavigationDrawer].
@@ -11,6 +9,8 @@
import 'package:flutter/material.dart';
+/// Flutter code sample for [NavigationDrawer].
+
class ExampleDestination {
const ExampleDestination(this.label, this.icon, this.selectedIcon);
@@ -29,7 +29,6 @@
void main() {
runApp(
MaterialApp(
- title: 'NavigationDrawer Example',
debugShowCheckedModeBanner: false,
theme: ThemeData(useMaterial3: true),
home: const NavigationDrawerExample(),
@@ -60,7 +59,7 @@
scaffoldKey.currentState!.openEndDrawer();
}
- Widget buildBottomBarScaffold(){
+ Widget buildBottomBarScaffold() {
return Scaffold(
body: Center(
child: Column(
@@ -77,21 +76,21 @@
screenIndex = index;
});
},
- destinations: destinations
- .map((ExampleDestination destination) {
+ destinations: destinations.map(
+ (ExampleDestination destination) {
return NavigationDestination(
label: destination.label,
icon: destination.icon,
selectedIcon: destination.selectedIcon,
tooltip: destination.label,
);
- })
- .toList(),
+ },
+ ).toList(),
),
);
}
- Widget buildDrawerScaffold(BuildContext context){
+ Widget buildDrawerScaffold(BuildContext context) {
return Scaffold(
key: scaffoldKey,
body: SafeArea(
@@ -103,15 +102,15 @@
padding: const EdgeInsets.symmetric(horizontal: 5),
child: NavigationRail(
minWidth: 50,
- destinations: destinations
- .map((ExampleDestination destination) {
+ destinations: destinations.map(
+ (ExampleDestination destination) {
return NavigationRailDestination(
label: Text(destination.label),
icon: destination.icon,
selectedIcon: destination.selectedIcon,
);
- })
- .toList(),
+ },
+ ).toList(),
selectedIndex: screenIndex,
useIndicator: true,
onDestinationSelected: (int index) {
@@ -148,14 +147,15 @@
style: Theme.of(context).textTheme.titleSmall,
),
),
- ...destinations
- .map((ExampleDestination destination) {
+ ...destinations.map(
+ (ExampleDestination destination) {
return NavigationDrawerDestination(
label: Text(destination.label),
icon: destination.icon,
selectedIcon: destination.selectedIcon,
);
- }),
+ },
+ ),
const Padding(
padding: EdgeInsets.fromLTRB(28, 16, 28, 10),
child: Divider(),
@@ -168,7 +168,7 @@
@override
void didChangeDependencies() {
super.didChangeDependencies();
- showNavigationDrawer = MediaQuery.of(context).size.width >= 450;
+ showNavigationDrawer = MediaQuery.of(context).size.width >= 450;
}
@override
diff --git a/examples/api/lib/material/navigation_rail/navigation_rail.0.dart b/examples/api/lib/material/navigation_rail/navigation_rail.0.dart
index d6ac9ad..fbe7f6a 100644
--- a/examples/api/lib/material/navigation_rail/navigation_rail.0.dart
+++ b/examples/api/lib/material/navigation_rail/navigation_rail.0.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [NavigationRail].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [NavigationRail].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const NavigationRailExampleApp());
+
+class NavigationRailExampleApp extends StatelessWidget {
+ const NavigationRailExampleApp({super.key});
@override
Widget build(BuildContext context) {
@@ -47,19 +47,23 @@
});
},
labelType: labelType,
- leading: showLeading ? FloatingActionButton(
- elevation: 0,
- onPressed: () {
- // Add your onPressed code here!
- },
- child: const Icon(Icons.add),
- ) : const SizedBox(),
- trailing: showTrailing ? IconButton(
- onPressed: () {
- // Add your onPressed code here!
- },
- icon: const Icon(Icons.more_horiz_rounded),
- ) : const SizedBox(),
+ leading: showLeading
+ ? FloatingActionButton(
+ elevation: 0,
+ onPressed: () {
+ // Add your onPressed code here!
+ },
+ child: const Icon(Icons.add),
+ )
+ : const SizedBox(),
+ trailing: showTrailing
+ ? IconButton(
+ onPressed: () {
+ // Add your onPressed code here!
+ },
+ icon: const Icon(Icons.more_horiz_rounded),
+ )
+ : const SizedBox(),
destinations: const <NavigationRailDestination>[
NavigationRailDestination(
icon: Icon(Icons.favorite_border),
@@ -80,100 +84,100 @@
),
const VerticalDivider(thickness: 1, width: 1),
// This is the main content.
- Expanded(
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- Text('selectedIndex: $_selectedIndex'),
- const SizedBox(height: 20),
- Text('Label type: ${labelType.name}'),
- const SizedBox(height: 10),
- OverflowBar(
- spacing: 10.0,
- children: <Widget>[
- ElevatedButton(
- onPressed: () {
- setState(() {
- labelType = NavigationRailLabelType.none;
- });
- },
- child: const Text('None'),
- ),
- ElevatedButton(
- onPressed: () {
- setState(() {
- labelType = NavigationRailLabelType.selected;
- });
- },
- child: const Text('Selected'),
- ),
- ElevatedButton(
- onPressed: () {
- setState(() {
- labelType = NavigationRailLabelType.all;
- });
- },
- child: const Text('All'),
- ),
- ],
- ),
- const SizedBox(height: 20),
- Text('Group alignment: $groupAlignment'),
- const SizedBox(height: 10),
- OverflowBar(
- spacing: 10.0,
- children: <Widget>[
- ElevatedButton(
- onPressed: () {
- setState(() {
- groupAlignment = -1.0;
- });
- },
- child: const Text('Top'),
- ),
- ElevatedButton(
- onPressed: () {
- setState(() {
- groupAlignment = 0.0;
- });
- },
- child: const Text('Center'),
- ),
- ElevatedButton(
- onPressed: () {
- setState(() {
- groupAlignment = 1.0;
- });
- },
- child: const Text('Bottom'),
- ),
- ],
- ),
- const SizedBox(height: 20),
- OverflowBar(
- spacing: 10.0,
- children: <Widget>[
- ElevatedButton(
- onPressed: () {
- setState(() {
- showLeading = !showLeading;
- });
- },
- child: Text(showLeading ? 'Hide Leading' : 'Show Leading'),
- ),
- ElevatedButton(
- onPressed: () {
- setState(() {
- showTrailing = !showTrailing;
- });
- },
- child: Text(showTrailing ? 'Hide Trailing' : 'Show Trailing'),
- ),
- ],
- ),
- ],
- ),
+ Expanded(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: <Widget>[
+ Text('selectedIndex: $_selectedIndex'),
+ const SizedBox(height: 20),
+ Text('Label type: ${labelType.name}'),
+ const SizedBox(height: 10),
+ OverflowBar(
+ spacing: 10.0,
+ children: <Widget>[
+ ElevatedButton(
+ onPressed: () {
+ setState(() {
+ labelType = NavigationRailLabelType.none;
+ });
+ },
+ child: const Text('None'),
+ ),
+ ElevatedButton(
+ onPressed: () {
+ setState(() {
+ labelType = NavigationRailLabelType.selected;
+ });
+ },
+ child: const Text('Selected'),
+ ),
+ ElevatedButton(
+ onPressed: () {
+ setState(() {
+ labelType = NavigationRailLabelType.all;
+ });
+ },
+ child: const Text('All'),
+ ),
+ ],
+ ),
+ const SizedBox(height: 20),
+ Text('Group alignment: $groupAlignment'),
+ const SizedBox(height: 10),
+ OverflowBar(
+ spacing: 10.0,
+ children: <Widget>[
+ ElevatedButton(
+ onPressed: () {
+ setState(() {
+ groupAlignment = -1.0;
+ });
+ },
+ child: const Text('Top'),
+ ),
+ ElevatedButton(
+ onPressed: () {
+ setState(() {
+ groupAlignment = 0.0;
+ });
+ },
+ child: const Text('Center'),
+ ),
+ ElevatedButton(
+ onPressed: () {
+ setState(() {
+ groupAlignment = 1.0;
+ });
+ },
+ child: const Text('Bottom'),
+ ),
+ ],
+ ),
+ const SizedBox(height: 20),
+ OverflowBar(
+ spacing: 10.0,
+ children: <Widget>[
+ ElevatedButton(
+ onPressed: () {
+ setState(() {
+ showLeading = !showLeading;
+ });
+ },
+ child: Text(showLeading ? 'Hide Leading' : 'Show Leading'),
+ ),
+ ElevatedButton(
+ onPressed: () {
+ setState(() {
+ showTrailing = !showTrailing;
+ });
+ },
+ child: Text(showTrailing ? 'Hide Trailing' : 'Show Trailing'),
+ ),
+ ],
+ ),
+ ],
),
+ ),
],
),
);
diff --git a/examples/api/lib/material/navigation_rail/navigation_rail.1.dart b/examples/api/lib/material/navigation_rail/navigation_rail.1.dart
index 9345d58..812f334 100644
--- a/examples/api/lib/material/navigation_rail/navigation_rail.1.dart
+++ b/examples/api/lib/material/navigation_rail/navigation_rail.1.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [NavigationRail].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [NavigationRail].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const NavigationRailExampleApp());
+
+class NavigationRailExampleApp extends StatelessWidget {
+ const NavigationRailExampleApp({super.key});
@override
Widget build(BuildContext context) {
@@ -49,19 +49,23 @@
});
},
labelType: labelType,
- leading: showLeading ? FloatingActionButton(
- elevation: 0,
- onPressed: () {
- // Add your onPressed code here!
- },
- child: const Icon(Icons.add),
- ) : const SizedBox(),
- trailing: showTrailing ? IconButton(
- onPressed: () {
- // Add your onPressed code here!
- },
- icon: const Icon(Icons.more_horiz_rounded),
- ) : const SizedBox(),
+ leading: showLeading
+ ? FloatingActionButton(
+ elevation: 0,
+ onPressed: () {
+ // Add your onPressed code here!
+ },
+ child: const Icon(Icons.add),
+ )
+ : const SizedBox(),
+ trailing: showTrailing
+ ? IconButton(
+ onPressed: () {
+ // Add your onPressed code here!
+ },
+ icon: const Icon(Icons.more_horiz_rounded),
+ )
+ : const SizedBox(),
destinations: const <NavigationRailDestination>[
NavigationRailDestination(
icon: Icon(Icons.favorite_border),
diff --git a/examples/api/lib/material/navigation_rail/navigation_rail.extended_animation.0.dart b/examples/api/lib/material/navigation_rail/navigation_rail.extended_animation.0.dart
index 36f575e..c216366 100644
--- a/examples/api/lib/material/navigation_rail/navigation_rail.extended_animation.0.dart
+++ b/examples/api/lib/material/navigation_rail/navigation_rail.extended_animation.0.dart
@@ -2,16 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [NavigationRail.extendedAnimation].
-
import 'dart:ui';
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [NavigationRail.extendedAnimation].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ExtendedAnimationExampleApp());
+
+class ExtendedAnimationExampleApp extends StatelessWidget {
+ const ExtendedAnimationExampleApp({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/outlined_button/outlined_button.0.dart b/examples/api/lib/material/outlined_button/outlined_button.0.dart
index e9109bf..b177a70 100644
--- a/examples/api/lib/material/outlined_button/outlined_button.0.dart
+++ b/examples/api/lib/material/outlined_button/outlined_button.0.dart
@@ -2,33 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [OutlinedButton].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [OutlinedButton].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const OutlinedButtonExampleApp());
- static const String _title = 'Flutter Code Sample';
+class OutlinedButtonExampleApp extends StatelessWidget {
+ const OutlinedButtonExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('OutlinedButton Sample')),
body: const Center(
- child: MyStatelessWidget(),
+ child: OutlinedButtonExample(),
),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class OutlinedButtonExample extends StatelessWidget {
+ const OutlinedButtonExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/page_transitions_theme/page_transitions_theme.0.dart b/examples/api/lib/material/page_transitions_theme/page_transitions_theme.0.dart
index 7283b1f..e541cd8 100644
--- a/examples/api/lib/material/page_transitions_theme/page_transitions_theme.0.dart
+++ b/examples/api/lib/material/page_transitions_theme/page_transitions_theme.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [PageTransitionsTheme].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [PageTransitionsTheme].
+
void main() => runApp(const PageTransitionsThemeApp());
class PageTransitionsThemeApp extends StatelessWidget {
diff --git a/examples/api/lib/material/page_transitions_theme/page_transitions_theme.1.dart b/examples/api/lib/material/page_transitions_theme/page_transitions_theme.1.dart
index 65454fa..8f106d0 100644
--- a/examples/api/lib/material/page_transitions_theme/page_transitions_theme.1.dart
+++ b/examples/api/lib/material/page_transitions_theme/page_transitions_theme.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [PageTransitionsTheme].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [PageTransitionsTheme].
+
void main() => runApp(const PageTransitionsThemeApp());
class PageTransitionsThemeApp extends StatelessWidget {
diff --git a/examples/api/lib/material/platform_menu_bar/platform_menu_bar.0.dart b/examples/api/lib/material/platform_menu_bar/platform_menu_bar.0.dart
index 0386176..5b79009 100644
--- a/examples/api/lib/material/platform_menu_bar/platform_menu_bar.0.dart
+++ b/examples/api/lib/material/platform_menu_bar/platform_menu_bar.0.dart
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [PlatformMenuBar].
-
// THIS SAMPLE ONLY WORKS ON MACOS.
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
+/// Flutter code sample for [PlatformMenuBar].
+
void main() => runApp(const ExampleApp());
enum MenuSelection {
@@ -126,7 +126,7 @@
child: Text(_showMessage
? _message
: 'This space intentionally left blank.\n'
- 'Show a message here using the menu.'),
+ 'Show a message here using the menu.'),
),
);
}
diff --git a/examples/api/lib/material/popup_menu/popup_menu.0.dart b/examples/api/lib/material/popup_menu/popup_menu.0.dart
index 1ceee33..47f7c82 100644
--- a/examples/api/lib/material/popup_menu/popup_menu.0.dart
+++ b/examples/api/lib/material/popup_menu/popup_menu.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [PopupMenuButton].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [PopupMenuButton].
+
// This is the type used by the popup menu below.
enum SampleItem { itemOne, itemTwo, itemThree }
diff --git a/examples/api/lib/material/popup_menu/popup_menu.1.dart b/examples/api/lib/material/popup_menu/popup_menu.1.dart
index 2c0063d..2a3a4d6 100644
--- a/examples/api/lib/material/popup_menu/popup_menu.1.dart
+++ b/examples/api/lib/material/popup_menu/popup_menu.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [PopupMenuButton].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [PopupMenuButton].
+
// This is the type used by the popup menu below.
enum SampleItem { itemOne, itemTwo, itemThree }
diff --git a/examples/api/lib/material/progress_indicator/circular_progress_indicator.0.dart b/examples/api/lib/material/progress_indicator/circular_progress_indicator.0.dart
index c701c8c..a41036a 100644
--- a/examples/api/lib/material/progress_indicator/circular_progress_indicator.0.dart
+++ b/examples/api/lib/material/progress_indicator/circular_progress_indicator.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CircularProgressIndicator].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [CircularProgressIndicator].
+
void main() => runApp(const ProgressIndicatorApp());
class ProgressIndicatorApp extends StatelessWidget {
@@ -26,8 +26,7 @@
State<ProgressIndicatorExample> createState() => _ProgressIndicatorExampleState();
}
-class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample>
- with TickerProviderStateMixin {
+class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample> with TickerProviderStateMixin {
late AnimationController controller;
@override
diff --git a/examples/api/lib/material/progress_indicator/circular_progress_indicator.1.dart b/examples/api/lib/material/progress_indicator/circular_progress_indicator.1.dart
index eba53f6..6b228f8 100644
--- a/examples/api/lib/material/progress_indicator/circular_progress_indicator.1.dart
+++ b/examples/api/lib/material/progress_indicator/circular_progress_indicator.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CircularProgressIndicator].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [CircularProgressIndicator].
+
void main() => runApp(const ProgressIndicatorApp());
class ProgressIndicatorApp extends StatelessWidget {
@@ -27,8 +27,7 @@
State<ProgressIndicatorExample> createState() => _ProgressIndicatorExampleState();
}
-class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample>
- with TickerProviderStateMixin {
+class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample> with TickerProviderStateMixin {
late AnimationController controller;
bool determinate = false;
@@ -86,7 +85,9 @@
if (determinate) {
controller.stop();
} else {
- controller..forward(from: controller.value)..repeat();
+ controller
+ ..forward(from: controller.value)
+ ..repeat();
}
});
},
diff --git a/examples/api/lib/material/progress_indicator/linear_progress_indicator.0.dart b/examples/api/lib/material/progress_indicator/linear_progress_indicator.0.dart
index 81d5271..7e2e7c3 100644
--- a/examples/api/lib/material/progress_indicator/linear_progress_indicator.0.dart
+++ b/examples/api/lib/material/progress_indicator/linear_progress_indicator.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [LinearProgressIndicator].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [LinearProgressIndicator].
+
void main() => runApp(const ProgressIndicatorApp());
class ProgressIndicatorApp extends StatelessWidget {
@@ -26,8 +26,7 @@
State<ProgressIndicatorExample> createState() => _ProgressIndicatorExampleState();
}
-class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample>
- with TickerProviderStateMixin {
+class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample> with TickerProviderStateMixin {
late AnimationController controller;
@override
diff --git a/examples/api/lib/material/progress_indicator/linear_progress_indicator.1.dart b/examples/api/lib/material/progress_indicator/linear_progress_indicator.1.dart
index 4fff2ef..9a954e4 100644
--- a/examples/api/lib/material/progress_indicator/linear_progress_indicator.1.dart
+++ b/examples/api/lib/material/progress_indicator/linear_progress_indicator.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [LinearProgressIndicator].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [LinearProgressIndicator].
+
void main() => runApp(const ProgressIndicatorApp());
class ProgressIndicatorApp extends StatelessWidget {
@@ -27,8 +27,7 @@
State<ProgressIndicatorExample> createState() => _ProgressIndicatorExampleState();
}
-class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample>
- with TickerProviderStateMixin {
+class _ProgressIndicatorExampleState extends State<ProgressIndicatorExample> with TickerProviderStateMixin {
late AnimationController controller;
bool determinate = false;
@@ -86,7 +85,9 @@
if (determinate) {
controller.stop();
} else {
- controller..forward(from: controller.value)..repeat();
+ controller
+ ..forward(from: controller.value)
+ ..repeat();
}
});
},
diff --git a/examples/api/lib/material/radio/radio.0.dart b/examples/api/lib/material/radio/radio.0.dart
index f0374c5..4797a6f 100644
--- a/examples/api/lib/material/radio/radio.0.dart
+++ b/examples/api/lib/material/radio/radio.0.dart
@@ -2,25 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Radio].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Radio].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const RadioExampleApp());
- static const String _title = 'Flutter Code Sample';
+class RadioExampleApp extends StatelessWidget {
+ const RadioExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('Radio Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: RadioExample(),
),
),
);
@@ -29,14 +26,14 @@
enum SingingCharacter { lafayette, jefferson }
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class RadioExample extends StatefulWidget {
+ const RadioExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<RadioExample> createState() => _RadioExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _RadioExampleState extends State<RadioExample> {
SingingCharacter? _character = SingingCharacter.lafayette;
@override
diff --git a/examples/api/lib/material/radio/radio.toggleable.0.dart b/examples/api/lib/material/radio/radio.toggleable.0.dart
index 3ae99d1..fbe38a6 100644
--- a/examples/api/lib/material/radio/radio.toggleable.0.dart
+++ b/examples/api/lib/material/radio/radio.toggleable.0.dart
@@ -2,37 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Radio.toggleable].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Radio.toggleable].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ToggleableExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ToggleableExampleApp extends StatelessWidget {
+ const ToggleableExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatefulWidget(),
+ appBar: AppBar(title: const Text('Radio Sample')),
+ body: const ToggleableExample(),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class ToggleableExample extends StatefulWidget {
+ const ToggleableExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<ToggleableExample> createState() => _ToggleableExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _ToggleableExampleState extends State<ToggleableExample> {
int? groupValue;
static const List<String> selections = <String>[
'Hercules Mulligan',
diff --git a/examples/api/lib/material/radio_list_tile/custom_labeled_radio.0.dart b/examples/api/lib/material/radio_list_tile/custom_labeled_radio.0.dart
index 4080992..80061a3 100644
--- a/examples/api/lib/material/radio_list_tile/custom_labeled_radio.0.dart
+++ b/examples/api/lib/material/radio_list_tile/custom_labeled_radio.0.dart
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for custom labeled radio.
-
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
+/// Flutter code sample for custom labeled radio.
+
void main() => runApp(const LabeledRadioApp());
class LabeledRadioApp extends StatelessWidget {
diff --git a/examples/api/lib/material/radio_list_tile/custom_labeled_radio.1.dart b/examples/api/lib/material/radio_list_tile/custom_labeled_radio.1.dart
index 4ca903a..1eaabbc 100644
--- a/examples/api/lib/material/radio_list_tile/custom_labeled_radio.1.dart
+++ b/examples/api/lib/material/radio_list_tile/custom_labeled_radio.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for custom labeled radio.
-
import 'package:flutter/material.dart';
+/// Flutter code sample for custom labeled radio.
+
void main() => runApp(const LabeledRadioApp());
class LabeledRadioApp extends StatelessWidget {
diff --git a/examples/api/lib/material/radio_list_tile/radio_list_tile.0.dart b/examples/api/lib/material/radio_list_tile/radio_list_tile.0.dart
index 01ed639..f54f252 100644
--- a/examples/api/lib/material/radio_list_tile/radio_list_tile.0.dart
+++ b/examples/api/lib/material/radio_list_tile/radio_list_tile.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RadioListTile].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [RadioListTile].
+
void main() => runApp(const RadioListTileApp());
class RadioListTileApp extends StatelessWidget {
diff --git a/examples/api/lib/material/radio_list_tile/radio_list_tile.1.dart b/examples/api/lib/material/radio_list_tile/radio_list_tile.1.dart
index dc0db0a..1166553 100644
--- a/examples/api/lib/material/radio_list_tile/radio_list_tile.1.dart
+++ b/examples/api/lib/material/radio_list_tile/radio_list_tile.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RadioListTile].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [RadioListTile].
+
void main() => runApp(const RadioListTileApp());
class RadioListTileApp extends StatelessWidget {
@@ -58,7 +58,8 @@
});
},
title: const Text('Tomato'),
- subtitle: const Text('Longer supporting text to demonstrate how the text wraps and the radio is centered vertically with the text.'),
+ subtitle: const Text(
+ 'Longer supporting text to demonstrate how the text wraps and the radio is centered vertically with the text.'),
),
RadioListTile<Groceries>(
value: Groceries.lettuce,
@@ -69,7 +70,8 @@
});
},
title: const Text('Lettuce'),
- subtitle: const Text("Longer supporting text to demonstrate how the text wraps and how setting 'RadioListTile.isThreeLine = true' aligns the radio to the top vertically with the text."),
+ subtitle: const Text(
+ "Longer supporting text to demonstrate how the text wraps and how setting 'RadioListTile.isThreeLine = true' aligns the radio to the top vertically with the text."),
isThreeLine: true,
),
],
diff --git a/examples/api/lib/material/radio_list_tile/radio_list_tile.toggleable.0.dart b/examples/api/lib/material/radio_list_tile/radio_list_tile.toggleable.0.dart
index 70ada4f..6fdb158 100644
--- a/examples/api/lib/material/radio_list_tile/radio_list_tile.toggleable.0.dart
+++ b/examples/api/lib/material/radio_list_tile/radio_list_tile.toggleable.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RadioListTile.toggleable].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [RadioListTile.toggleable].
+
void main() => runApp(const RadioListTileApp());
class RadioListTileApp extends StatelessWidget {
diff --git a/examples/api/lib/material/range_slider/range_slider.0.dart b/examples/api/lib/material/range_slider/range_slider.0.dart
index 3d7ecc9..31301e3 100644
--- a/examples/api/lib/material/range_slider/range_slider.0.dart
+++ b/examples/api/lib/material/range_slider/range_slider.0.dart
@@ -2,37 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RangeSlider].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [RangeSlider].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const RangeSliderExampleApp());
- static const String _title = 'Flutter Code Sample';
+class RangeSliderExampleApp extends StatelessWidget {
+ const RangeSliderExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatefulWidget(),
+ appBar: AppBar(title: const Text('RangeSlider Sample')),
+ body: const RangeSliderExample(),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class RangeSliderExample extends StatefulWidget {
+ const RangeSliderExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<RangeSliderExample> createState() => _RangeSliderExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _RangeSliderExampleState extends State<RangeSliderExample> {
RangeValues _currentRangeValues = const RangeValues(40, 80);
@override
diff --git a/examples/api/lib/material/refresh_indicator/refresh_indicator.0.dart b/examples/api/lib/material/refresh_indicator/refresh_indicator.0.dart
index 8db00f3..78d6fb5 100644
--- a/examples/api/lib/material/refresh_indicator/refresh_indicator.0.dart
+++ b/examples/api/lib/material/refresh_indicator/refresh_indicator.0.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RefreshIndicator].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [RefreshIndicator].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const RefreshIndicatorExampleApp());
+
+class RefreshIndicatorExampleApp extends StatelessWidget {
+ const RefreshIndicatorExampleApp({super.key});
@override
Widget build(BuildContext context) {
@@ -27,8 +27,7 @@
}
class _RefreshIndicatorExampleState extends State<RefreshIndicatorExample> {
- final GlobalKey<RefreshIndicatorState> _refreshIndicatorKey =
- GlobalKey<RefreshIndicatorState>();
+ final GlobalKey<RefreshIndicatorState> _refreshIndicatorKey = GlobalKey<RefreshIndicatorState>();
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/refresh_indicator/refresh_indicator.1.dart b/examples/api/lib/material/refresh_indicator/refresh_indicator.1.dart
index 6f01722..aec4609 100644
--- a/examples/api/lib/material/refresh_indicator/refresh_indicator.1.dart
+++ b/examples/api/lib/material/refresh_indicator/refresh_indicator.1.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RefreshIndicator].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [RefreshIndicator].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const RefreshIndicatorExampleApp());
+
+class RefreshIndicatorExampleApp extends StatelessWidget {
+ const RefreshIndicatorExampleApp({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/reorderable_list/reorderable_list_view.0.dart b/examples/api/lib/material/reorderable_list/reorderable_list_view.0.dart
index 60b0a9c..e5a798e 100644
--- a/examples/api/lib/material/reorderable_list/reorderable_list_view.0.dart
+++ b/examples/api/lib/material/reorderable_list/reorderable_list_view.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ReorderableListView].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ReorderableListView].
+
void main() => runApp(const ReorderableApp());
class ReorderableApp extends StatelessWidget {
@@ -26,10 +26,10 @@
const ReorderableExample({super.key});
@override
- State<ReorderableExample> createState() => _MyStatefulWidgetState();
+ State<ReorderableExample> createState() => _ReorderableListViewExampleState();
}
-class _MyStatefulWidgetState extends State<ReorderableExample> {
+class _ReorderableListViewExampleState extends State<ReorderableExample> {
final List<int> _items = List<int>.generate(50, (int index) => index);
@override
diff --git a/examples/api/lib/material/reorderable_list/reorderable_list_view.1.dart b/examples/api/lib/material/reorderable_list/reorderable_list_view.1.dart
index 3ad16a7..9f48920 100644
--- a/examples/api/lib/material/reorderable_list/reorderable_list_view.1.dart
+++ b/examples/api/lib/material/reorderable_list/reorderable_list_view.1.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ReorderableListView].
import 'dart:ui';
import 'package:flutter/material.dart';
+/// Flutter code sample for [ReorderableListView].
+
void main() => runApp(const ReorderableApp());
class ReorderableApp extends StatelessWidget {
diff --git a/examples/api/lib/material/reorderable_list/reorderable_list_view.build_default_drag_handles.0.dart b/examples/api/lib/material/reorderable_list/reorderable_list_view.build_default_drag_handles.0.dart
index 1701325..6fa0013 100644
--- a/examples/api/lib/material/reorderable_list/reorderable_list_view.build_default_drag_handles.0.dart
+++ b/examples/api/lib/material/reorderable_list/reorderable_list_view.build_default_drag_handles.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ReorderableListView.buildDefaultDragHandles].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ReorderableListView.buildDefaultDragHandles].
+
void main() => runApp(const ReorderableApp());
class ReorderableApp extends StatelessWidget {
diff --git a/examples/api/lib/material/reorderable_list/reorderable_list_view.reorderable_list_view_builder.0.dart b/examples/api/lib/material/reorderable_list/reorderable_list_view.reorderable_list_view_builder.0.dart
index 3df8bc1..2647a75 100644
--- a/examples/api/lib/material/reorderable_list/reorderable_list_view.reorderable_list_view_builder.0.dart
+++ b/examples/api/lib/material/reorderable_list/reorderable_list_view.reorderable_list_view_builder.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ReorderableListView.ReorderableListView.builder].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ReorderableListView.ReorderableListView.builder].
+
void main() => runApp(const ReorderableApp());
class ReorderableApp extends StatelessWidget {
diff --git a/examples/api/lib/material/scaffold/scaffold.0.dart b/examples/api/lib/material/scaffold/scaffold.0.dart
index edc73ec..6513333 100644
--- a/examples/api/lib/material/scaffold/scaffold.0.dart
+++ b/examples/api/lib/material/scaffold/scaffold.0.dart
@@ -2,34 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Scaffold].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Scaffold].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ScaffoldExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ScaffoldExampleApp extends StatelessWidget {
+ const ScaffoldExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: ScaffoldExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class ScaffoldExample extends StatefulWidget {
+ const ScaffoldExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<ScaffoldExample> createState() => _ScaffoldExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _ScaffoldExampleState extends State<ScaffoldExample> {
int _count = 0;
@override
diff --git a/examples/api/lib/material/scaffold/scaffold.1.dart b/examples/api/lib/material/scaffold/scaffold.1.dart
index 74cb695..c0cadf7 100644
--- a/examples/api/lib/material/scaffold/scaffold.1.dart
+++ b/examples/api/lib/material/scaffold/scaffold.1.dart
@@ -2,34 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Scaffold].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Scaffold].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ScaffoldExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ScaffoldExampleApp extends StatelessWidget {
+ const ScaffoldExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: ScaffoldExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class ScaffoldExample extends StatefulWidget {
+ const ScaffoldExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<ScaffoldExample> createState() => _ScaffoldExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _ScaffoldExampleState extends State<ScaffoldExample> {
int _count = 0;
@override
diff --git a/examples/api/lib/material/scaffold/scaffold.2.dart b/examples/api/lib/material/scaffold/scaffold.2.dart
index 98caab4..147628b 100644
--- a/examples/api/lib/material/scaffold/scaffold.2.dart
+++ b/examples/api/lib/material/scaffold/scaffold.2.dart
@@ -2,34 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Scaffold].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Scaffold].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ScaffoldExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ScaffoldExampleApp extends StatelessWidget {
+ const ScaffoldExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: ScaffoldExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class ScaffoldExample extends StatefulWidget {
+ const ScaffoldExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<ScaffoldExample> createState() => _ScaffoldExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _ScaffoldExampleState extends State<ScaffoldExample> {
int _count = 0;
@override
diff --git a/examples/api/lib/material/scaffold/scaffold.drawer.0.dart b/examples/api/lib/material/scaffold/scaffold.drawer.0.dart
index 38e48f8..2731f47 100644
--- a/examples/api/lib/material/scaffold/scaffold.drawer.0.dart
+++ b/examples/api/lib/material/scaffold/scaffold.drawer.0.dart
@@ -2,34 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Scaffold.drawer].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Scaffold.drawer].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const DrawerExampleApp());
- static const String _title = 'Flutter Code Sample';
+class DrawerExampleApp extends StatelessWidget {
+ const DrawerExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: DrawerExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class DrawerExample extends StatefulWidget {
+ const DrawerExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<DrawerExample> createState() => _DrawerExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _DrawerExampleState extends State<DrawerExample> {
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
void _openDrawer() {
diff --git a/examples/api/lib/material/scaffold/scaffold.end_drawer.0.dart b/examples/api/lib/material/scaffold/scaffold.end_drawer.0.dart
index 76862e0..8d3cbe1 100644
--- a/examples/api/lib/material/scaffold/scaffold.end_drawer.0.dart
+++ b/examples/api/lib/material/scaffold/scaffold.end_drawer.0.dart
@@ -2,34 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Scaffold.endDrawer].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Scaffold.endDrawer].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const EndDrawerExampleApp());
- static const String _title = 'Flutter Code Sample';
+class EndDrawerExampleApp extends StatelessWidget {
+ const EndDrawerExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: EndDrawerExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class EndDrawerExample extends StatefulWidget {
+ const EndDrawerExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<EndDrawerExample> createState() => _EndDrawerExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _EndDrawerExampleState extends State<EndDrawerExample> {
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
void _openEndDrawer() {
diff --git a/examples/api/lib/material/scaffold/scaffold.of.0.dart b/examples/api/lib/material/scaffold/scaffold.of.0.dart
index 6b7ed66..88eb72f 100644
--- a/examples/api/lib/material/scaffold/scaffold.of.0.dart
+++ b/examples/api/lib/material/scaffold/scaffold.of.0.dart
@@ -2,20 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Scaffold.of].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Scaffold.of].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const OfExampleApp());
+
+class OfExampleApp extends StatelessWidget {
+ const OfExampleApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: 'Flutter Code Sample for Scaffold.of.',
theme: ThemeData(
primarySwatch: Colors.blue,
),
diff --git a/examples/api/lib/material/scaffold/scaffold.of.1.dart b/examples/api/lib/material/scaffold/scaffold.of.1.dart
index 7dee0f8..10fd675 100644
--- a/examples/api/lib/material/scaffold/scaffold.of.1.dart
+++ b/examples/api/lib/material/scaffold/scaffold.of.1.dart
@@ -2,28 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Scaffold.of].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Scaffold.of].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const OfExampleApp());
- static const String _title = 'Flutter Code Sample';
+class OfExampleApp extends StatelessWidget {
+ const OfExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: OfExample(),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class OfExample extends StatelessWidget {
+ const OfExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/scaffold/scaffold_messenger.0.dart b/examples/api/lib/material/scaffold/scaffold_messenger.0.dart
index bf52cc6..2e003a0 100644
--- a/examples/api/lib/material/scaffold/scaffold_messenger.0.dart
+++ b/examples/api/lib/material/scaffold/scaffold_messenger.0.dart
@@ -2,33 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ScaffoldMessenger].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [ScaffoldMessenger].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ScaffoldMessengerExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ScaffoldMessengerExampleApp extends StatelessWidget {
+ const ScaffoldMessengerExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('ScaffoldMessenger Sample')),
body: const Center(
- child: MyStatelessWidget(),
+ child: ScaffoldMessengerExample(),
),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class ScaffoldMessengerExample extends StatelessWidget {
+ const ScaffoldMessengerExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/scaffold/scaffold_messenger.of.0.dart b/examples/api/lib/material/scaffold/scaffold_messenger.of.0.dart
index 5164442..7c951f1 100644
--- a/examples/api/lib/material/scaffold/scaffold_messenger.of.0.dart
+++ b/examples/api/lib/material/scaffold/scaffold_messenger.of.0.dart
@@ -2,33 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ScaffoldMessenger.of].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [ScaffoldMessenger.of].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const OfExampleApp());
- static const String _title = 'Flutter Code Sample';
+class OfExampleApp extends StatelessWidget {
+ const OfExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('ScaffoldMessenger.of Sample')),
body: const Center(
- child: MyStatelessWidget(),
+ child: OfExample(),
),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class OfExample extends StatelessWidget {
+ const OfExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/scaffold/scaffold_messenger.of.1.dart b/examples/api/lib/material/scaffold/scaffold_messenger.of.1.dart
index bcd59be..f0b04db 100644
--- a/examples/api/lib/material/scaffold/scaffold_messenger.of.1.dart
+++ b/examples/api/lib/material/scaffold/scaffold_messenger.of.1.dart
@@ -2,22 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ScaffoldMessenger.of].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [ScaffoldMessenger.of].
-class MyApp extends StatefulWidget {
- const MyApp({super.key});
+void main() => runApp(const OfExampleApp());
+
+class OfExampleApp extends StatefulWidget {
+ const OfExampleApp({super.key});
@override
- State<MyApp> createState() => _MyAppState();
+ State<OfExampleApp> createState() => _OfExampleAppState();
}
-class _MyAppState extends State<MyApp> {
- final GlobalKey<ScaffoldMessengerState> _scaffoldMessengerKey =
- GlobalKey<ScaffoldMessengerState>();
+class _OfExampleAppState extends State<OfExampleApp> {
+ final GlobalKey<ScaffoldMessengerState> _scaffoldMessengerKey = GlobalKey<ScaffoldMessengerState>();
int _counter = 0;
void _incrementCounter() {
diff --git a/examples/api/lib/material/scaffold/scaffold_messenger_state.show_material_banner.0.dart b/examples/api/lib/material/scaffold/scaffold_messenger_state.show_material_banner.0.dart
index dd801d4..e98de5d 100644
--- a/examples/api/lib/material/scaffold/scaffold_messenger_state.show_material_banner.0.dart
+++ b/examples/api/lib/material/scaffold/scaffold_messenger_state.show_material_banner.0.dart
@@ -2,33 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ScaffoldMessengerState.showMaterialBanner].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [ScaffoldMessengerState.showMaterialBanner].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ShowMaterialBannerExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ShowMaterialBannerExampleApp extends StatelessWidget {
+ const ShowMaterialBannerExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('ScaffoldMessengerState Sample')),
body: const Center(
- child: MyStatelessWidget(),
+ child: ShowMaterialBannerExample(),
),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class ShowMaterialBannerExample extends StatelessWidget {
+ const ShowMaterialBannerExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.0.dart b/examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.0.dart
index b522c4b..2f98624 100644
--- a/examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.0.dart
+++ b/examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.0.dart
@@ -2,33 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ScaffoldMessengerState.showSnackBar].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [ScaffoldMessengerState.showSnackBar].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ShowSnackBarExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ShowSnackBarExampleApp extends StatelessWidget {
+ const ShowSnackBarExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('ScaffoldMessengerState Sample')),
body: const Center(
- child: MyStatelessWidget(),
+ child: ShowSnackBarExample(),
),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class ShowSnackBarExample extends StatelessWidget {
+ const ShowSnackBarExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.1.dart b/examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.1.dart
index e242a68..2f4229f 100644
--- a/examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.1.dart
+++ b/examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SnackBar].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [SnackBar].
+
void main() => runApp(const SnackBarApp());
class SnackBarApp extends StatelessWidget {
diff --git a/examples/api/lib/material/scaffold/scaffold_state.show_bottom_sheet.0.dart b/examples/api/lib/material/scaffold/scaffold_state.show_bottom_sheet.0.dart
index f77f609..c84cd0e 100644
--- a/examples/api/lib/material/scaffold/scaffold_state.show_bottom_sheet.0.dart
+++ b/examples/api/lib/material/scaffold/scaffold_state.show_bottom_sheet.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ScaffoldState.showBottomSheet].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [ScaffoldState.showBottomSheet].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ShowBottomSheetExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ShowBottomSheetExampleApp extends StatelessWidget {
+ const ShowBottomSheetExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('ScaffoldState Sample')),
+ body: const ShowBottomSheetExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class ShowBottomSheetExample extends StatelessWidget {
+ const ShowBottomSheetExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/scaffold/scaffold_state.show_snack_bar.0.dart b/examples/api/lib/material/scaffold/scaffold_state.show_snack_bar.0.dart
index d3cc78d..0f07798 100644
--- a/examples/api/lib/material/scaffold/scaffold_state.show_snack_bar.0.dart
+++ b/examples/api/lib/material/scaffold/scaffold_state.show_snack_bar.0.dart
@@ -2,33 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ScaffoldState.showSnackBar].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [ScaffoldState.showSnackBar].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ShowSnackBarExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ShowSnackBarExampleApp extends StatelessWidget {
+ const ShowSnackBarExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('ScaffoldState Sample')),
body: const Center(
- child: MyStatelessWidget(),
+ child: ShowSnackBarExample(),
),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class ShowSnackBarExample extends StatelessWidget {
+ const ShowSnackBarExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/scrollbar/scrollbar.0.dart b/examples/api/lib/material/scrollbar/scrollbar.0.dart
index 0ba5d0e..d8a0948 100644
--- a/examples/api/lib/material/scrollbar/scrollbar.0.dart
+++ b/examples/api/lib/material/scrollbar/scrollbar.0.dart
@@ -2,39 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Scrollbar].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Scrollbar].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ScrollbarExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ScrollbarExampleApp extends StatelessWidget {
+ const ScrollbarExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('Scrollbar Sample')),
+ body: const ScrollbarExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class ScrollbarExample extends StatelessWidget {
+ const ScrollbarExample({super.key});
@override
Widget build(BuildContext context) {
return Scrollbar(
child: GridView.builder(
itemCount: 120,
- gridDelegate:
- const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
+ gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
itemBuilder: (BuildContext context, int index) {
return Center(
child: Text('item $index'),
diff --git a/examples/api/lib/material/scrollbar/scrollbar.1.dart b/examples/api/lib/material/scrollbar/scrollbar.1.dart
index 2b70362..52491ca 100644
--- a/examples/api/lib/material/scrollbar/scrollbar.1.dart
+++ b/examples/api/lib/material/scrollbar/scrollbar.1.dart
@@ -2,37 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Scrollbar].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Scrollbar].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ScrollbarExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ScrollbarExampleApp extends StatelessWidget {
+ const ScrollbarExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatefulWidget(),
+ appBar: AppBar(title: const Text('Scrollbar Sample')),
+ body: const ScrollbarExample(),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class ScrollbarExample extends StatefulWidget {
+ const ScrollbarExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<ScrollbarExample> createState() => _ScrollbarExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _ScrollbarExampleState extends State<ScrollbarExample> {
final ScrollController _controllerOne = ScrollController();
@override
@@ -43,8 +40,7 @@
child: GridView.builder(
controller: _controllerOne,
itemCount: 120,
- gridDelegate:
- const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
+ gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
itemBuilder: (BuildContext context, int index) {
return Center(
child: Text('item $index'),
diff --git a/examples/api/lib/material/search_anchor/search_anchor.0.dart b/examples/api/lib/material/search_anchor/search_anchor.0.dart
index 6512817..262befc 100644
--- a/examples/api/lib/material/search_anchor/search_anchor.0.dart
+++ b/examples/api/lib/material/search_anchor/search_anchor.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SearchAnchor.bar].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [SearchAnchor.bar].
+
void main() => runApp(const SearchBarApp());
class SearchBarApp extends StatefulWidget {
@@ -20,32 +20,40 @@
List<ColorLabel> searchHistory = <ColorLabel>[];
Iterable<Widget> getHistoryList(SearchController controller) {
- return searchHistory.map((ColorLabel color) => ListTile(
- leading: const Icon(Icons.history),
- title: Text(color.label),
- trailing: IconButton(icon: const Icon(Icons.call_missed), onPressed: () {
- controller.text = color.label;
- controller.selection = TextSelection.collapsed(offset: controller.text.length);
- }),
- ));
+ return searchHistory.map(
+ (ColorLabel color) => ListTile(
+ leading: const Icon(Icons.history),
+ title: Text(color.label),
+ trailing: IconButton(
+ icon: const Icon(Icons.call_missed),
+ onPressed: () {
+ controller.text = color.label;
+ controller.selection = TextSelection.collapsed(offset: controller.text.length);
+ },
+ ),
+ ),
+ );
}
Iterable<Widget> getSuggestions(SearchController controller) {
final String input = controller.value.text;
- return ColorLabel.values.where((ColorLabel color) => color.label.contains(input))
- .map((ColorLabel filteredColor) =>
- ListTile(
- leading: CircleAvatar(backgroundColor: filteredColor.color),
- title: Text(filteredColor.label),
- trailing: IconButton(icon: const Icon(Icons.call_missed), onPressed: () {
- controller.text = filteredColor.label;
- controller.selection = TextSelection.collapsed(offset: controller.text.length);
- }),
- onTap: () {
- controller.closeView(filteredColor.label);
- handleSelection(filteredColor);
- },
- ));
+ return ColorLabel.values.where((ColorLabel color) => color.label.contains(input)).map(
+ (ColorLabel filteredColor) => ListTile(
+ leading: CircleAvatar(backgroundColor: filteredColor.color),
+ title: Text(filteredColor.label),
+ trailing: IconButton(
+ icon: const Icon(Icons.call_missed),
+ onPressed: () {
+ controller.text = filteredColor.label;
+ controller.selection = TextSelection.collapsed(offset: controller.text.length);
+ },
+ ),
+ onTap: () {
+ controller.closeView(filteredColor.label);
+ handleSelection(filteredColor);
+ },
+ ),
+ );
}
void handleSelection(ColorLabel selectedColor) {
@@ -78,7 +86,7 @@
if (searchHistory.isNotEmpty) {
return getHistoryList(controller);
}
- return <Widget>[ Center(child: Text('No search history.', style: TextStyle(color: colors.outline))) ];
+ return <Widget>[Center(child: Text('No search history.', style: TextStyle(color: colors.outline)))];
}
return getSuggestions(controller);
},
@@ -98,7 +106,10 @@
}
}
-SizedBox cardSize = const SizedBox(width: 80, height: 30,);
+SizedBox cardSize = const SizedBox(
+ width: 80,
+ height: 30,
+);
enum ColorLabel {
red('red', Colors.red),
diff --git a/examples/api/lib/material/search_anchor/search_anchor.1.dart b/examples/api/lib/material/search_anchor/search_anchor.1.dart
index 977c3db..aaf0040 100644
--- a/examples/api/lib/material/search_anchor/search_anchor.1.dart
+++ b/examples/api/lib/material/search_anchor/search_anchor.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for pinned [SearchAnchor] while scrolling.
-
import 'package:flutter/material.dart';
+/// Flutter code sample for pinned [SearchAnchor] while scrolling.
+
void main() {
runApp(const PinnedSearchBarApp());
}
@@ -21,10 +21,7 @@
@override
Widget build(BuildContext context) {
return MaterialApp(
- theme: ThemeData(
- useMaterial3: true,
- colorSchemeSeed: const Color(0xff6750a4)
- ),
+ theme: ThemeData(useMaterial3: true, colorSchemeSeed: const Color(0xff6750a4)),
home: Scaffold(
body: SafeArea(
child: CustomScrollView(
@@ -38,13 +35,16 @@
floating: true, // We can also uncomment this line and set `pinned` to true to see a pinned search bar.
title: SearchAnchor.bar(
suggestionsBuilder: (BuildContext context, SearchController controller) {
- return List<Widget>.generate(5, (int index) {
- return ListTile(
- titleAlignment: ListTileTitleAlignment.center,
- title: Text('Initial list item $index'),
- );
- });
- }
+ return List<Widget>.generate(
+ 5,
+ (int index) {
+ return ListTile(
+ titleAlignment: ListTileTitleAlignment.center,
+ title: Text('Initial list item $index'),
+ );
+ },
+ );
+ },
),
),
// The listed items below are just for filling the screen
diff --git a/examples/api/lib/material/search_anchor/search_anchor.2.dart b/examples/api/lib/material/search_anchor/search_anchor.2.dart
index 69827c0..a5a2868 100644
--- a/examples/api/lib/material/search_anchor/search_anchor.2.dart
+++ b/examples/api/lib/material/search_anchor/search_anchor.2.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SearchAnchor].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [SearchAnchor].
+
void main() => runApp(const SearchBarApp());
class SearchBarApp extends StatefulWidget {
@@ -29,7 +29,7 @@
body: Column(
children: <Widget>[
SearchAnchor(
- searchController: controller,
+ searchController: controller,
builder: (BuildContext context, SearchController controller) {
return IconButton(
icon: const Icon(Icons.search),
@@ -50,12 +50,11 @@
},
);
});
- }
- ),
+ }),
Center(
child: controller.text.isEmpty
- ? const Text('No item selected')
- : Text('Selected item: ${controller.value.text}'),
+ ? const Text('No item selected')
+ : Text('Selected item: ${controller.value.text}'),
),
],
),
diff --git a/examples/api/lib/material/segmented_button/segmented_button.0.dart b/examples/api/lib/material/segmented_button/segmented_button.0.dart
index 97770dd..c9ea2dd 100644
--- a/examples/api/lib/material/segmented_button/segmented_button.0.dart
+++ b/examples/api/lib/material/segmented_button/segmented_button.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SegmentedButton].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [SegmentedButton].
+
void main() {
runApp(const SegmentedButtonApp());
}
@@ -47,7 +47,6 @@
}
class _SingleChoiceState extends State<SingleChoice> {
-
Calendar calendarView = Calendar.day;
@override
@@ -91,7 +90,10 @@
ButtonSegment<Sizes>(value: Sizes.extraSmall, label: Text('XS')),
ButtonSegment<Sizes>(value: Sizes.small, label: Text('S')),
ButtonSegment<Sizes>(value: Sizes.medium, label: Text('M')),
- ButtonSegment<Sizes>(value: Sizes.large, label: Text('L'),),
+ ButtonSegment<Sizes>(
+ value: Sizes.large,
+ label: Text('L'),
+ ),
ButtonSegment<Sizes>(value: Sizes.extraLarge, label: Text('XL')),
],
selected: selection,
diff --git a/examples/api/lib/material/selectable_region/selectable_region.0.dart b/examples/api/lib/material/selectable_region/selectable_region.0.dart
index bbb95f9..276cfd2 100644
--- a/examples/api/lib/material/selectable_region/selectable_region.0.dart
+++ b/examples/api/lib/material/selectable_region/selectable_region.0.dart
@@ -2,25 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SelectableRegion].
-
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SelectableRegion].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SelectableRegionExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SelectableRegionExampleApp extends StatelessWidget {
+ const SelectableRegionExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: SelectionArea(
child: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('SelectableRegion Sample')),
body: const Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@@ -86,8 +83,8 @@
_RenderSelectableAdapter(
Color selectionColor,
SelectionRegistrar registrar,
- ) : _selectionColor = selectionColor,
- _geometry = ValueNotifier<SelectionGeometry>(_noSelection) {
+ ) : _selectionColor = selectionColor,
+ _geometry = ValueNotifier<SelectionGeometry>(_noSelection) {
this.registrar = registrar;
_geometry.addListener(markNeedsPaint);
}
@@ -121,12 +118,7 @@
// Adjust this value to enlarge or shrink the selection highlight.
static const double _padding = 10.0;
Rect _getSelectionHighlightRect() {
- return Rect.fromLTWH(
- 0 - _padding,
- 0 - _padding,
- size.width + _padding * 2,
- size.height + _padding * 2
- );
+ return Rect.fromLTWH(0 - _padding, 0 - _padding, size.width + _padding * 2, size.height + _padding * 2);
}
Offset? _start;
@@ -222,7 +214,7 @@
final double horizontalBaseLine = globalToLocal(Offset(event.dx, 0)).dx;
final Offset newOffset;
final bool forward;
- switch(extendSelectionEvent.direction) {
+ switch (extendSelectionEvent.direction) {
case SelectionExtendDirection.backward:
case SelectionExtendDirection.previousLine:
forward = false;
@@ -244,7 +236,8 @@
_start = _end = Offset.zero;
}
// Move the corresponding selection edge.
- if (extendSelectionEvent.direction == SelectionExtendDirection.nextLine || horizontalBaseLine > size.width) {
+ if (extendSelectionEvent.direction == SelectionExtendDirection.nextLine ||
+ horizontalBaseLine > size.width) {
newOffset = Offset.infinite;
} else {
newOffset = Offset.zero;
@@ -305,7 +298,7 @@
link: _startHandle!,
offset: offset + value.startSelectionPoint!.localPosition,
),
- (PaintingContext context, Offset offset) { },
+ (PaintingContext context, Offset offset) {},
Offset.zero,
);
}
@@ -315,7 +308,7 @@
link: _endHandle!,
offset: offset + value.endSelectionPoint!.localPosition,
),
- (PaintingContext context, Offset offset) { },
+ (PaintingContext context, Offset offset) {},
Offset.zero,
);
}
diff --git a/examples/api/lib/material/selection_area/selection_area.0.dart b/examples/api/lib/material/selection_area/selection_area.0.dart
index 3f538d7..69f6e73 100644
--- a/examples/api/lib/material/selection_area/selection_area.0.dart
+++ b/examples/api/lib/material/selection_area/selection_area.0.dart
@@ -2,24 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SelectionArea].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SelectionArea].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SelectionAreaExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SelectionAreaExampleApp extends StatelessWidget {
+ const SelectionAreaExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: SelectionArea(
child: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('SelectionArea Sample')),
body: const Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
diff --git a/examples/api/lib/material/selection_container/selection_container.0.dart b/examples/api/lib/material/selection_container/selection_container.0.dart
index cd8a503..a4f52b3 100644
--- a/examples/api/lib/material/selection_container/selection_container.0.dart
+++ b/examples/api/lib/material/selection_container/selection_container.0.dart
@@ -2,25 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SelectionContainer].
-
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SelectionContainer].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SelectionContainerExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SelectionContainerExampleApp extends StatelessWidget {
+ const SelectionContainerExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: SelectionArea(
child: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('SelectionContainer Sample')),
body: const Center(
child: SelectionAllOrNoneContainer(
child: Column(
@@ -40,10 +37,7 @@
}
class SelectionAllOrNoneContainer extends StatefulWidget {
- const SelectionAllOrNoneContainer({
- super.key,
- required this.child
- });
+ const SelectionAllOrNoneContainer({super.key, required this.child});
final Widget child;
diff --git a/examples/api/lib/material/selection_container/selection_container_disabled.0.dart b/examples/api/lib/material/selection_container/selection_container_disabled.0.dart
index 8dd160d..79aa1d7 100644
--- a/examples/api/lib/material/selection_container/selection_container_disabled.0.dart
+++ b/examples/api/lib/material/selection_container/selection_container_disabled.0.dart
@@ -6,19 +6,16 @@
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+void main() => runApp(const SelectionContainerDisabledExampleApp());
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
-
- static const String _title = 'Flutter Code Sample';
+class SelectionContainerDisabledExampleApp extends StatelessWidget {
+ const SelectionContainerDisabledExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('SelectionContainer.disabled Sample')),
body: const Center(
child: SelectionArea(
child: Column(
diff --git a/examples/api/lib/material/slider/slider.0.dart b/examples/api/lib/material/slider/slider.0.dart
index cbbe332..f73efb8 100644
--- a/examples/api/lib/material/slider/slider.0.dart
+++ b/examples/api/lib/material/slider/slider.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Slider].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Slider].
+
void main() => runApp(const SliderApp());
class SliderApp extends StatelessWidget {
diff --git a/examples/api/lib/material/slider/slider.1.dart b/examples/api/lib/material/slider/slider.1.dart
index 1d9a312..f5c791f 100644
--- a/examples/api/lib/material/slider/slider.1.dart
+++ b/examples/api/lib/material/slider/slider.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Slider].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Slider].
+
void main() => runApp(const SliderApp());
class SliderApp extends StatelessWidget {
diff --git a/examples/api/lib/material/slider/slider.2.dart b/examples/api/lib/material/slider/slider.2.dart
index c6d5bdc..b571671 100644
--- a/examples/api/lib/material/slider/slider.2.dart
+++ b/examples/api/lib/material/slider/slider.2.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Slider].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Slider].
+
void main() => runApp(const SliderApp());
class SliderApp extends StatelessWidget {
diff --git a/examples/api/lib/material/snack_bar/snack_bar.0.dart b/examples/api/lib/material/snack_bar/snack_bar.0.dart
index edc2884..3736dc9 100644
--- a/examples/api/lib/material/snack_bar/snack_bar.0.dart
+++ b/examples/api/lib/material/snack_bar/snack_bar.0.dart
@@ -2,33 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SnackBar].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SnackBar].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SnackBarExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SnackBarExampleApp extends StatelessWidget {
+ const SnackBarExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('SnackBar Sample')),
body: const Center(
- child: MyStatelessWidget(),
+ child: SnackBarExample(),
),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class SnackBarExample extends StatelessWidget {
+ const SnackBarExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/snack_bar/snack_bar.1.dart b/examples/api/lib/material/snack_bar/snack_bar.1.dart
index 581db9b..2294e1d 100644
--- a/examples/api/lib/material/snack_bar/snack_bar.1.dart
+++ b/examples/api/lib/material/snack_bar/snack_bar.1.dart
@@ -2,33 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SnackBar].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SnackBar].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SnackBarExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SnackBarExampleApp extends StatelessWidget {
+ const SnackBarExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('SnackBar Sample')),
body: const Center(
- child: MyStatelessWidget(),
+ child: SnackBarExample(),
),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class SnackBarExample extends StatelessWidget {
+ const SnackBarExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/snack_bar/snack_bar.2.dart b/examples/api/lib/material/snack_bar/snack_bar.2.dart
index ba1ac5d..7a211be 100644
--- a/examples/api/lib/material/snack_bar/snack_bar.2.dart
+++ b/examples/api/lib/material/snack_bar/snack_bar.2.dart
@@ -2,26 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SnackBar] with Material 3 specifications.
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SnackBar] with Material 3 specifications.
+
+void main() => runApp(const SnackBarExampleApp());
// A Material 3 [SnackBar] demonstrating an optional icon, in either floating
// or fixed format.
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
-
- static const String _title = 'Flutter Code Sample';
+class SnackBarExampleApp extends StatelessWidget {
+ const SnackBarExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
theme: ThemeData(useMaterial3: true),
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('SnackBar Sample')),
body: const Center(
child: SnackBarExample(),
),
@@ -46,119 +43,122 @@
double _sliderValue = 0.25;
Padding _padRow(List<Widget> children) => Padding(
- padding: const EdgeInsets.all(8.0),
- child: Row(children: children),
- );
+ padding: const EdgeInsets.all(8.0),
+ child: Row(children: children),
+ );
@override
Widget build(BuildContext context) {
- return Padding(padding: const EdgeInsets.only(left: 50.0), child: Column(
- children: <Widget>[
- _padRow(<Widget>[
- Text('Snack Bar configuration',
- style: Theme.of(context).textTheme.bodyLarge),
- ]),
- _padRow(
- <Widget>[
- const Text('Fixed'),
- Radio<SnackBarBehavior>(
- value: SnackBarBehavior.fixed,
- groupValue: _snackBarBehavior,
- onChanged: (SnackBarBehavior? value) {
- setState(() {
- _snackBarBehavior = value;
- });
- },
- ),
- const Text('Floating'),
- Radio<SnackBarBehavior>(
- value: SnackBarBehavior.floating,
- groupValue: _snackBarBehavior,
- onChanged: (SnackBarBehavior? value) {
- setState(() {
- _snackBarBehavior = value;
- });
- },
- ),
- ],
- ),
- _padRow(
- <Widget>[
- const Text('Include Icon '),
- Switch(
- value: _withIcon,
- onChanged: (bool value) {
- setState(() {
- _withIcon = !_withIcon;
- });
- },
- ),
- ],
- ),
- _padRow(
- <Widget>[
- const Text('Include Action '),
- Switch(
- value: _withAction,
- onChanged: (bool value) {
- setState(() {
- _withAction = !_withAction;
- });
- },
- ),
- const SizedBox(width: 16.0),
- const Text('Long Action Label '),
- Switch(
- value: _longActionLabel,
- onChanged: !_withAction
- ? null
- : (bool value) {
- setState(() {
- _longActionLabel = !_longActionLabel;
- });
- },
- ),
- ],
- ),
- _padRow(
- <Widget>[
- const Text('Multi Line Text'),
- Switch(
- value: _multiLine,
- onChanged: _snackBarBehavior == SnackBarBehavior.fixed ? null : (bool value) {
- setState(() {
- _multiLine = !_multiLine;
- });
- },
- ),
- ],
- ),
- _padRow(
- <Widget>[
+ return Padding(
+ padding: const EdgeInsets.only(left: 50.0),
+ child: Column(
+ children: <Widget>[
+ _padRow(<Widget>[
+ Text('Snack Bar configuration', style: Theme.of(context).textTheme.bodyLarge),
+ ]),
+ _padRow(
+ <Widget>[
+ const Text('Fixed'),
+ Radio<SnackBarBehavior>(
+ value: SnackBarBehavior.fixed,
+ groupValue: _snackBarBehavior,
+ onChanged: (SnackBarBehavior? value) {
+ setState(() {
+ _snackBarBehavior = value;
+ });
+ },
+ ),
+ const Text('Floating'),
+ Radio<SnackBarBehavior>(
+ value: SnackBarBehavior.floating,
+ groupValue: _snackBarBehavior,
+ onChanged: (SnackBarBehavior? value) {
+ setState(() {
+ _snackBarBehavior = value;
+ });
+ },
+ ),
+ ],
+ ),
+ _padRow(
+ <Widget>[
+ const Text('Include Icon '),
+ Switch(
+ value: _withIcon,
+ onChanged: (bool value) {
+ setState(() {
+ _withIcon = !_withIcon;
+ });
+ },
+ ),
+ ],
+ ),
+ _padRow(
+ <Widget>[
+ const Text('Include Action '),
+ Switch(
+ value: _withAction,
+ onChanged: (bool value) {
+ setState(() {
+ _withAction = !_withAction;
+ });
+ },
+ ),
+ const SizedBox(width: 16.0),
+ const Text('Long Action Label '),
+ Switch(
+ value: _longActionLabel,
+ onChanged: !_withAction
+ ? null
+ : (bool value) {
+ setState(() {
+ _longActionLabel = !_longActionLabel;
+ });
+ },
+ ),
+ ],
+ ),
+ _padRow(
+ <Widget>[
+ const Text('Multi Line Text'),
+ Switch(
+ value: _multiLine,
+ onChanged: _snackBarBehavior == SnackBarBehavior.fixed
+ ? null
+ : (bool value) {
+ setState(() {
+ _multiLine = !_multiLine;
+ });
+ },
+ ),
+ ],
+ ),
+ _padRow(<Widget>[
const Text('Action new-line overflow threshold'),
Slider(
value: _sliderValue,
divisions: 20,
label: _sliderValue.toStringAsFixed(2),
- onChanged: _snackBarBehavior == SnackBarBehavior.fixed ? null : (double value) {
- setState(() {
- _sliderValue = value;
- });
- },
+ onChanged: _snackBarBehavior == SnackBarBehavior.fixed
+ ? null
+ : (double value) {
+ setState(() {
+ _sliderValue = value;
+ });
+ },
),
- ]
- ),
- const SizedBox(height: 16.0),
- ElevatedButton(
- child: const Text('Show Snackbar'),
- onPressed: () {
- ScaffoldMessenger.of(context).showSnackBar(_snackBar());
- }
- ),
- ],
- ),
- );
-}
+ ]),
+ const SizedBox(height: 16.0),
+ ElevatedButton(
+ child: const Text('Show Snackbar'),
+ onPressed: () {
+ ScaffoldMessenger.of(context).showSnackBar(_snackBar());
+ },
+ ),
+ ],
+ ),
+ );
+ }
SnackBar _snackBar() {
final SnackBarAction? action = _withAction
@@ -169,11 +169,9 @@
},
)
: null;
- final double? width =
- _snackBarBehavior == SnackBarBehavior.floating && _multiLine ? 400.0 : null;
- final String label = _multiLine
- ? 'A Snack Bar with quite a lot of text which spans across multiple lines'
- : 'Single Line Snack Bar';
+ final double? width = _snackBarBehavior == SnackBarBehavior.floating && _multiLine ? 400.0 : null;
+ final String label =
+ _multiLine ? 'A Snack Bar with quite a lot of text which spans across multiple lines' : 'Single Line Snack Bar';
return SnackBar(
content: Text(label),
showCloseIcon: _withIcon,
diff --git a/examples/api/lib/material/stepper/stepper.0.dart b/examples/api/lib/material/stepper/stepper.0.dart
index d16f32a..b8b15d6 100644
--- a/examples/api/lib/material/stepper/stepper.0.dart
+++ b/examples/api/lib/material/stepper/stepper.0.dart
@@ -2,39 +2,36 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Stepper].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Stepper].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const StepperExampleApp());
- static const String _title = 'Flutter Code Sample';
+class StepperExampleApp extends StatelessWidget {
+ const StepperExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('Stepper Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: StepperExample(),
),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class StepperExample extends StatefulWidget {
+ const StepperExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<StepperExample> createState() => _StepperExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _StepperExampleState extends State<StepperExample> {
int _index = 0;
@override
@@ -64,8 +61,9 @@
Step(
title: const Text('Step 1 title'),
content: Container(
- alignment: Alignment.centerLeft,
- child: const Text('Content for Step 1')),
+ alignment: Alignment.centerLeft,
+ child: const Text('Content for Step 1'),
+ ),
),
const Step(
title: Text('Step 2 title'),
diff --git a/examples/api/lib/material/stepper/stepper.controls_builder.0.dart b/examples/api/lib/material/stepper/stepper.controls_builder.0.dart
index 05afa69..069e2c1 100644
--- a/examples/api/lib/material/stepper/stepper.controls_builder.0.dart
+++ b/examples/api/lib/material/stepper/stepper.controls_builder.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Stepper.controlsBuilder].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Stepper.controlsBuilder].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ControlsBuilderExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ControlsBuilderExampleApp extends StatelessWidget {
+ const ControlsBuilderExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('Stepper Sample')),
+ body: const ControlsBuilderExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class ControlsBuilderExample extends StatelessWidget {
+ const ControlsBuilderExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/switch/switch.0.dart b/examples/api/lib/material/switch/switch.0.dart
index 8fe620b..9a92dd3 100644
--- a/examples/api/lib/material/switch/switch.0.dart
+++ b/examples/api/lib/material/switch/switch.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Switch].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Switch].
+
void main() => runApp(const SwitchApp());
class SwitchApp extends StatelessWidget {
diff --git a/examples/api/lib/material/switch/switch.1.dart b/examples/api/lib/material/switch/switch.1.dart
index 59d28f4..0fbe72d 100644
--- a/examples/api/lib/material/switch/switch.1.dart
+++ b/examples/api/lib/material/switch/switch.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Switch].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Switch].
+
void main() => runApp(const SwitchApp());
class SwitchApp extends StatelessWidget {
diff --git a/examples/api/lib/material/switch/switch.2.dart b/examples/api/lib/material/switch/switch.2.dart
index 08fbf99..8c47d52 100644
--- a/examples/api/lib/material/switch/switch.2.dart
+++ b/examples/api/lib/material/switch/switch.2.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Switch].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Switch].
+
void main() => runApp(const SwitchApp());
class SwitchApp extends StatelessWidget {
diff --git a/examples/api/lib/material/switch/switch.3.dart b/examples/api/lib/material/switch/switch.3.dart
index 3ed57f2..023c338 100644
--- a/examples/api/lib/material/switch/switch.3.dart
+++ b/examples/api/lib/material/switch/switch.3.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Switch].
-
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
+/// Flutter code sample for [Switch].
+
void main() => runApp(const SwitchApp());
class SwitchApp extends StatelessWidget {
diff --git a/examples/api/lib/material/switch_list_tile/custom_labeled_switch.0.dart b/examples/api/lib/material/switch_list_tile/custom_labeled_switch.0.dart
index 4ad4282..6b3d5ff 100644
--- a/examples/api/lib/material/switch_list_tile/custom_labeled_switch.0.dart
+++ b/examples/api/lib/material/switch_list_tile/custom_labeled_switch.0.dart
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for custom labeled switch.
-
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
+/// Flutter code sample for custom labeled switch.
+
void main() => runApp(const LabeledSwitchApp());
class LabeledSwitchApp extends StatelessWidget {
diff --git a/examples/api/lib/material/switch_list_tile/custom_labeled_switch.1.dart b/examples/api/lib/material/switch_list_tile/custom_labeled_switch.1.dart
index baa7ca9..3c33361 100644
--- a/examples/api/lib/material/switch_list_tile/custom_labeled_switch.1.dart
+++ b/examples/api/lib/material/switch_list_tile/custom_labeled_switch.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for custom labeled switch.
-
import 'package:flutter/material.dart';
+/// Flutter code sample for custom labeled switch.
+
void main() => runApp(const LabeledSwitchApp());
class LabeledSwitchApp extends StatelessWidget {
diff --git a/examples/api/lib/material/switch_list_tile/switch_list_tile.0.dart b/examples/api/lib/material/switch_list_tile/switch_list_tile.0.dart
index 7d2acb1..339b3a7 100644
--- a/examples/api/lib/material/switch_list_tile/switch_list_tile.0.dart
+++ b/examples/api/lib/material/switch_list_tile/switch_list_tile.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SwitchListTile].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [SwitchListTile].
+
void main() => runApp(const SwitchListTileApp());
class SwitchListTileApp extends StatelessWidget {
diff --git a/examples/api/lib/material/switch_list_tile/switch_list_tile.1.dart b/examples/api/lib/material/switch_list_tile/switch_list_tile.1.dart
index 0349987..4c5d55b 100644
--- a/examples/api/lib/material/switch_list_tile/switch_list_tile.1.dart
+++ b/examples/api/lib/material/switch_list_tile/switch_list_tile.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SwitchListTile].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [SwitchListTile].
+
void main() => runApp(const SwitchListTileApp());
class SwitchListTileApp extends StatelessWidget {
@@ -15,9 +15,7 @@
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(useMaterial3: true),
- home: Scaffold(
- appBar: AppBar(title: const Text('SwitchListTile Sample')),
- body: const SwitchListTileExample()),
+ home: Scaffold(appBar: AppBar(title: const Text('SwitchListTile Sample')), body: const SwitchListTileExample()),
);
}
}
@@ -58,7 +56,8 @@
});
},
title: const Text('Headline'),
- subtitle: const Text('Longer supporting text to demonstrate how the text wraps and the switch is centered vertically with the text.'),
+ subtitle: const Text(
+ 'Longer supporting text to demonstrate how the text wraps and the switch is centered vertically with the text.'),
),
const Divider(height: 0),
SwitchListTile(
@@ -69,7 +68,8 @@
});
},
title: const Text('Headline'),
- subtitle: const Text("Longer supporting text to demonstrate how the text wraps and how setting 'SwitchListTile.isThreeLine = true' aligns the switch to the top vertically with the text."),
+ subtitle: const Text(
+ "Longer supporting text to demonstrate how the text wraps and how setting 'SwitchListTile.isThreeLine = true' aligns the switch to the top vertically with the text."),
isThreeLine: true,
),
const Divider(height: 0),
diff --git a/examples/api/lib/material/tab_controller/tab_controller.1.dart b/examples/api/lib/material/tab_controller/tab_controller.1.dart
index cfee433..691980d 100644
--- a/examples/api/lib/material/tab_controller/tab_controller.1.dart
+++ b/examples/api/lib/material/tab_controller/tab_controller.1.dart
@@ -2,22 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [TabController].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [TabController].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const TabControllerExampleApp());
- static const String _title = 'Flutter Code Sample';
+class TabControllerExampleApp extends StatelessWidget {
+ const TabControllerExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: TabControllerExample(),
);
}
}
@@ -28,8 +25,8 @@
Tab(text: 'Second'),
];
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class TabControllerExample extends StatelessWidget {
+ const TabControllerExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/tabs/tab_bar.0.dart b/examples/api/lib/material/tabs/tab_bar.0.dart
index 68e899a..09d6dd6 100644
--- a/examples/api/lib/material/tabs/tab_bar.0.dart
+++ b/examples/api/lib/material/tabs/tab_bar.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [TabBar].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [TabBar].
+
void main() => runApp(const TabBarApp());
class TabBarApp extends StatelessWidget {
diff --git a/examples/api/lib/material/tabs/tab_bar.1.dart b/examples/api/lib/material/tabs/tab_bar.1.dart
index e9ea194..954742a 100644
--- a/examples/api/lib/material/tabs/tab_bar.1.dart
+++ b/examples/api/lib/material/tabs/tab_bar.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [TabBar].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [TabBar].
+
void main() => runApp(const TabBarApp());
class TabBarApp extends StatelessWidget {
diff --git a/examples/api/lib/material/tabs/tab_bar.2.dart b/examples/api/lib/material/tabs/tab_bar.2.dart
index dd39f73..d15eb4f 100644
--- a/examples/api/lib/material/tabs/tab_bar.2.dart
+++ b/examples/api/lib/material/tabs/tab_bar.2.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [TabBar].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [TabBar].
+
void main() => runApp(const TabBarApp());
class TabBarApp extends StatelessWidget {
diff --git a/examples/api/lib/material/text_button/text_button.0.dart b/examples/api/lib/material/text_button/text_button.0.dart
index d0a31e2..98fa6bc 100644
--- a/examples/api/lib/material/text_button/text_button.0.dart
+++ b/examples/api/lib/material/text_button/text_button.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [TextButton].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [TextButton].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const TextButtonExampleApp());
- static const String _title = 'Flutter Code Sample';
+class TextButtonExampleApp extends StatelessWidget {
+ const TextButtonExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('TextButton Sample')),
+ body: const TextButtonExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class TextButtonExample extends StatelessWidget {
+ const TextButtonExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/text_button/text_button.1.dart b/examples/api/lib/material/text_button/text_button.1.dart
index b33b6a1..f72630a 100644
--- a/examples/api/lib/material/text_button/text_button.1.dart
+++ b/examples/api/lib/material/text_button/text_button.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [TextButton].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [TextButton].
+
void main() {
runApp(const MaterialApp(home: Home()));
}
@@ -26,7 +26,6 @@
@override
State<SelectableButton> createState() => _SelectableButtonState();
-
}
class _SelectableButtonState extends State<SelectableButton> {
@@ -35,9 +34,7 @@
@override
void initState() {
super.initState();
- statesController = MaterialStatesController(<MaterialState>{
- if (widget.selected) MaterialState.selected
- });
+ statesController = MaterialStatesController(<MaterialState>{if (widget.selected) MaterialState.selected});
}
@override
@@ -60,7 +57,7 @@
}
class Home extends StatefulWidget {
- const Home({ super.key });
+ const Home({super.key});
@override
State<Home> createState() => _HomeState();
@@ -94,7 +91,9 @@
),
),
onPressed: () {
- setState(() { selected = !selected; });
+ setState(() {
+ selected = !selected;
+ });
},
child: const Text('toggle selected'),
),
diff --git a/examples/api/lib/material/text_field/text_field.0.dart b/examples/api/lib/material/text_field/text_field.0.dart
index 06b3bc9..87e5335 100644
--- a/examples/api/lib/material/text_field/text_field.0.dart
+++ b/examples/api/lib/material/text_field/text_field.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for TextField
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [TextField].
+
class ObscuredTextFieldSample extends StatelessWidget {
const ObscuredTextFieldSample({super.key});
@@ -24,8 +24,8 @@
}
}
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+class TextFieldExampleApp extends StatelessWidget {
+ const TextFieldExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
@@ -39,4 +39,4 @@
}
}
-void main() => runApp(const MyApp());
+void main() => runApp(const TextFieldExampleApp());
diff --git a/examples/api/lib/material/text_field/text_field.1.dart b/examples/api/lib/material/text_field/text_field.1.dart
index 2b09139..cf3bde3 100644
--- a/examples/api/lib/material/text_field/text_field.1.dart
+++ b/examples/api/lib/material/text_field/text_field.1.dart
@@ -2,34 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [TextField].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [TextField].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const TextFieldExampleApp());
- static const String _title = 'Flutter Code Sample';
+class TextFieldExampleApp extends StatelessWidget {
+ const TextFieldExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: TextFieldExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class TextFieldExample extends StatefulWidget {
+ const TextFieldExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<TextFieldExample> createState() => _TextFieldExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _TextFieldExampleState extends State<TextFieldExample> {
late TextEditingController _controller;
@override
@@ -56,8 +53,7 @@
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Thanks!'),
- content: Text(
- 'You typed "$value", which has length ${value.characters.length}.'),
+ content: Text('You typed "$value", which has length ${value.characters.length}.'),
actions: <Widget>[
TextButton(
onPressed: () {
diff --git a/examples/api/lib/material/text_field/text_field.2.dart b/examples/api/lib/material/text_field/text_field.2.dart
index f94f8a7..a00487f 100644
--- a/examples/api/lib/material/text_field/text_field.2.dart
+++ b/examples/api/lib/material/text_field/text_field.2.dart
@@ -2,11 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for Material Design 3 [TextField]s.
-
import 'package:flutter/material.dart';
-void main() { runApp(const TextFieldExamplesApp()); }
+/// Flutter code sample for Material Design 3 [TextField]s.
+
+void main() {
+ runApp(const TextFieldExamplesApp());
+}
class TextFieldExamplesApp extends StatelessWidget {
const TextFieldExamplesApp({super.key});
@@ -35,7 +37,7 @@
/// A filled [TextField] with default settings matching the spec:
/// https://m3.material.io/components/text-fields/specs#6d654d1d-262e-4697-858c-9a75e8e7c81d
class FilledTextFieldExample extends StatelessWidget {
- const FilledTextFieldExample({ super.key });
+ const FilledTextFieldExample({super.key});
@override
Widget build(BuildContext context) {
@@ -47,7 +49,7 @@
hintText: 'hint text',
helperText: 'supporting text',
filled: true,
- )
+ ),
);
}
}
@@ -57,7 +59,7 @@
/// A Outlined [TextField] with default settings matching the spec:
/// https://m3.material.io/components/text-fields/specs#68b00bd6-ab40-4b4f-93d9-ed1fbbc5d06e
class OutlinedTextFieldExample extends StatelessWidget {
- const OutlinedTextFieldExample({ super.key });
+ const OutlinedTextFieldExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/material/text_form_field/text_form_field.1.dart b/examples/api/lib/material/text_form_field/text_form_field.1.dart
index bdbb124..8ff9dfc 100644
--- a/examples/api/lib/material/text_form_field/text_form_field.1.dart
+++ b/examples/api/lib/material/text_form_field/text_form_field.1.dart
@@ -2,35 +2,32 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [TextFormField].
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [TextFormField].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const TextFormFieldExampleApp());
- static const String _title = 'Flutter Code Sample';
+class TextFormFieldExampleApp extends StatelessWidget {
+ const TextFormFieldExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: TextFormFieldExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class TextFormFieldExample extends StatefulWidget {
+ const TextFormFieldExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<TextFormFieldExample> createState() => _TextFormFieldExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _TextFormFieldExampleState extends State<TextFormFieldExample> {
@override
Widget build(BuildContext context) {
return Material(
diff --git a/examples/api/lib/material/theme/theme_extension.1.dart b/examples/api/lib/material/theme/theme_extension.1.dart
index 9cc0be8..d6b2f38 100644
--- a/examples/api/lib/material/theme/theme_extension.1.dart
+++ b/examples/api/lib/material/theme/theme_extension.1.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ThemeExtension].
-
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
+/// Flutter code sample for [ThemeExtension].
+
@immutable
class MyColors extends ThemeExtension<MyColors> {
const MyColors({
@@ -44,19 +44,17 @@
void main() {
// Slow down time to see lerping.
timeDilation = 5.0;
- runApp(const MyApp());
+ runApp(const ThemeExtensionExampleApp());
}
-class MyApp extends StatefulWidget {
- const MyApp({super.key});
-
- static const String _title = 'Flutter Code Sample';
+class ThemeExtensionExampleApp extends StatefulWidget {
+ const ThemeExtensionExampleApp({super.key});
@override
- State<MyApp> createState() => _MyAppState();
+ State<ThemeExtensionExampleApp> createState() => _ThemeExtensionExampleAppState();
}
-class _MyAppState extends State<MyApp> {
+class _ThemeExtensionExampleAppState extends State<ThemeExtensionExampleApp> {
bool isLightTheme = true;
void toggleTheme() {
@@ -66,7 +64,6 @@
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: MyApp._title,
theme: ThemeData.light().copyWith(
extensions: <ThemeExtension<dynamic>>[
const MyColors(
@@ -119,7 +116,7 @@
onPressed: toggleTheme,
),
],
- )
+ ),
),
);
}
diff --git a/examples/api/lib/material/time_picker/show_time_picker.0.dart b/examples/api/lib/material/time_picker/show_time_picker.0.dart
index aa30b42..6e7b9cf 100644
--- a/examples/api/lib/material/time_picker/show_time_picker.0.dart
+++ b/examples/api/lib/material/time_picker/show_time_picker.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [showTimePicker].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [showTimePicker].
+
void main() {
runApp(const ShowTimePickerApp());
}
diff --git a/examples/api/lib/material/toggle_buttons/toggle_buttons.0.dart b/examples/api/lib/material/toggle_buttons/toggle_buttons.0.dart
index 578ae48..e903fbb 100644
--- a/examples/api/lib/material/toggle_buttons/toggle_buttons.0.dart
+++ b/examples/api/lib/material/toggle_buttons/toggle_buttons.0.dart
@@ -2,21 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ToggleButtons].
-
import 'package:flutter/material.dart';
-const List<Widget> fruits = <Widget>[
- Text('Apple'),
- Text('Banana'),
- Text('Orange')
-];
+/// Flutter code sample for [ToggleButtons].
-const List<Widget> vegetables = <Widget>[
- Text('Tomatoes'),
- Text('Potatoes'),
- Text('Carrots')
-];
+const List<Widget> fruits = <Widget>[Text('Apple'), Text('Banana'), Text('Orange')];
+
+const List<Widget> vegetables = <Widget>[Text('Tomatoes'), Text('Potatoes'), Text('Carrots')];
const List<Widget> icons = <Widget>[
Icon(Icons.sunny),
@@ -24,18 +16,15 @@
Icon(Icons.ac_unit),
];
-void main() => runApp(const MyApp());
+void main() => runApp(const ToggleButtonsExampleApp());
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
-
- static const String _title = 'ToggleButtons Sample';
+class ToggleButtonsExampleApp extends StatelessWidget {
+ const ToggleButtonsExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: ToggleButtonsSample(title: _title),
+ home: ToggleButtonsSample(title: 'ToggleButtons Sample'),
);
}
}
@@ -101,8 +90,7 @@
onPressed: (int index) {
// All buttons are selectable.
setState(() {
- _selectedVegetables[index] =
- !_selectedVegetables[index];
+ _selectedVegetables[index] = !_selectedVegetables[index];
});
},
borderRadius: const BorderRadius.all(Radius.circular(8)),
diff --git a/examples/api/lib/material/tooltip/tooltip.0.dart b/examples/api/lib/material/tooltip/tooltip.0.dart
index 3da1cd8..80c717b 100644
--- a/examples/api/lib/material/tooltip/tooltip.0.dart
+++ b/examples/api/lib/material/tooltip/tooltip.0.dart
@@ -2,23 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Tooltip].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Tooltip].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const TooltipExampleApp());
- static const String _title = 'Tooltip Sample';
+class TooltipExampleApp extends StatelessWidget {
+ const TooltipExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('Tooltip Sample')),
body: const Center(
child: TooltipSample(),
),
diff --git a/examples/api/lib/material/tooltip/tooltip.1.dart b/examples/api/lib/material/tooltip/tooltip.1.dart
index 9e551a4..579851c 100644
--- a/examples/api/lib/material/tooltip/tooltip.1.dart
+++ b/examples/api/lib/material/tooltip/tooltip.1.dart
@@ -2,23 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Tooltip].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Tooltip].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const TooltipExampleApp());
- static const String _title = 'Tooltip Sample';
+class TooltipExampleApp extends StatelessWidget {
+ const TooltipExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('Tooltip Sample')),
body: const Center(
child: TooltipSample(),
),
@@ -36,8 +33,7 @@
message: 'I am a Tooltip',
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
- gradient:
- const LinearGradient(colors: <Color>[Colors.amber, Colors.red]),
+ gradient: const LinearGradient(colors: <Color>[Colors.amber, Colors.red]),
),
height: 50,
padding: const EdgeInsets.all(8.0),
diff --git a/examples/api/lib/material/tooltip/tooltip.2.dart b/examples/api/lib/material/tooltip/tooltip.2.dart
index 8fd5740..91ca0f4 100644
--- a/examples/api/lib/material/tooltip/tooltip.2.dart
+++ b/examples/api/lib/material/tooltip/tooltip.2.dart
@@ -2,23 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Tooltip].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Tooltip].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const TooltipExampleApp());
- static const String _title = 'Tooltip Sample';
+class TooltipExampleApp extends StatelessWidget {
+ const TooltipExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('Tooltip Sample')),
body: const Center(
child: TooltipSample(),
),
diff --git a/examples/api/lib/material/tooltip/tooltip.3.dart b/examples/api/lib/material/tooltip/tooltip.3.dart
index adad136..0062cf2 100644
--- a/examples/api/lib/material/tooltip/tooltip.3.dart
+++ b/examples/api/lib/material/tooltip/tooltip.3.dart
@@ -2,22 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Tooltip].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Tooltip].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const TooltipExampleApp());
- static const String _title = 'Tooltip Sample';
+class TooltipExampleApp extends StatelessWidget {
+ const TooltipExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: TooltipSample(title: _title),
+ home: TooltipSample(title: 'Tooltip Sample'),
);
}
}
diff --git a/examples/api/lib/painting/axis_direction/axis_direction.0.dart b/examples/api/lib/painting/axis_direction/axis_direction.0.dart
index 8a4e1f2..e48fd09 100644
--- a/examples/api/lib/painting/axis_direction/axis_direction.0.dart
+++ b/examples/api/lib/painting/axis_direction/axis_direction.0.dart
@@ -2,28 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AxisDirection]s.
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [AxisDirection]s.
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
const ExampleApp({super.key});
- static const String _title = 'Flutter Code Sample';
-
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
home: MyWidget(),
);
}
}
class MyWidget extends StatefulWidget {
- const MyWidget({ super.key });
+ const MyWidget({super.key});
@override
State<MyWidget> createState() => _MyWidgetState();
@@ -39,30 +36,30 @@
Widget _getArrows() {
final Widget arrow;
- switch(_axisDirection) {
+ switch (_axisDirection) {
case AxisDirection.up:
arrow = const Icon(Icons.arrow_upward_rounded);
return Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[ arrow, arrow ],
+ children: <Widget>[arrow, arrow],
);
case AxisDirection.down:
arrow = const Icon(Icons.arrow_downward_rounded);
return Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[ arrow, arrow ],
+ children: <Widget>[arrow, arrow],
);
case AxisDirection.left:
arrow = const Icon(Icons.arrow_back_rounded);
return Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[ arrow, arrow ],
+ children: <Widget>[arrow, arrow],
);
case AxisDirection.right:
arrow = const Icon(Icons.arrow_forward_rounded);
return Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[ arrow, arrow ],
+ children: <Widget>[arrow, arrow],
);
}
}
@@ -182,7 +179,7 @@
padding: const EdgeInsets.all(8.0),
child: child,
);
- }
+ },
),
],
),
diff --git a/examples/api/lib/painting/borders/border_side.stroke_align.0.dart b/examples/api/lib/painting/borders/border_side.stroke_align.0.dart
index 821a88f..1ba1140 100644
--- a/examples/api/lib/painting/borders/border_side.stroke_align.0.dart
+++ b/examples/api/lib/painting/borders/border_side.stroke_align.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [BorderSide.strokeAlign].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [BorderSide.strokeAlign].
+
void main() => runApp(const StrokeAlignApp());
class StrokeAlignApp extends StatelessWidget {
@@ -24,15 +24,13 @@
State<StrokeAlignExample> createState() => _StrokeAlignExampleState();
}
-class _StrokeAlignExampleState extends State<StrokeAlignExample>
- with TickerProviderStateMixin {
+class _StrokeAlignExampleState extends State<StrokeAlignExample> with TickerProviderStateMixin {
late final AnimationController animation;
@override
void initState() {
super.initState();
- animation =
- AnimationController(vsync: this, duration: const Duration(seconds: 1));
+ animation = AnimationController(vsync: this, duration: const Duration(seconds: 1));
animation.repeat(reverse: true);
animation.addListener(_markDirty);
}
diff --git a/examples/api/lib/painting/gradient/linear_gradient.0.dart b/examples/api/lib/painting/gradient/linear_gradient.0.dart
index 22afe76..503bdae 100644
--- a/examples/api/lib/painting/gradient/linear_gradient.0.dart
+++ b/examples/api/lib/painting/gradient/linear_gradient.0.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [LinearGradient].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [LinearGradient].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const LinearGradientExampleApp());
+
+class LinearGradientExampleApp extends StatelessWidget {
+ const LinearGradientExampleApp({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/painting/linear_border/linear_border.0.dart b/examples/api/lib/painting/linear_border/linear_border.0.dart
index 4ca28e3..991fa0f 100644
--- a/examples/api/lib/painting/linear_border/linear_border.0.dart
+++ b/examples/api/lib/painting/linear_border/linear_border.0.dart
@@ -4,7 +4,6 @@
// Examples of LinearBorder and LinearBorderEdge.
-
import 'package:flutter/material.dart';
void main() {
@@ -12,7 +11,7 @@
}
class ExampleApp extends StatelessWidget {
- const ExampleApp({ super.key });
+ const ExampleApp({super.key});
@override
Widget build(BuildContext context) {
@@ -27,7 +26,7 @@
}
class SampleCard extends StatelessWidget {
- const SampleCard({ super.key, required this.title, required this.subtitle, required this.children });
+ const SampleCard({super.key, required this.title, required this.subtitle, required this.children});
final String title;
final String subtitle;
@@ -51,7 +50,7 @@
const SizedBox(height: 16),
Row(
children: List<Widget>.generate(children.length * 2 - 1, (int index) {
- return index.isEven ? children[index ~/2] : const SizedBox(width: 16);
+ return index.isEven ? children[index ~/ 2] : const SizedBox(width: 16);
}),
),
],
@@ -62,7 +61,7 @@
}
class Home extends StatefulWidget {
- const Home({ super.key });
+ const Home({super.key});
@override
State<Home> createState() => _HomeState();
@@ -104,7 +103,7 @@
side: primarySide3,
shape: LinearBorder.bottom(),
),
- onPressed: () { },
+ onPressed: () {},
child: const Text('Text'),
),
OutlinedButton(
@@ -112,7 +111,7 @@
side: primarySide3,
shape: LinearBorder.bottom(),
),
- onPressed: () { },
+ onPressed: () {},
child: const Text('Outlined'),
),
ElevatedButton(
@@ -120,7 +119,7 @@
side: primarySide3,
shape: LinearBorder.bottom(),
),
- onPressed: () { },
+ onPressed: () {},
child: const Text('Elevated'),
),
],
@@ -140,7 +139,7 @@
side: primarySide0,
shape: LinearBorder.start(),
),
- onPressed: () { },
+ onPressed: () {},
child: const Text('Start()'),
),
TextButton(
@@ -148,7 +147,7 @@
side: primarySide0,
shape: LinearBorder.end(),
),
- onPressed: () { },
+ onPressed: () {},
child: const Text('End()'),
),
TextButton(
@@ -156,7 +155,7 @@
side: primarySide0,
shape: LinearBorder.top(),
),
- onPressed: () { },
+ onPressed: () {},
child: const Text('Top()'),
),
TextButton(
@@ -164,7 +163,7 @@
side: primarySide0,
shape: LinearBorder.bottom(),
),
- onPressed: () { },
+ onPressed: () {},
child: const Text('Bottom()'),
),
],
@@ -186,7 +185,7 @@
size: 0.5,
),
),
- onPressed: () { },
+ onPressed: () {},
child: const Text('Center'),
),
TextButton(
@@ -197,7 +196,7 @@
alignment: -1,
),
),
- onPressed: () { },
+ onPressed: () {},
child: const Text('Start'),
),
TextButton(
@@ -208,7 +207,7 @@
alignment: 1,
),
),
- onPressed: () { },
+ onPressed: () {},
child: const Text('End'),
),
],
@@ -229,7 +228,7 @@
bottom: LinearBorderEdge(),
),
),
- onPressed: () { },
+ onPressed: () {},
child: const Text('Horizontal'),
),
TextButton(
@@ -240,7 +239,7 @@
end: LinearBorderEdge(),
),
),
- onPressed: () { },
+ onPressed: () {},
child: const Text('Vertical'),
),
TextButton(
@@ -251,7 +250,7 @@
bottom: LinearBorderEdge(),
),
),
- onPressed: () { },
+ onPressed: () {},
child: const Text('Corner'),
),
],
@@ -276,20 +275,19 @@
side: primarySide3,
shape: shape,
),
- onPressed: () { },
+ onPressed: () {},
child: const Text('Press Play'),
),
TextButton(
style: ButtonStyle(
- side: MaterialStateProperty.resolveWith<BorderSide?>((Set <MaterialState> states) {
+ side: MaterialStateProperty.resolveWith<BorderSide?>((Set<MaterialState> states) {
return states.contains(MaterialState.hovered) ? primarySide3 : null;
}),
- shape: MaterialStateProperty.resolveWith<OutlinedBorder>((Set <MaterialState> states) {
+ shape: MaterialStateProperty.resolveWith<OutlinedBorder>((Set<MaterialState> states) {
return states.contains(MaterialState.hovered) ? shape0 : shape1;
}),
-
),
- onPressed: () { },
+ onPressed: () {},
child: const Text('Hover'),
),
],
diff --git a/examples/api/lib/rendering/growth_direction/growth_direction.0.dart b/examples/api/lib/rendering/growth_direction/growth_direction.0.dart
index b58c9fc..d5ca03e 100644
--- a/examples/api/lib/rendering/growth_direction/growth_direction.0.dart
+++ b/examples/api/lib/rendering/growth_direction/growth_direction.0.dart
@@ -2,29 +2,26 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [GrowthDirection]s.
-
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
+/// Flutter code sample for [GrowthDirection]s.
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
const ExampleApp({super.key});
- static const String _title = 'Flutter Code Sample';
-
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
home: MyWidget(),
);
}
}
class MyWidget extends StatefulWidget {
- const MyWidget({ super.key });
+ const MyWidget({super.key});
@override
State<MyWidget> createState() => _MyWidgetState();
@@ -41,30 +38,30 @@
Widget _getArrows(AxisDirection axisDirection) {
final Widget arrow;
- switch(axisDirection) {
+ switch (axisDirection) {
case AxisDirection.up:
arrow = const Icon(Icons.arrow_upward_rounded);
return Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[ arrow, arrow ],
+ children: <Widget>[arrow, arrow],
);
case AxisDirection.down:
arrow = const Icon(Icons.arrow_downward_rounded);
return Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[ arrow, arrow ],
+ children: <Widget>[arrow, arrow],
);
case AxisDirection.left:
arrow = const Icon(Icons.arrow_back_rounded);
return Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[ arrow, arrow ],
+ children: <Widget>[arrow, arrow],
);
case AxisDirection.right:
arrow = const Icon(Icons.arrow_forward_rounded);
return Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[ arrow, arrow ],
+ children: <Widget>[arrow, arrow],
);
}
}
@@ -91,11 +88,12 @@
_spacer,
Text(constraints.growthDirection.toString()),
_spacer,
- _getArrows(isForward
- ? _axisDirection
- // This method is available to conveniently flip an AxisDirection
- // into its opposite direction.
- : flipAxisDirection(_axisDirection),
+ _getArrows(
+ isForward
+ ? _axisDirection
+ // This method is available to conveniently flip an AxisDirection
+ // into its opposite direction.
+ : flipAxisDirection(_axisDirection),
),
],
),
@@ -149,7 +147,7 @@
);
}
- Widget _getList({ required bool isForward }) {
+ Widget _getList({required bool isForward}) {
// The SliverLayoutBuilder is not necessary, and is here to allow us to see
// the SliverConstraints & directional information that is provided to the
// SliverList when laying out.
@@ -164,8 +162,8 @@
} else {
child = Container(
color: isForward
- ? (index.isEven ? Colors.amber[100] : Colors.amberAccent)
- : (index.isEven ? Colors.green[100] : Colors.lightGreen),
+ ? (index.isEven ? Colors.amber[100] : Colors.amberAccent)
+ : (index.isEven ? Colors.green[100] : Colors.lightGreen),
padding: const EdgeInsets.all(8.0),
child: Center(child: Text(_alphabet[index - 1])),
);
diff --git a/examples/api/lib/rendering/scroll_direction/scroll_direction.0.dart b/examples/api/lib/rendering/scroll_direction/scroll_direction.0.dart
index 211157d..6eb3c9c 100644
--- a/examples/api/lib/rendering/scroll_direction/scroll_direction.0.dart
+++ b/examples/api/lib/rendering/scroll_direction/scroll_direction.0.dart
@@ -2,29 +2,26 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ScrollDirection].
-
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
+/// Flutter code sample for [ScrollDirection].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
const ExampleApp({super.key});
- static const String _title = 'Flutter Code Sample';
-
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
home: MyWidget(),
);
}
}
class MyWidget extends StatefulWidget {
- const MyWidget({ super.key });
+ const MyWidget({super.key});
@override
State<MyWidget> createState() => _MyWidgetState();
@@ -41,30 +38,30 @@
Widget _getArrows() {
final Widget arrow;
- switch(_axisDirection) {
+ switch (_axisDirection) {
case AxisDirection.up:
arrow = const Icon(Icons.arrow_upward_rounded);
return Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[ arrow, arrow ],
+ children: <Widget>[arrow, arrow],
);
case AxisDirection.down:
arrow = const Icon(Icons.arrow_downward_rounded);
return Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[ arrow, arrow ],
+ children: <Widget>[arrow, arrow],
);
case AxisDirection.left:
arrow = const Icon(Icons.arrow_back_rounded);
return Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[ arrow, arrow ],
+ children: <Widget>[arrow, arrow],
);
case AxisDirection.right:
arrow = const Icon(Icons.arrow_forward_rounded);
return Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[ arrow, arrow ],
+ children: <Widget>[arrow, arrow],
);
}
}
@@ -148,7 +145,7 @@
bool _handleNotification(UserScrollNotification notification) {
if (notification.direction != scrollDirection) {
- setState((){
+ setState(() {
scrollDirection = notification.direction;
});
}
@@ -197,7 +194,7 @@
padding: const EdgeInsets.all(8.0),
child: child,
);
- }
+ },
),
],
),
diff --git a/examples/api/lib/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.0.dart b/examples/api/lib/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.0.dart
index fec0c81..e35b2d9 100644
--- a/examples/api/lib/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.0.dart
+++ b/examples/api/lib/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SliverGridDelegateWithFixedCrossAxisCount].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SliverGridDelegateWithFixedCrossAxisCount].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SliverGridDelegateWithFixedCrossAxisCountExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SliverGridDelegateWithFixedCrossAxisCountExampleApp extends StatelessWidget {
+ const SliverGridDelegateWithFixedCrossAxisCountExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('SliverGridDelegateWithFixedCrossAxisCount Sample')),
+ body: const SliverGridDelegateWithFixedCrossAxisCountExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class SliverGridDelegateWithFixedCrossAxisCountExample extends StatelessWidget {
+ const SliverGridDelegateWithFixedCrossAxisCountExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.1.dart b/examples/api/lib/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.1.dart
index 4f460e8..399cc64 100644
--- a/examples/api/lib/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.1.dart
+++ b/examples/api/lib/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.1.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SliverGridDelegateWithFixedCrossAxisCount].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SliverGridDelegateWithFixedCrossAxisCount].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SliverGridDelegateWithFixedCrossAxisCountExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SliverGridDelegateWithFixedCrossAxisCountExampleApp extends StatelessWidget {
+ const SliverGridDelegateWithFixedCrossAxisCountExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('SliverGridDelegateWithFixedCrossAxisCount Sample')),
+ body: const SliverGridDelegateWithFixedCrossAxisCountExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class SliverGridDelegateWithFixedCrossAxisCountExample extends StatelessWidget {
+ const SliverGridDelegateWithFixedCrossAxisCountExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/sample_templates/cupertino.0.dart b/examples/api/lib/sample_templates/cupertino.0.dart
index e8b32cf..174ddfd 100644
--- a/examples/api/lib/sample_templates/cupertino.0.dart
+++ b/examples/api/lib/sample_templates/cupertino.0.dart
@@ -29,10 +29,10 @@
// is referenced more than once, link back to the instance the example file is
// named for.
-// Flutter code sample for [Placeholder].
-
import 'package:flutter/cupertino.dart';
+/// Flutter code sample for [Placeholder].
+
void main() {
runApp(const SampleApp());
}
diff --git a/examples/api/lib/sample_templates/material.0.dart b/examples/api/lib/sample_templates/material.0.dart
index 15a94a9..83252cf 100644
--- a/examples/api/lib/sample_templates/material.0.dart
+++ b/examples/api/lib/sample_templates/material.0.dart
@@ -29,10 +29,10 @@
// is referenced more than once, link back to the instance the example file is
// named for.
-// Flutter code sample for [Placeholder].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Placeholder].
+
void main() {
runApp(const SampleApp());
}
diff --git a/examples/api/lib/sample_templates/widgets.0.dart b/examples/api/lib/sample_templates/widgets.0.dart
index 6da96de..2bc5dd3 100644
--- a/examples/api/lib/sample_templates/widgets.0.dart
+++ b/examples/api/lib/sample_templates/widgets.0.dart
@@ -29,10 +29,10 @@
// is referenced more than once, link back to the instance the example file is
// named for.
-// Flutter code sample for [Placeholder].
-
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [Placeholder].
+
void main() {
runApp(const SampleApp());
}
diff --git a/examples/api/lib/services/keyboard_key/logical_keyboard_key.0.dart b/examples/api/lib/services/keyboard_key/logical_keyboard_key.0.dart
index 1cbd13c..3be60f2 100644
--- a/examples/api/lib/services/keyboard_key/logical_keyboard_key.0.dart
+++ b/examples/api/lib/services/keyboard_key/logical_keyboard_key.0.dart
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [LogicalKeyboardKey].
-
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
+/// Flutter code sample for [LogicalKeyboardKey].
+
void main() => runApp(const KeyExampleApp());
class KeyExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/services/keyboard_key/physical_keyboard_key.0.dart b/examples/api/lib/services/keyboard_key/physical_keyboard_key.0.dart
index 6d8f799..c5eaf1c 100644
--- a/examples/api/lib/services/keyboard_key/physical_keyboard_key.0.dart
+++ b/examples/api/lib/services/keyboard_key/physical_keyboard_key.0.dart
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [PhysicalKeyboardKey].
-
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
+/// Flutter code sample for [PhysicalKeyboardKey].
+
void main() => runApp(const KeyExampleApp());
class KeyExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/services/mouse_cursor/mouse_cursor.0.dart b/examples/api/lib/services/mouse_cursor/mouse_cursor.0.dart
index ba2d1ed..e5db8fe 100644
--- a/examples/api/lib/services/mouse_cursor/mouse_cursor.0.dart
+++ b/examples/api/lib/services/mouse_cursor/mouse_cursor.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [MouseCursor].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [MouseCursor].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const MouseCursorExampleApp());
- static const String _title = 'MouseCursor Code Sample';
+class MouseCursorExampleApp extends StatelessWidget {
+ const MouseCursorExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('MouseCursor Code Sample')),
+ body: const MouseCursorExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class MouseCursorExample extends StatelessWidget {
+ const MouseCursorExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.0.dart b/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.0.dart
index a146fce..4aaca41 100644
--- a/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.0.dart
+++ b/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.0.dart
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AppBar.systemOverlayStyle].
-
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
+/// Flutter code sample for [AppBar.systemOverlayStyle].
+
void main() => runApp(const SystemOverlayStyleApp());
class SystemOverlayStyleApp extends StatelessWidget {
diff --git a/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.1.dart b/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.1.dart
index c5eb2f7..6cb5fca 100644
--- a/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.1.dart
+++ b/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.1.dart
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for setting the [SystemUiOverlayStyle] with an [AnnotatedRegion].
-
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
+/// Flutter code sample for setting the [SystemUiOverlayStyle] with an [AnnotatedRegion].
+
void main() => runApp(const SystemOverlayStyleApp());
class SystemOverlayStyleApp extends StatelessWidget {
diff --git a/examples/api/lib/services/text_input/text_input_control.0.dart b/examples/api/lib/services/text_input/text_input_control.0.dart
index 112ba35..64c508d 100644
--- a/examples/api/lib/services/text_input/text_input_control.0.dart
+++ b/examples/api/lib/services/text_input/text_input_control.0.dart
@@ -2,33 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for TextInputControl
-
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [TextInputControl].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const TextInputControlExampleApp());
+
+class TextInputControlExampleApp extends StatelessWidget {
+ const TextInputControlExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- home: MyStatefulWidget(),
- );
+ home: TextInputControlExample(),
+ );
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class TextInputControlExample extends StatefulWidget {
+ const TextInputControlExample({super.key});
@override
MyStatefulWidgetState createState() => MyStatefulWidgetState();
}
-class MyStatefulWidgetState extends State<MyStatefulWidget> {
+class MyStatefulWidgetState extends State<TextInputControlExample> {
final TextEditingController _controller = TextEditingController();
final FocusNode _focusNode = FocusNode();
diff --git a/examples/api/lib/ui/text/font_feature.0.dart b/examples/api/lib/ui/text/font_feature.0.dart
index a24a86d..5ef2f86 100644
--- a/examples/api/lib/ui/text/font_feature.0.dart
+++ b/examples/api/lib/ui/text/font_feature.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature].
import 'dart:ui';
import 'package:flutter/material.dart';
+/// Flutter code sample for [FontFeature].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_alternative.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_alternative.0.dart
index 932e3cd..5207173 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_alternative.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_alternative.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.alternative].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.alternative].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_alternative_fractions.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_alternative_fractions.0.dart
index f59fb68..2ca48e2 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_alternative_fractions.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_alternative_fractions.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.alternativeFractions].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.alternativeFractions].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_case_sensitive_forms.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_case_sensitive_forms.0.dart
index 1d99d3d..52df814 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_case_sensitive_forms.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_case_sensitive_forms.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.caseSensitiveForms].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.caseSensitiveForms].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_character_variant.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_character_variant.0.dart
index ff8a2c0..f746d50 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_character_variant.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_character_variant.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.characterVariant].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.characterVariant].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_contextual_alternates.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_contextual_alternates.0.dart
index e237841..cd3654b 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_contextual_alternates.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_contextual_alternates.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.contextualAlternates].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.contextualAlternates].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_denominator.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_denominator.0.dart
index 0d01028..9097b25 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_denominator.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_denominator.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.denominator].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.denominator].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_fractions.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_fractions.0.dart
index 23aab95..01433db 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_fractions.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_fractions.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.fractions].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.fractions].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_historical_forms.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_historical_forms.0.dart
index e88262d..a821dcc 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_historical_forms.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_historical_forms.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.historicalForms].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.historicalForms].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_historical_ligatures.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_historical_ligatures.0.dart
index 5a689b3..039dbca 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_historical_ligatures.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_historical_ligatures.0.dart
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.historicalLigatures].
-
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.historicalLigatures].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_lining_figures.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_lining_figures.0.dart
index f225e86..8851510 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_lining_figures.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_lining_figures.0.dart
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.liningFigures].
-
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.liningFigures].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_locale_aware.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_locale_aware.0.dart
index 8ef16e5..ca34cd4 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_locale_aware.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_locale_aware.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.localeAware].
-
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.localeAware].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_notational_forms.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_notational_forms.0.dart
index d4f5aa3..562e5e0 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_notational_forms.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_notational_forms.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.notationalForms].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.notationalForms].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_numerators.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_numerators.0.dart
index b68128a..213bf8e 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_numerators.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_numerators.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.numerators].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.numerators].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_oldstyle_figures.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_oldstyle_figures.0.dart
index b9c13b2..7de9126 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_oldstyle_figures.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_oldstyle_figures.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.oldstyleFigures].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.oldstyleFigures].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_ordinal_forms.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_ordinal_forms.0.dart
index 87e6c5c..20b6720 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_ordinal_forms.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_ordinal_forms.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.ordinalForms].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.ordinalForms].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_proportional_figures.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_proportional_figures.0.dart
index 3e2721e..aaa15f5 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_proportional_figures.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_proportional_figures.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.proportionalFigures].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.proportionalFigures].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_scientific_inferiors.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_scientific_inferiors.0.dart
index 87a0209..b17115d 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_scientific_inferiors.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_scientific_inferiors.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.scientificInferiors].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.scientificInferiors].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_slashed_zero.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_slashed_zero.0.dart
index d023e05..105a1f4 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_slashed_zero.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_slashed_zero.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.slashedZero].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.slashedZero].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_stylistic_alternates.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_stylistic_alternates.0.dart
index c9b5333..b9f5e67 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_stylistic_alternates.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_stylistic_alternates.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.stylisticAlternates].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.stylisticAlternates].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_stylistic_set.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_stylistic_set.0.dart
index aca5674..812c559 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_stylistic_set.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_stylistic_set.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.stylisticSet].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.stylisticSet].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_stylistic_set.1.dart b/examples/api/lib/ui/text/font_feature.font_feature_stylistic_set.1.dart
index adcb2c5..a419bf3 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_stylistic_set.1.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_stylistic_set.1.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.stylisticSet].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.stylisticSet].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_subscripts.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_subscripts.0.dart
index 1687d06..ab1b612 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_subscripts.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_subscripts.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.subscripts].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.subscripts].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_superscripts.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_superscripts.0.dart
index 75a65f6..490955d 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_superscripts.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_superscripts.0.dart
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.superscripts].
-
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.superscripts].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_swash.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_swash.0.dart
index d39e9be..986981a 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_swash.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_swash.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FontFeature.FontFeature.swash].
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [FontFeature.FontFeature.swash].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/ui/text/font_feature.font_feature_tabular_figures.0.dart b/examples/api/lib/ui/text/font_feature.font_feature_tabular_figures.0.dart
index 13ea07a..c2055ca 100644
--- a/examples/api/lib/ui/text/font_feature.font_feature_tabular_figures.0.dart
+++ b/examples/api/lib/ui/text/font_feature.font_feature_tabular_figures.0.dart
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [dart]:ui FontFeature.FontFeature.tabularFigures.
import 'dart:ui';
import 'package:flutter/widgets.dart';
+/// Flutter code sample for [dart]:ui FontFeature.FontFeature.tabularFigures.
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
diff --git a/examples/api/lib/widgets/actions/action.action_overridable.0.dart b/examples/api/lib/widgets/actions/action.action_overridable.0.dart
index ec7a0b4..3304e0f 100644
--- a/examples/api/lib/widgets/actions/action.action_overridable.0.dart
+++ b/examples/api/lib/widgets/actions/action.action_overridable.0.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Action.Action.overridable].
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
+/// Flutter code sample for [Action.Action.overridable].
+
void main() {
runApp(
const MaterialApp(
@@ -18,12 +18,13 @@
}
const CopyTextIntent copyTextIntent = CopyTextIntent._();
+
class CopyTextIntent extends Intent {
const CopyTextIntent._();
}
class CopyableText extends StatelessWidget {
- const CopyableText({ super.key, required this.text });
+ const CopyableText({super.key, required this.text});
final String text;
@@ -33,9 +34,11 @@
Widget build(BuildContext context) {
final Action<CopyTextIntent> defaultCopyAction = CallbackAction<CopyTextIntent>(onInvoke: _copy);
return Shortcuts(
- shortcuts: const <ShortcutActivator, Intent> { SingleActivator(LogicalKeyboardKey.keyC, control: true) : copyTextIntent },
+ shortcuts: const <ShortcutActivator, Intent>{
+ SingleActivator(LogicalKeyboardKey.keyC, control: true): copyTextIntent
+ },
child: Actions(
- actions: <Type, Action<Intent>> {
+ actions: <Type, Action<Intent>>{
// The Action is made overridable so the VerificationCodeGenerator
// widget can override how copying is handled.
CopyTextIntent: Action<CopyTextIntent>.overridable(defaultAction: defaultCopyAction, context: context),
@@ -53,7 +56,7 @@
}
class VerificationCodeGenerator extends StatelessWidget {
- const VerificationCodeGenerator({ super.key });
+ const VerificationCodeGenerator({super.key});
void _copy(CopyTextIntent intent) {
debugPrint('Content copied');
@@ -63,7 +66,7 @@
@override
Widget build(BuildContext context) {
return Actions(
- actions: <Type, Action<Intent>> { CopyTextIntent: CallbackAction<CopyTextIntent>(onInvoke: _copy) },
+ actions: <Type, Action<Intent>>{CopyTextIntent: CallbackAction<CopyTextIntent>(onInvoke: _copy)},
child: const Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
@@ -73,9 +76,9 @@
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
CopyableText(text: '111'),
- SizedBox(width: 5,),
+ SizedBox(width: 5),
CopyableText(text: '222'),
- SizedBox(width: 5,),
+ SizedBox(width: 5),
CopyableText(text: '333'),
],
),
diff --git a/examples/api/lib/widgets/actions/action_listener.0.dart b/examples/api/lib/widgets/actions/action_listener.0.dart
index 98f7a15..d4866a6 100644
--- a/examples/api/lib/widgets/actions/action_listener.0.dart
+++ b/examples/api/lib/widgets/actions/action_listener.0.dart
@@ -2,25 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ActionListener].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [ActionListener].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ActionListenerExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ActionListenerExampleApp extends StatelessWidget {
+ const ActionListenerExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('ActionListener Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: ActionListenerExample(),
),
),
);
@@ -75,8 +72,7 @@
},
action: _myAction,
child: ElevatedButton(
- onPressed: () => const ActionDispatcher()
- .invokeAction(_myAction, const MyIntent()),
+ onPressed: () => const ActionDispatcher().invokeAction(_myAction, const MyIntent()),
child: const Text('Call Action Listener'),
),
),
@@ -109,17 +105,3 @@
class MyIntent extends Intent {
const MyIntent();
}
-
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
-
- @override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
-}
-
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
- @override
- Widget build(BuildContext context) {
- return const ActionListenerExample();
- }
-}
diff --git a/examples/api/lib/widgets/actions/actions.0.dart b/examples/api/lib/widgets/actions/actions.0.dart
index 8fbeaf1..e8f3366 100644
--- a/examples/api/lib/widgets/actions/actions.0.dart
+++ b/examples/api/lib/widgets/actions/actions.0.dart
@@ -2,25 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Actions].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Actions].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ActionsExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ActionsExampleApp extends StatelessWidget {
+ const ActionsExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('Actions Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: ActionsExample(),
),
),
);
@@ -116,14 +113,14 @@
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class ActionsExample extends StatefulWidget {
+ const ActionsExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<ActionsExample> createState() => _ActionsExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _ActionsExampleState extends State<ActionsExample> {
Model model = Model();
int count = 0;
@@ -154,8 +151,7 @@
builder: (BuildContext context, Widget? child) {
return Padding(
padding: const EdgeInsets.all(8.0),
- child: Text('${model.data.value}',
- style: Theme.of(context).textTheme.headlineMedium),
+ child: Text('${model.data.value}', style: Theme.of(context).textTheme.headlineMedium),
);
}),
IconButton(
diff --git a/examples/api/lib/widgets/actions/focusable_action_detector.0.dart b/examples/api/lib/widgets/actions/focusable_action_detector.0.dart
index 019d399..1043b0f 100644
--- a/examples/api/lib/widgets/actions/focusable_action_detector.0.dart
+++ b/examples/api/lib/widgets/actions/focusable_action_detector.0.dart
@@ -2,23 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FocusableActionDetector].
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [FocusableActionDetector].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const FocusableActionDetectorExampleApp());
- static const String _title = 'Flutter Code Sample';
+class FocusableActionDetectorExampleApp extends StatelessWidget {
+ const FocusableActionDetectorExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: FocusableActionDetectorExample(),
);
}
}
@@ -42,8 +39,7 @@
bool _hovering = false;
bool _on = false;
late final Map<Type, Action<Intent>> _actionMap;
- final Map<ShortcutActivator, Intent> _shortcutMap =
- const <ShortcutActivator, Intent>{
+ final Map<ShortcutActivator, Intent> _shortcutMap = const <ShortcutActivator, Intent>{
SingleActivator(LogicalKeyboardKey.keyX): ActivateIntent(),
};
@@ -115,14 +111,14 @@
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class FocusableActionDetectorExample extends StatefulWidget {
+ const FocusableActionDetectorExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<FocusableActionDetectorExample> createState() => _FocusableActionDetectorExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _FocusableActionDetectorExampleState extends State<FocusableActionDetectorExample> {
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -135,8 +131,7 @@
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
- child:
- TextButton(onPressed: () {}, child: const Text('Press Me')),
+ child: TextButton(onPressed: () {}, child: const Text('Press Me')),
),
Padding(
padding: const EdgeInsets.all(8.0),
diff --git a/examples/api/lib/widgets/animated_grid/animated_grid.0.dart b/examples/api/lib/widgets/animated_grid/animated_grid.0.dart
index b09c821..3f2b55d 100644
--- a/examples/api/lib/widgets/animated_grid/animated_grid.0.dart
+++ b/examples/api/lib/widgets/animated_grid/animated_grid.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AnimatedGrid].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [AnimatedGrid].
+
void main() {
runApp(const AnimatedGridSample());
}
diff --git a/examples/api/lib/widgets/animated_grid/sliver_animated_grid.0.dart b/examples/api/lib/widgets/animated_grid/sliver_animated_grid.0.dart
index 34af8c0..65c9a0e 100644
--- a/examples/api/lib/widgets/animated_grid/sliver_animated_grid.0.dart
+++ b/examples/api/lib/widgets/animated_grid/sliver_animated_grid.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SliverAnimatedGrid].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [SliverAnimatedGrid].
+
void main() => runApp(const SliverAnimatedGridSample());
class SliverAnimatedGridSample extends StatefulWidget {
diff --git a/examples/api/lib/widgets/animated_list/animated_list.0.dart b/examples/api/lib/widgets/animated_list/animated_list.0.dart
index 2b195a0..c59a243 100644
--- a/examples/api/lib/widgets/animated_list/animated_list.0.dart
+++ b/examples/api/lib/widgets/animated_list/animated_list.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AnimatedList].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [AnimatedList].
+
void main() {
runApp(const AnimatedListSample());
}
@@ -21,8 +21,7 @@
final GlobalKey<AnimatedListState> _listKey = GlobalKey<AnimatedListState>();
late ListModel<int> _list;
int? _selectedItem;
- late int
- _nextItem; // The next item inserted when the user presses the '+' button.
+ late int _nextItem; // The next item inserted when the user presses the '+' button.
@override
void initState() {
@@ -36,8 +35,7 @@
}
// Used to build list items that haven't been removed.
- Widget _buildItem(
- BuildContext context, int index, Animation<double> animation) {
+ Widget _buildItem(BuildContext context, int index, Animation<double> animation) {
return CardItem(
animation: animation,
item: _list[index],
@@ -57,8 +55,7 @@
/// completed (even though it's gone as far as this ListModel is concerned).
/// The widget will be used by the [AnimatedListState.removeItem] method's
/// [AnimatedRemovedItemBuilder] parameter.
- Widget _buildRemovedItem(
- int item, BuildContext context, Animation<double> animation) {
+ Widget _buildRemovedItem(int item, BuildContext context, Animation<double> animation) {
return CardItem(
animation: animation,
item: item,
@@ -68,8 +65,7 @@
// Insert the "next item" into the list model.
void _insert() {
- final int index =
- _selectedItem == null ? _list.length : _list.indexOf(_selectedItem!);
+ final int index = _selectedItem == null ? _list.length : _list.indexOf(_selectedItem!);
_list.insert(index, _nextItem++);
}
@@ -115,8 +111,7 @@
}
}
-typedef RemovedItemBuilder<T> = Widget Function(
- T item, BuildContext context, Animation<double> animation);
+typedef RemovedItemBuilder<T> = Widget Function(T item, BuildContext context, Animation<double> animation);
/// Keeps a Dart [List] in sync with an [AnimatedList].
///
@@ -178,7 +173,7 @@
this.selected = false,
required this.animation,
required this.item,
- }) : assert(item >= 0);
+ }) : assert(item >= 0);
final Animation<double> animation;
final VoidCallback? onTap;
diff --git a/examples/api/lib/widgets/animated_list/sliver_animated_list.0.dart b/examples/api/lib/widgets/animated_list/sliver_animated_list.0.dart
index 34677e5..182b24b 100644
--- a/examples/api/lib/widgets/animated_list/sliver_animated_list.0.dart
+++ b/examples/api/lib/widgets/animated_list/sliver_animated_list.0.dart
@@ -2,30 +2,26 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SliverAnimatedList].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [SliverAnimatedList].
+
void main() => runApp(const SliverAnimatedListSample());
class SliverAnimatedListSample extends StatefulWidget {
const SliverAnimatedListSample({super.key});
@override
- State<SliverAnimatedListSample> createState() =>
- _SliverAnimatedListSampleState();
+ State<SliverAnimatedListSample> createState() => _SliverAnimatedListSampleState();
}
class _SliverAnimatedListSampleState extends State<SliverAnimatedListSample> {
- final GlobalKey<SliverAnimatedListState> _listKey =
- GlobalKey<SliverAnimatedListState>();
+ final GlobalKey<SliverAnimatedListState> _listKey = GlobalKey<SliverAnimatedListState>();
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
- final GlobalKey<ScaffoldMessengerState> _scaffoldMessengerKey =
- GlobalKey<ScaffoldMessengerState>();
+ final GlobalKey<ScaffoldMessengerState> _scaffoldMessengerKey = GlobalKey<ScaffoldMessengerState>();
late ListModel<int> _list;
int? _selectedItem;
- late int
- _nextItem; // The next item inserted when the user presses the '+' button.
+ late int _nextItem; // The next item inserted when the user presses the '+' button.
@override
void initState() {
@@ -39,8 +35,7 @@
}
// Used to build list items that haven't been removed.
- Widget _buildItem(
- BuildContext context, int index, Animation<double> animation) {
+ Widget _buildItem(BuildContext context, int index, Animation<double> animation) {
return CardItem(
animation: animation,
item: _list[index],
@@ -60,8 +55,7 @@
/// completed (even though it's gone as far this ListModel is concerned). The
/// widget will be used by the [AnimatedListState.removeItem] method's
/// [AnimatedRemovedItemBuilder] parameter.
- Widget _buildRemovedItem(
- int item, BuildContext context, Animation<double> animation) {
+ Widget _buildRemovedItem(int item, BuildContext context, Animation<double> animation) {
return CardItem(
animation: animation,
item: item,
@@ -70,8 +64,7 @@
// Insert the "next item" into the list model.
void _insert() {
- final int index =
- _selectedItem == null ? _list.length : _list.indexOf(_selectedItem!);
+ final int index = _selectedItem == null ? _list.length : _list.indexOf(_selectedItem!);
_list.insert(index, _nextItem++);
}
@@ -135,8 +128,7 @@
}
}
-typedef RemovedItemBuilder<E> = Widget Function(
- E item, BuildContext context, Animation<double> animation);
+typedef RemovedItemBuilder<E> = Widget Function(E item, BuildContext context, Animation<double> animation);
// Keeps a Dart [List] in sync with an [AnimatedList].
//
@@ -170,8 +162,7 @@
if (removedItem != null) {
_animatedList.removeItem(
index,
- (BuildContext context, Animation<double> animation) =>
- removedItemBuilder(removedItem, context, animation),
+ (BuildContext context, Animation<double> animation) => removedItemBuilder(removedItem, context, animation),
);
}
return removedItem;
@@ -219,9 +210,7 @@
child: SizedBox(
height: 80.0,
child: Card(
- color: selected
- ? Colors.black12
- : Colors.primaries[item % Colors.primaries.length],
+ color: selected ? Colors.black12 : Colors.primaries[item % Colors.primaries.length],
child: Center(
child: Text(
'Item $item',
diff --git a/examples/api/lib/widgets/animated_size/animated_size.0.dart b/examples/api/lib/widgets/animated_size/animated_size.0.dart
index 915eae0..76f53b3 100644
--- a/examples/api/lib/widgets/animated_size/animated_size.0.dart
+++ b/examples/api/lib/widgets/animated_size/animated_size.0.dart
@@ -2,39 +2,36 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AnimatedSize].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [AnimatedSize].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const AnimatedSizeExampleApp());
- static const String _title = 'Flutter Code Sample';
+class AnimatedSizeExampleApp extends StatelessWidget {
+ const AnimatedSizeExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('AnimatedSize Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: AnimatedSizeExample(),
),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class AnimatedSizeExample extends StatefulWidget {
+ const AnimatedSizeExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<AnimatedSizeExample> createState() => _AnimatedSizeExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _AnimatedSizeExampleState extends State<AnimatedSizeExample> {
double _size = 50.0;
bool _large = false;
diff --git a/examples/api/lib/widgets/animated_switcher/animated_switcher.0.dart b/examples/api/lib/widgets/animated_switcher/animated_switcher.0.dart
index 208759c..1405567 100644
--- a/examples/api/lib/widgets/animated_switcher/animated_switcher.0.dart
+++ b/examples/api/lib/widgets/animated_switcher/animated_switcher.0.dart
@@ -2,34 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AnimatedSwitcher].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [AnimatedSwitcher].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const AnimatedSwitcherExampleApp());
- static const String _title = 'Flutter Code Sample';
+class AnimatedSwitcherExampleApp extends StatelessWidget {
+ const AnimatedSwitcherExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: AnimatedSwitcherExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class AnimatedSwitcherExample extends StatefulWidget {
+ const AnimatedSwitcherExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<AnimatedSwitcherExample> createState() => _AnimatedSwitcherExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _AnimatedSwitcherExampleState extends State<AnimatedSwitcherExample> {
int _count = 0;
@override
diff --git a/examples/api/lib/widgets/app/widgets_app.widgets_app.0.dart b/examples/api/lib/widgets/app/widgets_app.widgets_app.0.dart
index f09e72c..82a8d00 100644
--- a/examples/api/lib/widgets/app/widgets_app.widgets_app.0.dart
+++ b/examples/api/lib/widgets/app/widgets_app.widgets_app.0.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [WidgetsApp].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [WidgetsApp].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const WidgetsAppExampleApp());
+
+class WidgetsAppExampleApp extends StatelessWidget {
+ const WidgetsAppExampleApp({super.key});
@override
Widget build(BuildContext context) {
@@ -19,7 +19,8 @@
home: const Center(child: Text('Hello World')),
pageRouteBuilder: <T>(RouteSettings settings, WidgetBuilder builder) => PageRouteBuilder<T>(
settings: settings,
- pageBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) => builder(context),
+ pageBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) =>
+ builder(context),
),
);
}
diff --git a/examples/api/lib/widgets/async/future_builder.0.dart b/examples/api/lib/widgets/async/future_builder.0.dart
index ed9b5f7..5684432 100644
--- a/examples/api/lib/widgets/async/future_builder.0.dart
+++ b/examples/api/lib/widgets/async/future_builder.0.dart
@@ -2,34 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FutureBuilder].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [FutureBuilder].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const FutureBuilderExampleApp());
- static const String _title = 'Flutter Code Sample';
+class FutureBuilderExampleApp extends StatelessWidget {
+ const FutureBuilderExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: FutureBuilderExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class FutureBuilderExample extends StatefulWidget {
+ const FutureBuilderExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<FutureBuilderExample> createState() => _FutureBuilderExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _FutureBuilderExampleState extends State<FutureBuilderExample> {
final Future<String> _calculation = Future<String>.delayed(
const Duration(seconds: 2),
() => 'Data Loaded',
diff --git a/examples/api/lib/widgets/async/stream_builder.0.dart b/examples/api/lib/widgets/async/stream_builder.0.dart
index 0456aa2..552763a 100644
--- a/examples/api/lib/widgets/async/stream_builder.0.dart
+++ b/examples/api/lib/widgets/async/stream_builder.0.dart
@@ -2,36 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [StreamBuilder].
-
import 'dart:async';
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [StreamBuilder].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const StreamBuilderExampleApp());
- static const String _title = 'Flutter Code Sample';
+class StreamBuilderExampleApp extends StatelessWidget {
+ const StreamBuilderExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: StreamBuilderExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class StreamBuilderExample extends StatefulWidget {
+ const StreamBuilderExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<StreamBuilderExample> createState() => _StreamBuilderExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _StreamBuilderExampleState extends State<StreamBuilderExample> {
final Stream<int> _bids = (() {
late final StreamController<int> controller;
controller = StreamController<int>(
diff --git a/examples/api/lib/widgets/autocomplete/raw_autocomplete.0.dart b/examples/api/lib/widgets/autocomplete/raw_autocomplete.0.dart
index d2ae2ae..1cf3706 100644
--- a/examples/api/lib/widgets/autocomplete/raw_autocomplete.0.dart
+++ b/examples/api/lib/widgets/autocomplete/raw_autocomplete.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RawAutocomplete].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [RawAutocomplete].
+
void main() => runApp(const AutocompleteExampleApp());
class AutocompleteExampleApp extends StatelessWidget {
@@ -43,10 +43,12 @@
return option.contains(textEditingValue.text.toLowerCase());
});
},
- fieldViewBuilder: (BuildContext context,
- TextEditingController textEditingController,
- FocusNode focusNode,
- VoidCallback onFieldSubmitted) {
+ fieldViewBuilder: (
+ BuildContext context,
+ TextEditingController textEditingController,
+ FocusNode focusNode,
+ VoidCallback onFieldSubmitted,
+ ) {
return TextFormField(
controller: textEditingController,
focusNode: focusNode,
@@ -55,8 +57,11 @@
},
);
},
- optionsViewBuilder: (BuildContext context,
- AutocompleteOnSelected<String> onSelected, Iterable<String> options) {
+ optionsViewBuilder: (
+ BuildContext context,
+ AutocompleteOnSelected<String> onSelected,
+ Iterable<String> options,
+ ) {
return Align(
alignment: Alignment.topLeft,
child: Material(
diff --git a/examples/api/lib/widgets/autocomplete/raw_autocomplete.1.dart b/examples/api/lib/widgets/autocomplete/raw_autocomplete.1.dart
index 1bb54d5..2d6a686 100644
--- a/examples/api/lib/widgets/autocomplete/raw_autocomplete.1.dart
+++ b/examples/api/lib/widgets/autocomplete/raw_autocomplete.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RawAutocomplete].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [RawAutocomplete].
+
void main() => runApp(const AutocompleteExampleApp());
class AutocompleteExampleApp extends StatelessWidget {
@@ -72,16 +72,16 @@
return _userOptions.where((User option) {
// Search based on User.toString, which includes both name and
// email, even though the display string is just the name.
- return option
- .toString()
- .contains(textEditingValue.text.toLowerCase());
+ return option.toString().contains(textEditingValue.text.toLowerCase());
});
},
displayStringForOption: _displayStringForOption,
- fieldViewBuilder: (BuildContext context,
- TextEditingController textEditingController,
- FocusNode focusNode,
- VoidCallback onFieldSubmitted) {
+ fieldViewBuilder: (
+ BuildContext context,
+ TextEditingController textEditingController,
+ FocusNode focusNode,
+ VoidCallback onFieldSubmitted,
+ ) {
return TextFormField(
controller: textEditingController,
focusNode: focusNode,
@@ -90,8 +90,7 @@
},
);
},
- optionsViewBuilder: (BuildContext context,
- AutocompleteOnSelected<User> onSelected, Iterable<User> options) {
+ optionsViewBuilder: (BuildContext context, AutocompleteOnSelected<User> onSelected, Iterable<User> options) {
return Align(
alignment: Alignment.topLeft,
child: Material(
diff --git a/examples/api/lib/widgets/autocomplete/raw_autocomplete.2.dart b/examples/api/lib/widgets/autocomplete/raw_autocomplete.2.dart
index 12bb6dc..8d64360 100644
--- a/examples/api/lib/widgets/autocomplete/raw_autocomplete.2.dart
+++ b/examples/api/lib/widgets/autocomplete/raw_autocomplete.2.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RawAutocomplete].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [RawAutocomplete].
+
void main() => runApp(const AutocompleteExampleApp());
class AutocompleteExampleApp extends StatelessWidget {
@@ -62,8 +62,7 @@
_dropdownValue = newValue;
});
},
- items: <String>['One', 'Two', 'Free', 'Four']
- .map<DropdownMenuItem<String>>((String value) {
+ items: <String>['One', 'Two', 'Free', 'Four'].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
@@ -99,10 +98,12 @@
_autocompleteSelection = selection;
});
},
- fieldViewBuilder: (BuildContext context,
- TextEditingController textEditingController,
- FocusNode focusNode,
- VoidCallback onFieldSubmitted) {
+ fieldViewBuilder: (
+ BuildContext context,
+ TextEditingController textEditingController,
+ FocusNode focusNode,
+ VoidCallback onFieldSubmitted,
+ ) {
return TextFormField(
controller: textEditingController,
decoration: const InputDecoration(
@@ -120,9 +121,11 @@
},
);
},
- optionsViewBuilder: (BuildContext context,
- AutocompleteOnSelected<String> onSelected,
- Iterable<String> options) {
+ optionsViewBuilder: (
+ BuildContext context,
+ AutocompleteOnSelected<String> onSelected,
+ Iterable<String> options,
+ ) {
return Align(
alignment: Alignment.topLeft,
child: Material(
@@ -164,8 +167,7 @@
child: ListBody(
children: <Widget>[
Text('DropdownButtonFormField: "$_dropdownValue"'),
- Text(
- 'TextFormField: "${_textEditingController.text}"'),
+ Text('TextFormField: "${_textEditingController.text}"'),
Text('RawAutocomplete: "$_autocompleteSelection"'),
],
),
diff --git a/examples/api/lib/widgets/autocomplete/raw_autocomplete.focus_node.0.dart b/examples/api/lib/widgets/autocomplete/raw_autocomplete.focus_node.0.dart
index 8a30c81..c8d5d27 100644
--- a/examples/api/lib/widgets/autocomplete/raw_autocomplete.focus_node.0.dart
+++ b/examples/api/lib/widgets/autocomplete/raw_autocomplete.focus_node.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RawAutocomplete.focusNode].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [RawAutocomplete.focusNode].
+
void main() => runApp(const AutocompleteExampleApp());
class AutocompleteExampleApp extends StatelessWidget {
@@ -64,9 +64,11 @@
return option.contains(textEditingValue.text.toLowerCase());
}).toList();
},
- optionsViewBuilder: (BuildContext context,
- AutocompleteOnSelected<String> onSelected,
- Iterable<String> options) {
+ optionsViewBuilder: (
+ BuildContext context,
+ AutocompleteOnSelected<String> onSelected,
+ Iterable<String> options,
+ ) {
return Material(
elevation: 4.0,
child: ListView(
diff --git a/examples/api/lib/widgets/autofill/autofill_group.0.dart b/examples/api/lib/widgets/autofill/autofill_group.0.dart
index 61b1f40..3b0c397 100644
--- a/examples/api/lib/widgets/autofill/autofill_group.0.dart
+++ b/examples/api/lib/widgets/autofill/autofill_group.0.dart
@@ -2,37 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AutofillGroup].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [AutofillGroup].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const AutofillGroupExampleApp());
- static const String _title = 'Flutter Code Sample';
+class AutofillGroupExampleApp extends StatelessWidget {
+ const AutofillGroupExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatefulWidget(),
+ appBar: AppBar(title: const Text('AutofillGroup Sample')),
+ body: const AutofillGroupExample(),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class AutofillGroupExample extends StatefulWidget {
+ const AutofillGroupExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<AutofillGroupExample> createState() => _AutofillGroupExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _AutofillGroupExampleState extends State<AutofillGroupExample> {
bool isSameAddress = true;
final TextEditingController shippingAddress1 = TextEditingController();
final TextEditingController shippingAddress2 = TextEditingController();
diff --git a/examples/api/lib/widgets/basic/absorb_pointer.0.dart b/examples/api/lib/widgets/basic/absorb_pointer.0.dart
index 421bb57..d18c36b 100644
--- a/examples/api/lib/widgets/basic/absorb_pointer.0.dart
+++ b/examples/api/lib/widgets/basic/absorb_pointer.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AbsorbPointer].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [AbsorbPointer].
+
void main() => runApp(const AbsorbPointerApp());
class AbsorbPointerApp extends StatelessWidget {
diff --git a/examples/api/lib/widgets/basic/aspect_ratio.0.dart b/examples/api/lib/widgets/basic/aspect_ratio.0.dart
index bde5a3b..4c4e56a 100644
--- a/examples/api/lib/widgets/basic/aspect_ratio.0.dart
+++ b/examples/api/lib/widgets/basic/aspect_ratio.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AspectRatio].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [AspectRatio].
+
void main() => runApp(const AspectRatioApp());
class AspectRatioApp extends StatelessWidget {
diff --git a/examples/api/lib/widgets/basic/aspect_ratio.1.dart b/examples/api/lib/widgets/basic/aspect_ratio.1.dart
index 500032e..a7c823e 100644
--- a/examples/api/lib/widgets/basic/aspect_ratio.1.dart
+++ b/examples/api/lib/widgets/basic/aspect_ratio.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AspectRatio].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [AspectRatio].
+
void main() => runApp(const AspectRatioApp());
class AspectRatioApp extends StatelessWidget {
diff --git a/examples/api/lib/widgets/basic/aspect_ratio.2.dart b/examples/api/lib/widgets/basic/aspect_ratio.2.dart
index 7d65983..23ec8e6 100644
--- a/examples/api/lib/widgets/basic/aspect_ratio.2.dart
+++ b/examples/api/lib/widgets/basic/aspect_ratio.2.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AspectRatio].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [AspectRatio].
+
void main() => runApp(const AspectRatioApp());
class AspectRatioApp extends StatelessWidget {
diff --git a/examples/api/lib/widgets/basic/clip_rrect.0.dart b/examples/api/lib/widgets/basic/clip_rrect.0.dart
index 6b7bbd9..da55a5d 100644
--- a/examples/api/lib/widgets/basic/clip_rrect.0.dart
+++ b/examples/api/lib/widgets/basic/clip_rrect.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ClipRRect].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ClipRRect].
+
void main() => runApp(const ClipRRectApp());
class ClipRRectApp extends StatelessWidget {
diff --git a/examples/api/lib/widgets/basic/clip_rrect.1.dart b/examples/api/lib/widgets/basic/clip_rrect.1.dart
index 829f37c..686115a 100644
--- a/examples/api/lib/widgets/basic/clip_rrect.1.dart
+++ b/examples/api/lib/widgets/basic/clip_rrect.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ClipRRect].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ClipRRect].
+
void main() => runApp(const ClipRRectApp());
class ClipRRectApp extends StatelessWidget {
diff --git a/examples/api/lib/widgets/basic/custom_multi_child_layout.0.dart b/examples/api/lib/widgets/basic/custom_multi_child_layout.0.dart
index 570b871..334cb5e 100644
--- a/examples/api/lib/widgets/basic/custom_multi_child_layout.0.dart
+++ b/examples/api/lib/widgets/basic/custom_multi_child_layout.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CustomMultiChildLayout].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [CustomMultiChildLayout].
+
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
@@ -78,8 +78,7 @@
// automatically cause a relayout, like any other widget.
@override
bool shouldRelayout(_CascadeLayoutDelegate oldDelegate) {
- return oldDelegate.textDirection != textDirection
- || oldDelegate.overlap != overlap;
+ return oldDelegate.textDirection != textDirection || oldDelegate.overlap != overlap;
}
}
diff --git a/examples/api/lib/widgets/basic/expanded.0.dart b/examples/api/lib/widgets/basic/expanded.0.dart
index df3c4dc..e705d4b 100644
--- a/examples/api/lib/widgets/basic/expanded.0.dart
+++ b/examples/api/lib/widgets/basic/expanded.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Expanded].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Expanded].
+
void main() => runApp(const ExpandedApp());
class ExpandedApp extends StatelessWidget {
@@ -19,7 +19,7 @@
title: const Text('Expanded Column Sample'),
),
body: const ExpandedExample(),
- )
+ ),
);
}
}
diff --git a/examples/api/lib/widgets/basic/expanded.1.dart b/examples/api/lib/widgets/basic/expanded.1.dart
index f0cf2d6..ed0dbec 100644
--- a/examples/api/lib/widgets/basic/expanded.1.dart
+++ b/examples/api/lib/widgets/basic/expanded.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Expanded].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Expanded].
+
void main() => runApp(const ExpandedApp());
class ExpandedApp extends StatelessWidget {
diff --git a/examples/api/lib/widgets/basic/flow.0.dart b/examples/api/lib/widgets/basic/flow.0.dart
index a31a42c..8a7c600 100644
--- a/examples/api/lib/widgets/basic/flow.0.dart
+++ b/examples/api/lib/widgets/basic/flow.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Flow].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Flow].
+
void main() => runApp(const FlowApp());
class FlowApp extends StatelessWidget {
@@ -31,8 +31,7 @@
State<FlowMenu> createState() => _FlowMenuState();
}
-class _FlowMenuState extends State<FlowMenu>
- with SingleTickerProviderStateMixin {
+class _FlowMenuState extends State<FlowMenu> with SingleTickerProviderStateMixin {
late AnimationController menuAnimation;
IconData lastTapped = Icons.notifications;
final List<IconData> menuItems = <IconData>[
@@ -59,8 +58,7 @@
}
Widget flowMenuItem(IconData icon) {
- final double buttonDiameter =
- MediaQuery.of(context).size.width / menuItems.length;
+ final double buttonDiameter = MediaQuery.of(context).size.width / menuItems.length;
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: RawMaterialButton(
@@ -70,9 +68,7 @@
constraints: BoxConstraints.tight(Size(buttonDiameter, buttonDiameter)),
onPressed: () {
_updateMenu(icon);
- menuAnimation.status == AnimationStatus.completed
- ? menuAnimation.reverse()
- : menuAnimation.forward();
+ menuAnimation.status == AnimationStatus.completed ? menuAnimation.reverse() : menuAnimation.forward();
},
child: Icon(
icon,
@@ -87,15 +83,13 @@
Widget build(BuildContext context) {
return Flow(
delegate: FlowMenuDelegate(menuAnimation: menuAnimation),
- children:
- menuItems.map<Widget>((IconData icon) => flowMenuItem(icon)).toList(),
+ children: menuItems.map<Widget>((IconData icon) => flowMenuItem(icon)).toList(),
);
}
}
class FlowMenuDelegate extends FlowDelegate {
- FlowMenuDelegate({required this.menuAnimation})
- : super(repaint: menuAnimation);
+ FlowMenuDelegate({required this.menuAnimation}) : super(repaint: menuAnimation);
final Animation<double> menuAnimation;
diff --git a/examples/api/lib/widgets/basic/fractionally_sized_box.0.dart b/examples/api/lib/widgets/basic/fractionally_sized_box.0.dart
index 95c5d85..34e357f 100644
--- a/examples/api/lib/widgets/basic/fractionally_sized_box.0.dart
+++ b/examples/api/lib/widgets/basic/fractionally_sized_box.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FractionallySizedBox].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [FractionallySizedBox].
+
void main() => runApp(const FractionallySizedBoxApp());
class FractionallySizedBoxApp extends StatelessWidget {
diff --git a/examples/api/lib/widgets/basic/ignore_pointer.0.dart b/examples/api/lib/widgets/basic/ignore_pointer.0.dart
index cd6452c..5c9b2c3 100644
--- a/examples/api/lib/widgets/basic/ignore_pointer.0.dart
+++ b/examples/api/lib/widgets/basic/ignore_pointer.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [IgnorePointer].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [IgnorePointer].
+
void main() => runApp(const IgnorePointerApp());
class IgnorePointerApp extends StatelessWidget {
@@ -13,7 +13,7 @@
@override
Widget build(BuildContext context) {
- return MaterialApp(
+ return MaterialApp(
home: Scaffold(
appBar: AppBar(
centerTitle: true,
diff --git a/examples/api/lib/widgets/basic/indexed_stack.0.dart b/examples/api/lib/widgets/basic/indexed_stack.0.dart
index bd5ec38..f88ab1f 100644
--- a/examples/api/lib/widgets/basic/indexed_stack.0.dart
+++ b/examples/api/lib/widgets/basic/indexed_stack.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [IndexedStack].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [IndexedStack].
+
void main() => runApp(const IndexedStackApp());
class IndexedStackApp extends StatelessWidget {
@@ -76,9 +76,7 @@
children: <Widget>[
IndexedStack(
index: index,
- children: <Widget>[
- for (String name in names) PersonTracker(name: name)
- ],
+ children: <Widget>[for (String name in names) PersonTracker(name: name)],
)
],
),
diff --git a/examples/api/lib/widgets/basic/listener.0.dart b/examples/api/lib/widgets/basic/listener.0.dart
index 32a454a..1bddd9b 100644
--- a/examples/api/lib/widgets/basic/listener.0.dart
+++ b/examples/api/lib/widgets/basic/listener.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Listener].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Listener].
+
void main() => runApp(const ListenerApp());
class ListenerApp extends StatelessWidget {
@@ -71,8 +71,7 @@
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
- const Text(
- 'You have pressed or released in this area this many times:'),
+ const Text('You have pressed or released in this area this many times:'),
Text(
'$_downCounter presses\n$_upCounter releases',
style: Theme.of(context).textTheme.headlineMedium,
diff --git a/examples/api/lib/widgets/basic/mouse_region.0.dart b/examples/api/lib/widgets/basic/mouse_region.0.dart
index 1164ae3..253eeff 100644
--- a/examples/api/lib/widgets/basic/mouse_region.0.dart
+++ b/examples/api/lib/widgets/basic/mouse_region.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [MouseRegion].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [MouseRegion].
+
void main() => runApp(const MouseRegionApp());
class MouseRegionApp extends StatelessWidget {
@@ -69,8 +69,7 @@
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
- const Text(
- 'You have entered or exited this box this many times:'),
+ const Text('You have entered or exited this box this many times:'),
Text(
'$_enterCounter Entries\n$_exitCounter Exits',
style: Theme.of(context).textTheme.headlineMedium,
diff --git a/examples/api/lib/widgets/basic/mouse_region.on_exit.0.dart b/examples/api/lib/widgets/basic/mouse_region.on_exit.0.dart
index bbfe0ac..2ee0b41 100644
--- a/examples/api/lib/widgets/basic/mouse_region.on_exit.0.dart
+++ b/examples/api/lib/widgets/basic/mouse_region.on_exit.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [MouseRegion.onExit].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [MouseRegion.onExit].
+
void main() => runApp(const MouseRegionApp());
class MouseRegionApp extends StatelessWidget {
diff --git a/examples/api/lib/widgets/basic/mouse_region.on_exit.1.dart b/examples/api/lib/widgets/basic/mouse_region.on_exit.1.dart
index 1a3773b..4c06781 100644
--- a/examples/api/lib/widgets/basic/mouse_region.on_exit.1.dart
+++ b/examples/api/lib/widgets/basic/mouse_region.on_exit.1.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [MouseRegion.onExit].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [MouseRegion.onExit].
+
void main() => runApp(const MouseRegionApp());
class MouseRegionApp extends StatelessWidget {
@@ -26,8 +26,7 @@
// A region that hides its content one second after being hovered.
class MyTimedButton extends StatefulWidget {
- const MyTimedButton(
- {super.key, required this.onEnterButton, required this.onExitButton});
+ const MyTimedButton({super.key, required this.onEnterButton, required this.onExitButton});
final VoidCallback onEnterButton;
final VoidCallback onExitButton;
@@ -62,23 +61,23 @@
height: 100,
child: MouseRegion(
child: regionIsHidden
- ? null
- : MouseRegion(
- onEnter: (_) {
- widget.onEnterButton();
- setState(() {
- hovered = true;
- });
- startCountdown();
- },
- onExit: (_) {
- setState(() {
- hovered = false;
- });
- widget.onExitButton();
- },
- child: Container(color: Colors.red),
- ),
+ ? null
+ : MouseRegion(
+ onEnter: (_) {
+ widget.onEnterButton();
+ setState(() {
+ hovered = true;
+ });
+ startCountdown();
+ },
+ onExit: (_) {
+ setState(() {
+ hovered = false;
+ });
+ widget.onExitButton();
+ },
+ child: Container(color: Colors.red),
+ ),
),
);
}
diff --git a/examples/api/lib/widgets/basic/offstage.0.dart b/examples/api/lib/widgets/basic/offstage.0.dart
index dc843ca..ee9e333 100644
--- a/examples/api/lib/widgets/basic/offstage.0.dart
+++ b/examples/api/lib/widgets/basic/offstage.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Offstage].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Offstage].
+
void main() => runApp(const OffstageApp());
class OffstageApp extends StatelessWidget {
@@ -36,8 +36,7 @@
bool _offstage = true;
Size _getFlutterLogoSize() {
- final RenderBox renderLogo =
- _key.currentContext!.findRenderObject()! as RenderBox;
+ final RenderBox renderLogo = _key.currentContext!.findRenderObject()! as RenderBox;
return renderLogo.size;
}
@@ -68,8 +67,7 @@
onPressed: () {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
- content:
- Text('Flutter Logo size is ${_getFlutterLogoSize()}'),
+ content: Text('Flutter Logo size is ${_getFlutterLogoSize()}'),
),
);
}),
diff --git a/examples/api/lib/widgets/basic/overflowbox.0.dart b/examples/api/lib/widgets/basic/overflowbox.0.dart
index 626ebab..3d4c7bf 100644
--- a/examples/api/lib/widgets/basic/overflowbox.0.dart
+++ b/examples/api/lib/widgets/basic/overflowbox.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [OverflowBox].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [OverflowBox].
+
void main() => runApp(const OverflowBoxApp());
class OverflowBoxApp extends StatelessWidget {
diff --git a/examples/api/lib/widgets/basic/physical_shape.0.dart b/examples/api/lib/widgets/basic/physical_shape.0.dart
index aaf0bd4..e9ec143 100644
--- a/examples/api/lib/widgets/basic/physical_shape.0.dart
+++ b/examples/api/lib/widgets/basic/physical_shape.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [PhysicalShape].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [PhysicalShape].
+
void main() => runApp(const PhysicalShapeApp());
class PhysicalShapeApp extends StatelessWidget {
diff --git a/examples/api/lib/widgets/binding/widget_binding_observer.0.dart b/examples/api/lib/widgets/binding/widget_binding_observer.0.dart
index 0a2f606..e7076c2 100644
--- a/examples/api/lib/widgets/binding/widget_binding_observer.0.dart
+++ b/examples/api/lib/widgets/binding/widget_binding_observer.0.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [WidgetBindingsObserver].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [WidgetBindingsObserver].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const WidgetBindingObserverExampleApp());
+
+class WidgetBindingObserverExampleApp extends StatelessWidget {
+ const WidgetBindingObserverExampleApp({super.key});
@override
Widget build(BuildContext context) {
@@ -30,20 +30,22 @@
}
class _WidgetBindingsObserverSampleState extends State<WidgetBindingsObserverSample> with WidgetsBindingObserver {
- final List<AppLifecycleState> _stateHistoryList = <AppLifecycleState>[];
+ final List<AppLifecycleState> _stateHistoryList = <AppLifecycleState>[];
@override
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
- if(WidgetsBinding.instance.lifecycleState != null) {
+ if (WidgetsBinding.instance.lifecycleState != null) {
_stateHistoryList.add(WidgetsBinding.instance.lifecycleState!);
}
}
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
- setState(() { _stateHistoryList.add(state); });
+ setState(() {
+ _stateHistoryList.add(state);
+ });
}
@override
@@ -59,9 +61,9 @@
key: const ValueKey<String>('stateHistoryList'),
itemCount: _stateHistoryList.length,
itemBuilder: (BuildContext context, int index) {
- return Text('state is: ${_stateHistoryList[index]}');
- },
- );
+ return Text('state is: ${_stateHistoryList[index]}');
+ },
+ );
}
return const Center(child: Text('There are no AppLifecycleStates to show.'));
diff --git a/examples/api/lib/widgets/color_filter/color_filtered.0.dart b/examples/api/lib/widgets/color_filter/color_filtered.0.dart
index 50158de..59d8203 100644
--- a/examples/api/lib/widgets/color_filter/color_filtered.0.dart
+++ b/examples/api/lib/widgets/color_filter/color_filtered.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ColorFiltered].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [ColorFiltered].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ColorFilteredExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ColorFilteredExampleApp extends StatelessWidget {
+ const ColorFilteredExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('ColorFiltered Sample')),
+ body: const ColorFilteredExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class ColorFilteredExample extends StatelessWidget {
+ const ColorFilteredExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/widgets/dismissible/dismissible.0.dart b/examples/api/lib/widgets/dismissible/dismissible.0.dart
index 5cb896e..c148063 100644
--- a/examples/api/lib/widgets/dismissible/dismissible.0.dart
+++ b/examples/api/lib/widgets/dismissible/dismissible.0.dart
@@ -2,37 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Dismissible].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Dismissible].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const DismissibleExampleApp());
- static const String _title = 'Flutter Code Sample';
+class DismissibleExampleApp extends StatelessWidget {
+ const DismissibleExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatefulWidget(),
+ appBar: AppBar(title: const Text('Dismissible Sample')),
+ body: const DismissibleExample(),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class DismissibleExample extends StatefulWidget {
+ const DismissibleExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<DismissibleExample> createState() => _DismissibleExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _DismissibleExampleState extends State<DismissibleExample> {
List<int> items = List<int>.generate(100, (int index) => index);
@override
diff --git a/examples/api/lib/widgets/drag_target/draggable.0.dart b/examples/api/lib/widgets/drag_target/draggable.0.dart
index 641beaf..2d8914a 100644
--- a/examples/api/lib/widgets/drag_target/draggable.0.dart
+++ b/examples/api/lib/widgets/drag_target/draggable.0.dart
@@ -2,37 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Draggable].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Draggable].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const DraggableExampleApp());
- static const String _title = 'Flutter Code Sample';
+class DraggableExampleApp extends StatelessWidget {
+ const DraggableExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatefulWidget(),
+ appBar: AppBar(title: const Text('Draggable Sample')),
+ body: const DraggableExample(),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class DraggableExample extends StatefulWidget {
+ const DraggableExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<DraggableExample> createState() => _DraggableExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _DraggableExampleState extends State<DraggableExample> {
int acceptedData = 0;
@override
diff --git a/examples/api/lib/widgets/editable_text/editable_text.on_changed.0.dart b/examples/api/lib/widgets/editable_text/editable_text.on_changed.0.dart
index eef91e9..9c12a0e 100644
--- a/examples/api/lib/widgets/editable_text/editable_text.on_changed.0.dart
+++ b/examples/api/lib/widgets/editable_text/editable_text.on_changed.0.dart
@@ -2,34 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [EditableText.onChanged].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [EditableText.onChanged].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const OnChangedExampleApp());
- static const String _title = 'Flutter Code Sample';
+class OnChangedExampleApp extends StatelessWidget {
+ const OnChangedExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: OnChangedExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class OnChangedExample extends StatefulWidget {
+ const OnChangedExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<OnChangedExample> createState() => _OnChangedExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _OnChangedExampleState extends State<OnChangedExample> {
final TextEditingController _controller = TextEditingController();
@override
diff --git a/examples/api/lib/widgets/editable_text/editable_text.on_content_inserted.0.dart b/examples/api/lib/widgets/editable_text/editable_text.on_content_inserted.0.dart
index 7334621..86ca154 100644
--- a/examples/api/lib/widgets/editable_text/editable_text.on_content_inserted.0.dart
+++ b/examples/api/lib/widgets/editable_text/editable_text.on_content_inserted.0.dart
@@ -2,23 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for EditableText.onContentInserted
-
import 'dart:typed_data';
import 'package:flutter/material.dart';
+/// Flutter code sample for [EditableText.onContentInserted].
+
void main() => runApp(const KeyboardInsertedContentApp());
class KeyboardInsertedContentApp extends StatelessWidget {
const KeyboardInsertedContentApp({super.key});
- static const String _title = 'Keyboard Inserted Content Sample';
-
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
home: KeyboardInsertedContentDemo(),
);
}
@@ -62,10 +59,8 @@
},
),
),
- if (bytes != null)
- const Text("Here's the most recently inserted content:"),
- if (bytes != null)
- Image.memory(bytes!),
+ if (bytes != null) const Text("Here's the most recently inserted content:"),
+ if (bytes != null) Image.memory(bytes!),
],
),
);
diff --git a/examples/api/lib/widgets/editable_text/text_editing_controller.0.dart b/examples/api/lib/widgets/editable_text/text_editing_controller.0.dart
index f0b4355..a9837dc 100644
--- a/examples/api/lib/widgets/editable_text/text_editing_controller.0.dart
+++ b/examples/api/lib/widgets/editable_text/text_editing_controller.0.dart
@@ -2,34 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [TextEditingController].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [TextEditingController].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const TextEditingControllerExampleApp());
- static const String _title = 'Flutter Code Sample';
+class TextEditingControllerExampleApp extends StatelessWidget {
+ const TextEditingControllerExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: TextEditingControllerExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class TextEditingControllerExample extends StatefulWidget {
+ const TextEditingControllerExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<TextEditingControllerExample> createState() => _TextEditingControllerExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _TextEditingControllerExampleState extends State<TextEditingControllerExample> {
final TextEditingController _controller = TextEditingController();
@override
@@ -39,8 +36,7 @@
final String text = _controller.text.toLowerCase();
_controller.value = _controller.value.copyWith(
text: text,
- selection:
- TextSelection(baseOffset: text.length, extentOffset: text.length),
+ selection: TextSelection(baseOffset: text.length, extentOffset: text.length),
composing: TextRange.empty,
);
});
diff --git a/examples/api/lib/widgets/focus_manager/focus_node.0.dart b/examples/api/lib/widgets/focus_manager/focus_node.0.dart
index aaaf2a9..8069a7e 100644
--- a/examples/api/lib/widgets/focus_manager/focus_node.0.dart
+++ b/examples/api/lib/widgets/focus_manager/focus_node.0.dart
@@ -2,25 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FocusNode].
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [FocusNode].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const FocusNodeExampleApp());
- static const String _title = 'Flutter Code Sample';
+class FocusNodeExampleApp extends StatelessWidget {
+ const FocusNodeExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('FocusNode Sample')),
+ body: const FocusNodeExample(),
),
);
}
@@ -106,16 +103,15 @@
height: 100,
color: _focused ? _color : Colors.white,
alignment: Alignment.center,
- child:
- Text(_focused ? "I'm in color! Press R,G,B!" : 'Press to focus'),
+ child: Text(_focused ? "I'm in color! Press R,G,B!" : 'Press to focus'),
),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class FocusNodeExample extends StatelessWidget {
+ const FocusNodeExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/widgets/focus_manager/focus_node.unfocus.0.dart b/examples/api/lib/widgets/focus_manager/focus_node.unfocus.0.dart
index 8e57aca..e568bc2 100644
--- a/examples/api/lib/widgets/focus_manager/focus_node.unfocus.0.dart
+++ b/examples/api/lib/widgets/focus_manager/focus_node.unfocus.0.dart
@@ -2,35 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FocusNode.unfocus].
-
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [FocusNode.unfocus].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const UnfocusExampleApp());
- static const String _title = 'Flutter Code Sample';
+class UnfocusExampleApp extends StatelessWidget {
+ const UnfocusExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: UnfocusExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class UnfocusExample extends StatefulWidget {
+ const UnfocusExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<UnfocusExample> createState() => _UnfocusExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _UnfocusExampleState extends State<UnfocusExample> {
UnfocusDisposition disposition = UnfocusDisposition.scope;
@override
@@ -57,8 +53,7 @@
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
- ...List<Widget>.generate(UnfocusDisposition.values.length,
- (int index) {
+ ...List<Widget>.generate(UnfocusDisposition.values.length, (int index) {
return Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
diff --git a/examples/api/lib/widgets/focus_scope/focus.0.dart b/examples/api/lib/widgets/focus_scope/focus.0.dart
index 4defbdf..f62d5de 100644
--- a/examples/api/lib/widgets/focus_scope/focus.0.dart
+++ b/examples/api/lib/widgets/focus_scope/focus.0.dart
@@ -2,38 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Focus].
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Focus].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const FocusExampleApp());
- static const String _title = 'Flutter Code Sample';
+class FocusExampleApp extends StatelessWidget {
+ const FocusExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatefulWidget(),
+ appBar: AppBar(title: const Text('Focus Sample')),
+ body: const FocusExample(),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class FocusExample extends StatefulWidget {
+ const FocusExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<FocusExample> createState() => _FocusExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _FocusExampleState extends State<FocusExample> {
Color _color = Colors.white;
KeyEventResult _handleKeyPress(FocusNode node, RawKeyEvent event) {
@@ -91,9 +88,7 @@
height: 100,
alignment: Alignment.center,
color: hasFocus ? _color : Colors.white,
- child: Text(hasFocus
- ? "I'm in color! Press R,G,B!"
- : 'Press to focus'),
+ child: Text(hasFocus ? "I'm in color! Press R,G,B!" : 'Press to focus'),
),
),
);
diff --git a/examples/api/lib/widgets/focus_scope/focus.1.dart b/examples/api/lib/widgets/focus_scope/focus.1.dart
index ed6f46e..8bbe090 100644
--- a/examples/api/lib/widgets/focus_scope/focus.1.dart
+++ b/examples/api/lib/widgets/focus_scope/focus.1.dart
@@ -2,22 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Focus].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Focus].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const FocusExampleApp());
- static const String _title = 'Flutter Code Sample';
+class FocusExampleApp extends StatelessWidget {
+ const FocusExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: FocusExample(),
);
}
}
@@ -58,8 +55,8 @@
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class FocusExample extends StatelessWidget {
+ const FocusExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/widgets/focus_scope/focus.2.dart b/examples/api/lib/widgets/focus_scope/focus.2.dart
index 53876c5..4451b3d 100644
--- a/examples/api/lib/widgets/focus_scope/focus.2.dart
+++ b/examples/api/lib/widgets/focus_scope/focus.2.dart
@@ -2,34 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Focus].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Focus].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const FocusExampleApp());
- static const String _title = 'Flutter Code Sample';
+class FocusExampleApp extends StatelessWidget {
+ const FocusExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: FocusExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class FocusExample extends StatefulWidget {
+ const FocusExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<FocusExample> createState() => _FocusExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _FocusExampleState extends State<FocusExample> {
int focusedChild = 0;
List<Widget> children = <Widget>[];
List<FocusNode> childFocusNodes = <FocusNode>[];
@@ -52,8 +49,7 @@
void _addChild() {
// Calling requestFocus here creates a deferred request for focus, since the
// node is not yet part of the focus tree.
- childFocusNodes
- .add(FocusNode(debugLabel: 'Child ${children.length}')..requestFocus());
+ childFocusNodes.add(FocusNode(debugLabel: 'Child ${children.length}')..requestFocus());
children.add(Padding(
padding: const EdgeInsets.all(2.0),
diff --git a/examples/api/lib/widgets/focus_scope/focus_scope.0.dart b/examples/api/lib/widgets/focus_scope/focus_scope.0.dart
index 5383d68..20f4c90 100644
--- a/examples/api/lib/widgets/focus_scope/focus_scope.0.dart
+++ b/examples/api/lib/widgets/focus_scope/focus_scope.0.dart
@@ -2,22 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FocusScope].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [FocusScope].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const FocusScopeExampleApp());
- static const String _title = 'Flutter Code Sample';
+class FocusScopeExampleApp extends StatelessWidget {
+ const FocusScopeExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: FocusScopeExample(),
);
}
}
@@ -66,14 +63,14 @@
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class FocusScopeExample extends StatefulWidget {
+ const FocusScopeExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<FocusScopeExample> createState() => _FocusScopeExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _FocusScopeExampleState extends State<FocusScopeExample> {
bool backdropIsVisible = false;
FocusNode backdropNode = FocusNode(debugLabel: 'Close Backdrop Button');
FocusNode foregroundNode = FocusNode(debugLabel: 'Option Button');
@@ -119,8 +116,9 @@
child: const Text('ANOTHER BUTTON TO FOCUS'),
),
DefaultTextStyle(
- style: Theme.of(context).textTheme.displayMedium!,
- child: const Text('BACKDROP')),
+ style: Theme.of(context).textTheme.displayMedium!,
+ child: const Text('BACKDROP'),
+ ),
],
),
),
@@ -144,12 +142,11 @@
// TRY THIS: Try changing this to Colors.green.withOpacity(0.8) to see for
// yourself that the hidden components do/don't get focus.
backgroundColor: Colors.green,
- onPressed: backdropIsVisible
- ? null
- : () => setState(() => backdropIsVisible = true),
+ onPressed: backdropIsVisible ? null : () => setState(() => backdropIsVisible = true),
child: DefaultTextStyle(
- style: Theme.of(context).textTheme.displayMedium!,
- child: const Text('FOREGROUND')),
+ style: Theme.of(context).textTheme.displayMedium!,
+ child: const Text('FOREGROUND'),
+ ),
),
),
],
diff --git a/examples/api/lib/widgets/focus_traversal/focus_traversal_group.0.dart b/examples/api/lib/widgets/focus_traversal/focus_traversal_group.0.dart
index cf9770a..818eb2a 100644
--- a/examples/api/lib/widgets/focus_traversal/focus_traversal_group.0.dart
+++ b/examples/api/lib/widgets/focus_traversal/focus_traversal_group.0.dart
@@ -2,22 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FocusTraversalGroup].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [FocusTraversalGroup].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const FocusTraversalGroupExampleApp());
- static const String _title = 'Flutter Code Sample';
+class FocusTraversalGroupExampleApp extends StatelessWidget {
+ const FocusTraversalGroupExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: FocusTraversalGroupExample(),
);
}
}
@@ -92,8 +89,7 @@
}
Color? foregroundColor(Set<MaterialState> states) {
- if (states.contains(MaterialState.focused) ||
- states.contains(MaterialState.hovered)) {
+ if (states.contains(MaterialState.focused) || states.contains(MaterialState.hovered)) {
return Colors.white;
}
return null; // defer to the default foregroundColor
@@ -107,10 +103,8 @@
focusNode: focusNode,
autofocus: widget.autofocus,
style: ButtonStyle(
- overlayColor:
- MaterialStateProperty.resolveWith<Color?>(overlayColor),
- foregroundColor:
- MaterialStateProperty.resolveWith<Color?>(foregroundColor),
+ overlayColor: MaterialStateProperty.resolveWith<Color?>(overlayColor),
+ foregroundColor: MaterialStateProperty.resolveWith<Color?>(foregroundColor),
),
onPressed: () => _handleOnPressed(),
child: Text(widget.name),
@@ -120,8 +114,8 @@
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class FocusTraversalGroupExample extends StatelessWidget {
+ const FocusTraversalGroupExample({super.key});
@override
Widget build(BuildContext context) {
@@ -153,8 +147,7 @@
mainAxisAlignment: MainAxisAlignment.center,
children: List<Widget>.generate(3, (int index) {
// Order as "C" "B", "A".
- final String order =
- String.fromCharCode('A'.codeUnitAt(0) + (2 - index));
+ final String order = String.fromCharCode('A'.codeUnitAt(0) + (2 - index));
return OrderedButton<String>(
name: 'String: $order',
order: order,
diff --git a/examples/api/lib/widgets/focus_traversal/ordered_traversal_policy.0.dart b/examples/api/lib/widgets/focus_traversal/ordered_traversal_policy.0.dart
index b9e0c02..62f14f1 100644
--- a/examples/api/lib/widgets/focus_traversal/ordered_traversal_policy.0.dart
+++ b/examples/api/lib/widgets/focus_traversal/ordered_traversal_policy.0.dart
@@ -2,25 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [OrderedTraversalPolicy].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [OrderedTraversalPolicy].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const OrderedTraversalPolicyExampleApp());
- static const String _title = 'Flutter Code Sample';
+class OrderedTraversalPolicyExampleApp extends StatelessWidget {
+ const OrderedTraversalPolicyExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('OrderedTraversalPolicy Sample')),
body: const Center(
- child: MyStatelessWidget(),
+ child: OrderedTraversalPolicyExample(),
),
),
);
@@ -57,8 +54,8 @@
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class OrderedTraversalPolicyExample extends StatelessWidget {
+ const OrderedTraversalPolicyExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/widgets/form/form.0.dart b/examples/api/lib/widgets/form/form.0.dart
index e82291d..18b50c9 100644
--- a/examples/api/lib/widgets/form/form.0.dart
+++ b/examples/api/lib/widgets/form/form.0.dart
@@ -2,37 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Form].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Form].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const FormExampleApp());
- static const String _title = 'Flutter Code Sample';
+class FormExampleApp extends StatelessWidget {
+ const FormExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatefulWidget(),
+ appBar: AppBar(title: const Text('Form Sample')),
+ body: const FormExample(),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class FormExample extends StatefulWidget {
+ const FormExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<FormExample> createState() => _FormExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _FormExampleState extends State<FormExample> {
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
@override
diff --git a/examples/api/lib/widgets/framework/build_owner.0.dart b/examples/api/lib/widgets/framework/build_owner.0.dart
index 1bca301..ab17390 100644
--- a/examples/api/lib/widgets/framework/build_owner.0.dart
+++ b/examples/api/lib/widgets/framework/build_owner.0.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [BuildOwner].
-
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
+/// Flutter code sample for [BuildOwner].
+
void main() {
WidgetsFlutterBinding.ensureInitialized();
final Size size = measureWidget(const SizedBox(width: 640, height: 480));
diff --git a/examples/api/lib/widgets/framework/error_widget.0.dart b/examples/api/lib/widgets/framework/error_widget.0.dart
index 73ef0ff..3be9ff8 100644
--- a/examples/api/lib/widgets/framework/error_widget.0.dart
+++ b/examples/api/lib/widgets/framework/error_widget.0.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ErrorWidget].
-
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
+/// Flutter code sample for [ErrorWidget].
+
void main() {
// Set the ErrorWidget's builder before the app is started.
ErrorWidget.builder = (FlutterErrorDetails details) {
@@ -28,19 +28,17 @@
};
// Start the app.
- runApp(const MyApp());
+ runApp(const ErrorWidgetExampleApp());
}
-class MyApp extends StatefulWidget {
- const MyApp({super.key});
-
- static const String _title = 'ErrorWidget Sample';
+class ErrorWidgetExampleApp extends StatefulWidget {
+ const ErrorWidgetExampleApp({super.key});
@override
- State<MyApp> createState() => _MyAppState();
+ State<ErrorWidgetExampleApp> createState() => _ErrorWidgetExampleAppState();
}
-class _MyAppState extends State<MyApp> {
+class _ErrorWidgetExampleAppState extends State<ErrorWidgetExampleApp> {
bool throwError = false;
@override
@@ -55,13 +53,14 @@
);
} else {
return MaterialApp(
- title: MyApp._title,
home: Scaffold(
- appBar: AppBar(title: const Text(MyApp._title)),
+ appBar: AppBar(title: const Text('ErrorWidget Sample')),
body: Center(
child: TextButton(
onPressed: () {
- setState(() { throwError = true; });
+ setState(() {
+ throwError = true;
+ });
},
child: const Text('Error Prone')),
),
diff --git a/examples/api/lib/widgets/gesture_detector/gesture_detector.0.dart b/examples/api/lib/widgets/gesture_detector/gesture_detector.0.dart
index f6010ac..21b1ff9 100644
--- a/examples/api/lib/widgets/gesture_detector/gesture_detector.0.dart
+++ b/examples/api/lib/widgets/gesture_detector/gesture_detector.0.dart
@@ -2,34 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [GestureDetector].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [GestureDetector].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const GestureDetectorExampleApp());
- static const String _title = 'Flutter Code Sample';
+class GestureDetectorExampleApp extends StatelessWidget {
+ const GestureDetectorExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: GestureDetectorExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class GestureDetectorExample extends StatefulWidget {
+ const GestureDetectorExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<GestureDetectorExample> createState() => _GestureDetectorExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _GestureDetectorExampleState extends State<GestureDetectorExample> {
bool _lightIsOn = false;
@override
diff --git a/examples/api/lib/widgets/gesture_detector/gesture_detector.1.dart b/examples/api/lib/widgets/gesture_detector/gesture_detector.1.dart
index fd0606b..11212d1 100644
--- a/examples/api/lib/widgets/gesture_detector/gesture_detector.1.dart
+++ b/examples/api/lib/widgets/gesture_detector/gesture_detector.1.dart
@@ -2,34 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [GestureDetector].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [GestureDetector].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const GestureDetectorExampleApp());
- static const String _title = 'Flutter Code Sample';
+class GestureDetectorExampleApp extends StatelessWidget {
+ const GestureDetectorExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: GestureDetectorExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class GestureDetectorExample extends StatefulWidget {
+ const GestureDetectorExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<GestureDetectorExample> createState() => _GestureDetectorExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _GestureDetectorExampleState extends State<GestureDetectorExample> {
Color _color = Colors.white;
@override
@@ -41,9 +38,7 @@
child: GestureDetector(
onTap: () {
setState(() {
- _color == Colors.yellow
- ? _color = Colors.white
- : _color = Colors.yellow;
+ _color == Colors.yellow ? _color = Colors.white : _color = Colors.yellow;
});
},
),
diff --git a/examples/api/lib/widgets/gesture_detector/gesture_detector.2.dart b/examples/api/lib/widgets/gesture_detector/gesture_detector.2.dart
index 6017ffb..5945453 100644
--- a/examples/api/lib/widgets/gesture_detector/gesture_detector.2.dart
+++ b/examples/api/lib/widgets/gesture_detector/gesture_detector.2.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [GestureDetector].
-
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
+/// Flutter code sample for [GestureDetector].
+
void main() {
debugPrintGestureArenaDiagnostics = true;
runApp(const NestedGestureDetectorsApp());
@@ -35,8 +35,7 @@
State<NestedGestureDetectorsExample> createState() => _NestedGestureDetectorsExampleState();
}
-class _NestedGestureDetectorsExampleState
- extends State<NestedGestureDetectorsExample> {
+class _NestedGestureDetectorsExampleState extends State<NestedGestureDetectorsExample> {
bool _isYellowTranslucent = false;
_OnTapWinner _winner = _OnTapWinner.none;
final Border highlightBorder = Border.all(color: Colors.red, width: 5);
@@ -66,9 +65,7 @@
// parent-child hit testing. A tap on 'Yellow' is also in
// 'Green' bounds. Both enter the gesture arena, 'Yellow' wins
// because it is in front.
- behavior: _isYellowTranslucent
- ? HitTestBehavior.translucent
- : HitTestBehavior.opaque,
+ behavior: _isYellowTranslucent ? HitTestBehavior.translucent : HitTestBehavior.opaque,
onTap: () {
debugPrint('Yellow onTap');
setState(() {
diff --git a/examples/api/lib/widgets/hardware_keyboard/key_event_manager.0.dart b/examples/api/lib/widgets/hardware_keyboard/key_event_manager.0.dart
index e899078..9c5fd51 100644
--- a/examples/api/lib/widgets/hardware_keyboard/key_event_manager.0.dart
+++ b/examples/api/lib/widgets/hardware_keyboard/key_event_manager.0.dart
@@ -2,20 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [KeyEventManager.keyMessageHandler].
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-void main() => runApp(
- const MaterialApp(
- home: Scaffold(
- body: Center(
- child: FallbackDemo(),
- )
+/// Flutter code sample for [KeyEventManager.keyMessageHandler].
+
+void main() {
+ runApp(
+ const MaterialApp(
+ home: Scaffold(
+ body: Center(
+ child: FallbackDemo(),
+ ),
+ ),
),
- ),
-);
+ );
+}
class FallbackDemo extends StatefulWidget {
const FallbackDemo({super.key});
@@ -38,7 +40,7 @@
// to type text, because these key events will no longer be sent to the
// text input system.
return false;
- }
+ },
);
@override
@@ -52,7 +54,7 @@
child: Column(
children: <Widget>[
const Text('This area handles key presses that are unhandled by any shortcuts, by '
- 'displaying them below. Try text shortcuts such as Ctrl-A!'),
+ 'displaying them below. Try text shortcuts such as Ctrl-A!'),
Text(_capture == null ? '' : '$_capture is not handled by shortcuts.'),
const TextField(decoration: InputDecoration(label: Text('Text field 1'))),
Shortcuts(
@@ -67,7 +69,7 @@
),
],
),
- )
+ ),
);
}
}
@@ -113,6 +115,7 @@
}
return _instance;
}
+
static bool _initialized = false;
static final FallbackKeyEventRegistrar _instance = FallbackKeyEventRegistrar._();
diff --git a/examples/api/lib/widgets/heroes/hero.0.dart b/examples/api/lib/widgets/heroes/hero.0.dart
index c81cfbe..2c6772e 100644
--- a/examples/api/lib/widgets/heroes/hero.0.dart
+++ b/examples/api/lib/widgets/heroes/hero.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Hero].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Hero].
+
void main() => runApp(const HeroApp());
class HeroApp extends StatelessWidget {
diff --git a/examples/api/lib/widgets/heroes/hero.1.dart b/examples/api/lib/widgets/heroes/hero.1.dart
index 51685ce..f716862 100644
--- a/examples/api/lib/widgets/heroes/hero.1.dart
+++ b/examples/api/lib/widgets/heroes/hero.1.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Hero].
-
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
+/// Flutter code sample for [Hero].
+
void main() {
// Slow down time to see Hero flight animation.
timeDilation = 15.0;
@@ -38,7 +38,7 @@
tag: 'hero-default-tween',
child: BoxWidget(
size: const Size(50.0, 50.0),
- color:Colors.red[700]!.withOpacity(0.5),
+ color: Colors.red[700]!.withOpacity(0.5),
),
),
title: const Text(
@@ -54,7 +54,7 @@
},
child: BoxWidget(
size: const Size(50.0, 50.0),
- color:Colors.blue[700]!.withOpacity(0.5),
+ color: Colors.blue[700]!.withOpacity(0.5),
),
),
title: const Text(
diff --git a/examples/api/lib/widgets/image/image.error_builder.0.dart b/examples/api/lib/widgets/image/image.error_builder.0.dart
index be1aa82..e076c45 100644
--- a/examples/api/lib/widgets/image/image.error_builder.0.dart
+++ b/examples/api/lib/widgets/image/image.error_builder.0.dart
@@ -2,32 +2,29 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Image.errorBuilder].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Image.errorBuilder].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ErrorBuilderExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ErrorBuilderExampleApp extends StatelessWidget {
+ const ErrorBuilderExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
home: Scaffold(
body: Center(
- child: MyStatelessWidget(),
+ child: ErrorBuilderExample(),
),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class ErrorBuilderExample extends StatelessWidget {
+ const ErrorBuilderExample({super.key});
@override
Widget build(BuildContext context) {
@@ -39,8 +36,7 @@
),
child: Image.network(
'https://example.does.not.exist/image.jpg',
- errorBuilder:
- (BuildContext context, Object exception, StackTrace? stackTrace) {
+ errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
// Appropriate logging or analytics, e.g.
// myAnalytics.recordError(
// 'An error occurred loading "https://example.does.not.exist/image.jpg"',
diff --git a/examples/api/lib/widgets/image/image.frame_builder.0.dart b/examples/api/lib/widgets/image/image.frame_builder.0.dart
index b04d6f8..809fd63 100644
--- a/examples/api/lib/widgets/image/image.frame_builder.0.dart
+++ b/examples/api/lib/widgets/image/image.frame_builder.0.dart
@@ -2,28 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Image.frameBuilder].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Image.frameBuilder].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const FrameBuilderExampleApp());
- static const String _title = 'Flutter Code Sample';
+class FrameBuilderExampleApp extends StatelessWidget {
+ const FrameBuilderExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: FrameBuilderExample(),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class FrameBuilderExample extends StatelessWidget {
+ const FrameBuilderExample({super.key});
@override
@override
@@ -36,8 +33,7 @@
),
child: Image.network(
'https://flutter.github.io/assets-for-api-docs/assets/widgets/puffin.jpg',
- frameBuilder: (BuildContext context, Widget child, int? frame,
- bool wasSynchronouslyLoaded) {
+ frameBuilder: (BuildContext context, Widget child, int? frame, bool wasSynchronouslyLoaded) {
if (wasSynchronouslyLoaded) {
return child;
}
diff --git a/examples/api/lib/widgets/image/image.loading_builder.0.dart b/examples/api/lib/widgets/image/image.loading_builder.0.dart
index 6e9b97f..3005bf0 100644
--- a/examples/api/lib/widgets/image/image.loading_builder.0.dart
+++ b/examples/api/lib/widgets/image/image.loading_builder.0.dart
@@ -2,28 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Image.loadingBuilder].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Image.loadingBuilder].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const LoadingBuilderExampleApp());
- static const String _title = 'Flutter Code Sample';
+class LoadingBuilderExampleApp extends StatelessWidget {
+ const LoadingBuilderExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: LoadingBuilderExample(),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class LoadingBuilderExample extends StatelessWidget {
+ const LoadingBuilderExample({super.key});
@override
Widget build(BuildContext context) {
@@ -35,16 +32,14 @@
),
child: Image.network(
'https://flutter.github.io/assets-for-api-docs/assets/widgets/falcon.jpg',
- loadingBuilder: (BuildContext context, Widget child,
- ImageChunkEvent? loadingProgress) {
+ loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent? loadingProgress) {
if (loadingProgress == null) {
return child;
}
return Center(
child: CircularProgressIndicator(
value: loadingProgress.expectedTotalBytes != null
- ? loadingProgress.cumulativeBytesLoaded /
- loadingProgress.expectedTotalBytes!
+ ? loadingProgress.cumulativeBytesLoaded / loadingProgress.expectedTotalBytes!
: null,
),
);
diff --git a/examples/api/lib/widgets/implicit_animations/animated_align.0.dart b/examples/api/lib/widgets/implicit_animations/animated_align.0.dart
index 3a73a99..6f73cf7 100644
--- a/examples/api/lib/widgets/implicit_animations/animated_align.0.dart
+++ b/examples/api/lib/widgets/implicit_animations/animated_align.0.dart
@@ -2,37 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AnimatedAlign].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [AnimatedAlign].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const AnimatedAlignExampleApp());
- static const String _title = 'Flutter Code Sample';
+class AnimatedAlignExampleApp extends StatelessWidget {
+ const AnimatedAlignExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatefulWidget(),
+ appBar: AppBar(title: const Text('AnimatedAlign Sample')),
+ body: const AnimatedAlignExample(),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class AnimatedAlignExample extends StatefulWidget {
+ const AnimatedAlignExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<AnimatedAlignExample> createState() => _AnimatedAlignExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _AnimatedAlignExampleState extends State<AnimatedAlignExample> {
bool selected = false;
@override
diff --git a/examples/api/lib/widgets/implicit_animations/animated_container.0.dart b/examples/api/lib/widgets/implicit_animations/animated_container.0.dart
index a374cd0..a9706e5 100644
--- a/examples/api/lib/widgets/implicit_animations/animated_container.0.dart
+++ b/examples/api/lib/widgets/implicit_animations/animated_container.0.dart
@@ -2,37 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AnimatedContainer].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [AnimatedContainer].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const AnimatedContainerExampleApp());
- static const String _title = 'Flutter Code Sample';
+class AnimatedContainerExampleApp extends StatelessWidget {
+ const AnimatedContainerExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatefulWidget(),
+ appBar: AppBar(title: const Text('AnimatedContainer Sample')),
+ body: const AnimatedContainerExample(),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class AnimatedContainerExample extends StatefulWidget {
+ const AnimatedContainerExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<AnimatedContainerExample> createState() => _AnimatedContainerExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _AnimatedContainerExampleState extends State<AnimatedContainerExample> {
bool selected = false;
@override
@@ -48,8 +45,7 @@
width: selected ? 200.0 : 100.0,
height: selected ? 100.0 : 200.0,
color: selected ? Colors.red : Colors.blue,
- alignment:
- selected ? Alignment.center : AlignmentDirectional.topCenter,
+ alignment: selected ? Alignment.center : AlignmentDirectional.topCenter,
duration: const Duration(seconds: 2),
curve: Curves.fastOutSlowIn,
child: const FlutterLogo(size: 75),
diff --git a/examples/api/lib/widgets/implicit_animations/animated_fractionally_sized_box.0.dart b/examples/api/lib/widgets/implicit_animations/animated_fractionally_sized_box.0.dart
index a3d6c25..8efa516 100644
--- a/examples/api/lib/widgets/implicit_animations/animated_fractionally_sized_box.0.dart
+++ b/examples/api/lib/widgets/implicit_animations/animated_fractionally_sized_box.0.dart
@@ -2,37 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AnimatedFractionallySizedBox].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [AnimatedFractionallySizedBox].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const AnimatedFractionallySizedBoxExampleApp());
- static const String _title = 'Flutter Code Sample';
+class AnimatedFractionallySizedBoxExampleApp extends StatelessWidget {
+ const AnimatedFractionallySizedBoxExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatefulWidget(),
+ appBar: AppBar(title: const Text('AnimatedFractionallySizedBox Sample')),
+ body: const AnimatedFractionallySizedBoxExample(),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class AnimatedFractionallySizedBoxExample extends StatefulWidget {
+ const AnimatedFractionallySizedBoxExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<AnimatedFractionallySizedBoxExample> createState() => _AnimatedFractionallySizedBoxExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _AnimatedFractionallySizedBoxExampleState extends State<AnimatedFractionallySizedBoxExample> {
bool selected = false;
@override
diff --git a/examples/api/lib/widgets/implicit_animations/animated_padding.0.dart b/examples/api/lib/widgets/implicit_animations/animated_padding.0.dart
index 2d42480..eebf76e 100644
--- a/examples/api/lib/widgets/implicit_animations/animated_padding.0.dart
+++ b/examples/api/lib/widgets/implicit_animations/animated_padding.0.dart
@@ -2,37 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AnimatedPadding].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [AnimatedPadding].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const AnimatedPaddingExampleApp());
- static const String _title = 'Flutter Code Sample';
+class AnimatedPaddingExampleApp extends StatelessWidget {
+ const AnimatedPaddingExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatefulWidget(),
+ appBar: AppBar(title: const Text('AnimatedPadding Sample')),
+ body: const AnimatedPaddingExample(),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class AnimatedPaddingExample extends StatefulWidget {
+ const AnimatedPaddingExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<AnimatedPaddingExample> createState() => _AnimatedPaddingExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _AnimatedPaddingExampleState extends State<AnimatedPaddingExample> {
double padValue = 0.0;
void _updatePadding(double value) {
setState(() {
diff --git a/examples/api/lib/widgets/implicit_animations/animated_positioned.0.dart b/examples/api/lib/widgets/implicit_animations/animated_positioned.0.dart
index 55478c8..bc0a294 100644
--- a/examples/api/lib/widgets/implicit_animations/animated_positioned.0.dart
+++ b/examples/api/lib/widgets/implicit_animations/animated_positioned.0.dart
@@ -2,39 +2,36 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AnimatedPositioned].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [AnimatedPositioned].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const AnimatedPositionedExampleApp());
- static const String _title = 'Flutter Code Sample';
+class AnimatedPositionedExampleApp extends StatelessWidget {
+ const AnimatedPositionedExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('AnimatedPositioned Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: AnimatedPositionedExample(),
),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class AnimatedPositionedExample extends StatefulWidget {
+ const AnimatedPositionedExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<AnimatedPositionedExample> createState() => _AnimatedPositionedExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _AnimatedPositionedExampleState extends State<AnimatedPositionedExample> {
bool selected = false;
@override
diff --git a/examples/api/lib/widgets/implicit_animations/animated_slide.0.dart b/examples/api/lib/widgets/implicit_animations/animated_slide.0.dart
index ed742ad..8f6b94f 100644
--- a/examples/api/lib/widgets/implicit_animations/animated_slide.0.dart
+++ b/examples/api/lib/widgets/implicit_animations/animated_slide.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AnimatedSlide].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [AnimatedSlide].
+
void main() => runApp(const AnimatedSlideApp());
class AnimatedSlideApp extends StatelessWidget {
diff --git a/examples/api/lib/widgets/implicit_animations/sliver_animated_opacity.0.dart b/examples/api/lib/widgets/implicit_animations/sliver_animated_opacity.0.dart
index cdadf62..35df561 100644
--- a/examples/api/lib/widgets/implicit_animations/sliver_animated_opacity.0.dart
+++ b/examples/api/lib/widgets/implicit_animations/sliver_animated_opacity.0.dart
@@ -2,39 +2,36 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SliverAnimatedOpacity].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SliverAnimatedOpacity].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SliverAnimatedOpacityExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SliverAnimatedOpacityExampleApp extends StatelessWidget {
+ const SliverAnimatedOpacityExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('SliverAnimatedOpacity Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: SliverAnimatedOpacityExample(),
),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class SliverAnimatedOpacityExample extends StatefulWidget {
+ const SliverAnimatedOpacityExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<SliverAnimatedOpacityExample> createState() => _SliverAnimatedOpacityExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget>
+class _SliverAnimatedOpacityExampleState extends State<SliverAnimatedOpacityExample>
with SingleTickerProviderStateMixin {
bool _visible = true;
diff --git a/examples/api/lib/widgets/inherited_model/inherited_model.0.dart b/examples/api/lib/widgets/inherited_model/inherited_model.0.dart
index 512edc1..dcc92ae 100644
--- a/examples/api/lib/widgets/inherited_model/inherited_model.0.dart
+++ b/examples/api/lib/widgets/inherited_model/inherited_model.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InheritedModel].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [InheritedModel].
+
enum LogoAspect { backgroundColor, large }
void main() => runApp(const InheritedModelApp());
@@ -42,8 +42,7 @@
@override
bool updateShouldNotify(LogoModel oldWidget) {
- return backgroundColor != oldWidget.backgroundColor ||
- large != oldWidget.large;
+ return backgroundColor != oldWidget.backgroundColor || large != oldWidget.large;
}
@override
@@ -97,7 +96,7 @@
),
);
setState(() {
- if (color == Colors.blue){
+ if (color == Colors.blue) {
color = Colors.red;
} else {
color = Colors.blue;
diff --git a/examples/api/lib/widgets/inherited_notifier/inherited_notifier.0.dart b/examples/api/lib/widgets/inherited_notifier/inherited_notifier.0.dart
index 08736bb..938ac06 100644
--- a/examples/api/lib/widgets/inherited_notifier/inherited_notifier.0.dart
+++ b/examples/api/lib/widgets/inherited_notifier/inherited_notifier.0.dart
@@ -2,24 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InheritedNotifier].
-
import 'dart:math' as math;
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InheritedNotifier].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const InheritedNotifierExampleApp());
- static const String _title = 'Flutter Code Sample';
+class InheritedNotifierExampleApp extends StatelessWidget {
+ const InheritedNotifierExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: InheritedNotifierExample(),
);
}
}
@@ -32,10 +29,7 @@
});
static double of(BuildContext context) {
- return context
- .dependOnInheritedWidgetOfExactType<SpinModel>()!
- .notifier!
- .value;
+ return context.dependOnInheritedWidgetOfExactType<SpinModel>()!.notifier!.value;
}
}
@@ -58,17 +52,16 @@
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class InheritedNotifierExample extends StatefulWidget {
+ const InheritedNotifierExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<InheritedNotifierExample> createState() => _InheritedNotifierExampleState();
}
/// [AnimationController]s can be created with `vsync: this` because of
/// [TickerProviderStateMixin].
-class _MyStatefulWidgetState extends State<MyStatefulWidget>
- with TickerProviderStateMixin {
+class _InheritedNotifierExampleState extends State<InheritedNotifierExample> with TickerProviderStateMixin {
late AnimationController _controller;
@override
diff --git a/examples/api/lib/widgets/inherited_theme/inherited_theme.0.dart b/examples/api/lib/widgets/inherited_theme/inherited_theme.0.dart
index 67b1254..6786db1 100644
--- a/examples/api/lib/widgets/inherited_theme/inherited_theme.0.dart
+++ b/examples/api/lib/widgets/inherited_theme/inherited_theme.0.dart
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InheritedTheme].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [InheritedTheme].
+
void main() {
- runApp(const MyApp());
+ runApp(const InheritedThemeExampleApp());
}
class MyAppBody extends StatelessWidget {
@@ -23,8 +23,7 @@
// the new route pushed onto said navigator.
// Themes are captured outside of the route's builder because when the
// builder executes, the context may not be valid anymore.
- final CapturedThemes themes =
- InheritedTheme.capture(from: context, to: navigator.context);
+ final CapturedThemes themes = InheritedTheme.capture(from: context, to: navigator.context);
return GestureDetector(
onTap: () {
Navigator.of(context).push(
@@ -48,8 +47,8 @@
}
}
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+class InheritedThemeExampleApp extends StatelessWidget {
+ const InheritedThemeExampleApp({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/widgets/interactive_viewer/interactive_viewer.0.dart b/examples/api/lib/widgets/interactive_viewer/interactive_viewer.0.dart
index f02786b..eaae7ba 100644
--- a/examples/api/lib/widgets/interactive_viewer/interactive_viewer.0.dart
+++ b/examples/api/lib/widgets/interactive_viewer/interactive_viewer.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InteractiveViewer].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InteractiveViewer].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const InteractiveViewerExampleApp());
- static const String _title = 'Flutter Code Sample';
+class InteractiveViewerExampleApp extends StatelessWidget {
+ const InteractiveViewerExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('InteractiveViewer Sample')),
+ body: const InteractiveViewerExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class InteractiveViewerExample extends StatelessWidget {
+ const InteractiveViewerExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/widgets/interactive_viewer/interactive_viewer.builder.0.dart b/examples/api/lib/widgets/interactive_viewer/interactive_viewer.builder.0.dart
index 0337029..99faf50 100644
--- a/examples/api/lib/widgets/interactive_viewer/interactive_viewer.builder.0.dart
+++ b/examples/api/lib/widgets/interactive_viewer/interactive_viewer.builder.0.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InteractiveViewer.builder].
-
import 'package:flutter/material.dart';
import 'package:vector_math/vector_math_64.dart' show Quad, Vector3;
+/// Flutter code sample for [InteractiveViewer.builder].
+
void main() => runApp(const IVBuilderExampleApp());
class IVBuilderExampleApp extends StatelessWidget {
@@ -80,9 +80,7 @@
return Container(
height: _cellHeight,
width: _cellWidth,
- color: row % 2 + column % 2 == 1
- ? Colors.white
- : Colors.grey.withOpacity(0.1),
+ color: row % 2 + column % 2 == 1 ? Colors.white : Colors.grey.withOpacity(0.1),
child: Align(
child: Text('$row x $column'),
),
@@ -97,8 +95,7 @@
}
}
-typedef _CellBuilder = Widget Function(
- BuildContext context, int row, int column);
+typedef _CellBuilder = Widget Function(BuildContext context, int row, int column);
class _TableBuilder extends StatelessWidget {
const _TableBuilder({
diff --git a/examples/api/lib/widgets/interactive_viewer/interactive_viewer.constrained.0.dart b/examples/api/lib/widgets/interactive_viewer/interactive_viewer.constrained.0.dart
index 5b48689..be4aa44 100644
--- a/examples/api/lib/widgets/interactive_viewer/interactive_viewer.constrained.0.dart
+++ b/examples/api/lib/widgets/interactive_viewer/interactive_viewer.constrained.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InteractiveViewer.constrained].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InteractiveViewer.constrained].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ConstrainedExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ConstrainedExampleApp extends StatelessWidget {
+ const ConstrainedExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('Constrained Sample')),
+ body: const ConstrainedExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class ConstrainedExample extends StatelessWidget {
+ const ConstrainedExample({super.key});
@override
Widget build(BuildContext context) {
@@ -39,8 +36,7 @@
scaleEnabled: false,
child: Table(
columnWidths: <int, TableColumnWidth>{
- for (int column = 0; column < columnCount; column += 1)
- column: const FixedColumnWidth(200.0),
+ for (int column = 0; column < columnCount; column += 1) column: const FixedColumnWidth(200.0),
},
children: <TableRow>[
for (int row = 0; row < rowCount; row += 1)
@@ -49,9 +45,7 @@
for (int column = 0; column < columnCount; column += 1)
Container(
height: 26,
- color: row % 2 + column % 2 == 1
- ? Colors.white
- : Colors.grey.withOpacity(0.1),
+ color: row % 2 + column % 2 == 1 ? Colors.white : Colors.grey.withOpacity(0.1),
child: Align(
alignment: Alignment.centerLeft,
child: Text('$row x $column'),
diff --git a/examples/api/lib/widgets/interactive_viewer/interactive_viewer.transformation_controller.0.dart b/examples/api/lib/widgets/interactive_viewer/interactive_viewer.transformation_controller.0.dart
index 7879717..135f72e 100644
--- a/examples/api/lib/widgets/interactive_viewer/interactive_viewer.transformation_controller.0.dart
+++ b/examples/api/lib/widgets/interactive_viewer/interactive_viewer.transformation_controller.0.dart
@@ -2,39 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [InteractiveViewer.transformationController].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [InteractiveViewer.transformationController].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const TransformationControllerExampleApp());
- static const String _title = 'Flutter Code Sample';
+class TransformationControllerExampleApp extends StatelessWidget {
+ const TransformationControllerExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: TransformationControllerExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class TransformationControllerExample extends StatefulWidget {
+ const TransformationControllerExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<TransformationControllerExample> createState() => _TransformationControllerExampleState();
}
/// [AnimationController]s can be created with `vsync: this` because of
/// [TickerProviderStateMixin].
-class _MyStatefulWidgetState extends State<MyStatefulWidget>
+class _TransformationControllerExampleState extends State<TransformationControllerExample>
with TickerProviderStateMixin {
- final TransformationController _transformationController =
- TransformationController();
+ final TransformationController _transformationController = TransformationController();
Animation<Matrix4>? _animationReset;
late final AnimationController _controllerReset;
diff --git a/examples/api/lib/widgets/layout_builder/layout_builder.0.dart b/examples/api/lib/widgets/layout_builder/layout_builder.0.dart
index 07dbaad..b0254f7 100644
--- a/examples/api/lib/widgets/layout_builder/layout_builder.0.dart
+++ b/examples/api/lib/widgets/layout_builder/layout_builder.0.dart
@@ -2,28 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [LayoutBuilder].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [LayoutBuilder].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const LayoutBuilderExampleApp());
- static const String _title = 'Flutter Code Sample';
+class LayoutBuilderExampleApp extends StatelessWidget {
+ const LayoutBuilderExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: LayoutBuilderExample(),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class LayoutBuilderExample extends StatelessWidget {
+ const LayoutBuilderExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/widgets/magnifier/magnifier.0.dart b/examples/api/lib/widgets/magnifier/magnifier.0.dart
index 8603a23..87e3f98 100644
--- a/examples/api/lib/widgets/magnifier/magnifier.0.dart
+++ b/examples/api/lib/widgets/magnifier/magnifier.0.dart
@@ -4,17 +4,17 @@
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+void main() => runApp(const MagnifierExampleApp());
-class MyApp extends StatefulWidget {
- const MyApp({super.key});
+class MagnifierExampleApp extends StatefulWidget {
+ const MagnifierExampleApp({super.key});
static const Size loupeSize = Size(200, 200);
@override
- State<MyApp> createState() => _MyAppState();
+ State<MagnifierExampleApp> createState() => _MagnifierExampleAppState();
}
-class _MyAppState extends State<MyApp> {
+class _MagnifierExampleAppState extends State<MagnifierExampleApp> {
Offset dragGesturePosition = Offset.zero;
@override
diff --git a/examples/api/lib/widgets/media_query/media_query_data.system_gesture_insets.0.dart b/examples/api/lib/widgets/media_query/media_query_data.system_gesture_insets.0.dart
index 5603970..d41df33 100644
--- a/examples/api/lib/widgets/media_query/media_query_data.system_gesture_insets.0.dart
+++ b/examples/api/lib/widgets/media_query/media_query_data.system_gesture_insets.0.dart
@@ -2,43 +2,38 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [MediaQueryData.systemGestureInsets].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [MediaQueryData.systemGestureInsets].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SystemGestureInsetsExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SystemGestureInsetsExampleApp extends StatelessWidget {
+ const SystemGestureInsetsExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: SystemGestureInsetsExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class SystemGestureInsetsExample extends StatefulWidget {
+ const SystemGestureInsetsExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<SystemGestureInsetsExample> createState() => _SystemGestureInsetsExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _SystemGestureInsetsExampleState extends State<SystemGestureInsetsExample> {
double _currentValue = 0.2;
@override
Widget build(BuildContext context) {
- final EdgeInsets systemGestureInsets =
- MediaQuery.of(context).systemGestureInsets;
+ final EdgeInsets systemGestureInsets = MediaQuery.of(context).systemGestureInsets;
return Scaffold(
- appBar:
- AppBar(title: const Text('Pad Slider to avoid systemGestureInsets')),
+ appBar: AppBar(title: const Text('Pad Slider to avoid systemGestureInsets')),
body: Padding(
padding: EdgeInsets.only(
// only left and right padding are needed here
diff --git a/examples/api/lib/widgets/navigator/navigator.0.dart b/examples/api/lib/widgets/navigator/navigator.0.dart
index 201fe08..0f19ecb 100644
--- a/examples/api/lib/widgets/navigator/navigator.0.dart
+++ b/examples/api/lib/widgets/navigator/navigator.0.dart
@@ -2,19 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Navigator].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Navigator].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const NavigatorExampleApp());
+
+class NavigatorExampleApp extends StatelessWidget {
+ const NavigatorExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: 'Flutter Code Sample for Navigator',
// MaterialApp contains our top-level Navigator
initialRoute: '/',
routes: <String, WidgetBuilder>{
@@ -52,8 +51,7 @@
onTap: () {
// This moves from the personal info page to the credentials page,
// replacing this page with that one.
- Navigator.of(context)
- .pushReplacementNamed('signup/choose_credentials');
+ Navigator.of(context).pushReplacementNamed('signup/choose_credentials');
},
child: Container(
color: Colors.lightBlue,
diff --git a/examples/api/lib/widgets/navigator/navigator.restorable_push.0.dart b/examples/api/lib/widgets/navigator/navigator.restorable_push.0.dart
index f44ff6e..1e292f5 100644
--- a/examples/api/lib/widgets/navigator/navigator.restorable_push.0.dart
+++ b/examples/api/lib/widgets/navigator/navigator.restorable_push.0.dart
@@ -2,38 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Navigator.restorablePush].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Navigator.restorablePush].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const RestorablePushExampleApp());
- static const String _title = 'Flutter Code Sample';
+class RestorablePushExampleApp extends StatelessWidget {
+ const RestorablePushExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: RestorablePushExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class RestorablePushExample extends StatefulWidget {
+ const RestorablePushExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<RestorablePushExample> createState() => _RestorablePushExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _RestorablePushExampleState extends State<RestorablePushExample> {
@pragma('vm:entry-point')
static Route<void> _myRouteBuilder(BuildContext context, Object? arguments) {
return MaterialPageRoute<void>(
- builder: (BuildContext context) => const MyStatefulWidget(),
+ builder: (BuildContext context) => const RestorablePushExample(),
);
}
diff --git a/examples/api/lib/widgets/navigator/navigator.restorable_push_and_remove_until.0.dart b/examples/api/lib/widgets/navigator/navigator.restorable_push_and_remove_until.0.dart
index 3e7c755..eaf34b3 100644
--- a/examples/api/lib/widgets/navigator/navigator.restorable_push_and_remove_until.0.dart
+++ b/examples/api/lib/widgets/navigator/navigator.restorable_push_and_remove_until.0.dart
@@ -2,38 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Navigator.restorablePushAndRemoveUntil].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Navigator.restorablePushAndRemoveUntil].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const RestorablePushAndRemoveUntilExampleApp());
- static const String _title = 'Flutter Code Sample';
+class RestorablePushAndRemoveUntilExampleApp extends StatelessWidget {
+ const RestorablePushAndRemoveUntilExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: RestorablePushAndRemoveUntilExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class RestorablePushAndRemoveUntilExample extends StatefulWidget {
+ const RestorablePushAndRemoveUntilExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<RestorablePushAndRemoveUntilExample> createState() => _RestorablePushAndRemoveUntilExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _RestorablePushAndRemoveUntilExampleState extends State<RestorablePushAndRemoveUntilExample> {
@pragma('vm:entry-point')
static Route<void> _myRouteBuilder(BuildContext context, Object? arguments) {
return MaterialPageRoute<void>(
- builder: (BuildContext context) => const MyStatefulWidget(),
+ builder: (BuildContext context) => const RestorablePushAndRemoveUntilExample(),
);
}
diff --git a/examples/api/lib/widgets/navigator/navigator.restorable_push_replacement.0.dart b/examples/api/lib/widgets/navigator/navigator.restorable_push_replacement.0.dart
index a210aef..7d5df60 100644
--- a/examples/api/lib/widgets/navigator/navigator.restorable_push_replacement.0.dart
+++ b/examples/api/lib/widgets/navigator/navigator.restorable_push_replacement.0.dart
@@ -2,38 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Navigator.restorablePushReplacement].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Navigator.restorablePushReplacement].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const RestorablePushReplacementExampleApp());
- static const String _title = 'Flutter Code Sample';
+class RestorablePushReplacementExampleApp extends StatelessWidget {
+ const RestorablePushReplacementExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: RestorablePushReplacementExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class RestorablePushReplacementExample extends StatefulWidget {
+ const RestorablePushReplacementExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<RestorablePushReplacementExample> createState() => _RestorablePushReplacementExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _RestorablePushReplacementExampleState extends State<RestorablePushReplacementExample> {
@pragma('vm:entry-point')
static Route<void> _myRouteBuilder(BuildContext context, Object? arguments) {
return MaterialPageRoute<void>(
- builder: (BuildContext context) => const MyStatefulWidget(),
+ builder: (BuildContext context) => const RestorablePushReplacementExample(),
);
}
@@ -44,8 +41,7 @@
title: const Text('Sample Code'),
),
floatingActionButton: FloatingActionButton(
- onPressed: () =>
- Navigator.restorablePushReplacement(context, _myRouteBuilder),
+ onPressed: () => Navigator.restorablePushReplacement(context, _myRouteBuilder),
tooltip: 'Increment Counter',
child: const Icon(Icons.add),
),
diff --git a/examples/api/lib/widgets/navigator/navigator_state.restorable_push.0.dart b/examples/api/lib/widgets/navigator/navigator_state.restorable_push.0.dart
index 3305144..cb45abe 100644
--- a/examples/api/lib/widgets/navigator/navigator_state.restorable_push.0.dart
+++ b/examples/api/lib/widgets/navigator/navigator_state.restorable_push.0.dart
@@ -2,38 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [NavigatorState.restorablePush].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [NavigatorState.restorablePush].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const RestorablePushExampleApp());
- static const String _title = 'Flutter Code Sample';
+class RestorablePushExampleApp extends StatelessWidget {
+ const RestorablePushExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: RestorablePushExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class RestorablePushExample extends StatefulWidget {
+ const RestorablePushExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<RestorablePushExample> createState() => _RestorablePushExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _RestorablePushExampleState extends State<RestorablePushExample> {
@pragma('vm:entry-point')
static Route<void> _myRouteBuilder(BuildContext context, Object? arguments) {
return MaterialPageRoute<void>(
- builder: (BuildContext context) => const MyStatefulWidget(),
+ builder: (BuildContext context) => const RestorablePushExample(),
);
}
diff --git a/examples/api/lib/widgets/navigator/navigator_state.restorable_push_and_remove_until.0.dart b/examples/api/lib/widgets/navigator/navigator_state.restorable_push_and_remove_until.0.dart
index 7634cee..0567ad4 100644
--- a/examples/api/lib/widgets/navigator/navigator_state.restorable_push_and_remove_until.0.dart
+++ b/examples/api/lib/widgets/navigator/navigator_state.restorable_push_and_remove_until.0.dart
@@ -2,38 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [NavigatorState.restorablePushAndRemoveUntil].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [NavigatorState.restorablePushAndRemoveUntil].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const RestorablePushAndRemoveUntilExampleApp());
- static const String _title = 'Flutter Code Sample';
+class RestorablePushAndRemoveUntilExampleApp extends StatelessWidget {
+ const RestorablePushAndRemoveUntilExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: RestorablePushAndRemoveUntilExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class RestorablePushAndRemoveUntilExample extends StatefulWidget {
+ const RestorablePushAndRemoveUntilExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<RestorablePushAndRemoveUntilExample> createState() => _RestorablePushAndRemoveUntilExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _RestorablePushAndRemoveUntilExampleState extends State<RestorablePushAndRemoveUntilExample> {
@pragma('vm:entry-point')
static Route<void> _myRouteBuilder(BuildContext context, Object? arguments) {
return MaterialPageRoute<void>(
- builder: (BuildContext context) => const MyStatefulWidget(),
+ builder: (BuildContext context) => const RestorablePushAndRemoveUntilExample(),
);
}
diff --git a/examples/api/lib/widgets/navigator/navigator_state.restorable_push_replacement.0.dart b/examples/api/lib/widgets/navigator/navigator_state.restorable_push_replacement.0.dart
index 15827da..b22315a 100644
--- a/examples/api/lib/widgets/navigator/navigator_state.restorable_push_replacement.0.dart
+++ b/examples/api/lib/widgets/navigator/navigator_state.restorable_push_replacement.0.dart
@@ -2,38 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [NavigatorState.restorablePushReplacement].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [NavigatorState.restorablePushReplacement].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const RestorablePushReplacementExampleApp());
- static const String _title = 'Flutter Code Sample';
+class RestorablePushReplacementExampleApp extends StatelessWidget {
+ const RestorablePushReplacementExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: RestorablePushReplacementExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class RestorablePushReplacementExample extends StatefulWidget {
+ const RestorablePushReplacementExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<RestorablePushReplacementExample> createState() => _RestorablePushReplacementExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _RestorablePushReplacementExampleState extends State<RestorablePushReplacementExample> {
@pragma('vm:entry-point')
static Route<void> _myRouteBuilder(BuildContext context, Object? arguments) {
return MaterialPageRoute<void>(
- builder: (BuildContext context) => const MyStatefulWidget(),
+ builder: (BuildContext context) => const RestorablePushReplacementExample(),
);
}
diff --git a/examples/api/lib/widgets/navigator/restorable_route_future.0.dart b/examples/api/lib/widgets/navigator/restorable_route_future.0.dart
index 7318bfb..ddf8efc 100644
--- a/examples/api/lib/widgets/navigator/restorable_route_future.0.dart
+++ b/examples/api/lib/widgets/navigator/restorable_route_future.0.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RestorableRouteFuture].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [RestorableRouteFuture].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const RestorableRouteFutureExampleApp());
+
+class RestorableRouteFutureExampleApp extends StatelessWidget {
+ const RestorableRouteFutureExampleApp({super.key});
@override
Widget build(BuildContext context) {
@@ -40,8 +40,7 @@
@override
void initState() {
super.initState();
- _counterRoute = RestorableRouteFuture<int>(
- onPresent: (NavigatorState navigator, Object? arguments) {
+ _counterRoute = RestorableRouteFuture<int>(onPresent: (NavigatorState navigator, Object? arguments) {
// Defines what route should be shown (and how it should be added
// to the navigator) when `RestorableRouteFuture.present` is called.
return navigator.restorablePush(
@@ -74,8 +73,7 @@
// A static `RestorableRouteBuilder` that can re-create the route during
// state restoration.
@pragma('vm:entry-point')
- static Route<int> _counterRouteBuilder(
- BuildContext context, Object? arguments) {
+ static Route<int> _counterRouteBuilder(BuildContext context, Object? arguments) {
return MaterialPageRoute<int>(
builder: (BuildContext context) => MyCounter(
title: arguments!.toString(),
diff --git a/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.0.dart b/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.0.dart
index 7c165b7..1d49cb6 100644
--- a/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.0.dart
+++ b/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.0.dart
@@ -2,28 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [NestedScrollView].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [NestedScrollView].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const NestedScrollViewExampleApp());
- static const String _title = 'Flutter Code Sample';
+class NestedScrollViewExampleApp extends StatelessWidget {
+ const NestedScrollViewExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: NestedScrollViewExample(),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class NestedScrollViewExample extends StatelessWidget {
+ const NestedScrollViewExample({super.key});
@override
Widget build(BuildContext context) {
@@ -43,11 +40,9 @@
// scroll view thinks it has not been scrolled.
// This is not necessary if the "headerSliverBuilder" only builds
// widgets that do not overlap the next sliver.
- handle:
- NestedScrollView.sliverOverlapAbsorberHandleFor(context),
+ handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
sliver: SliverAppBar(
- title:
- const Text('Books'), // This is the title in the app bar.
+ title: const Text('Books'), // This is the title in the app bar.
pinned: true,
expandedHeight: 150.0,
// The "forceElevated" property causes the SliverAppBar to show
@@ -93,9 +88,7 @@
SliverOverlapInjector(
// This is the flip side of the SliverOverlapAbsorber
// above.
- handle:
- NestedScrollView.sliverOverlapAbsorberHandleFor(
- context),
+ handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
),
SliverPadding(
padding: const EdgeInsets.all(8.0),
diff --git a/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.1.dart b/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.1.dart
index c00f2a3..560f18c 100644
--- a/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.1.dart
+++ b/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.1.dart
@@ -2,28 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [NestedScrollView].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [NestedScrollView].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const NestedScrollViewExampleApp());
- static const String _title = 'Flutter Code Sample';
+class NestedScrollViewExampleApp extends StatelessWidget {
+ const NestedScrollViewExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: NestedScrollViewExample(),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class NestedScrollViewExample extends StatelessWidget {
+ const NestedScrollViewExample({super.key});
@override
Widget build(BuildContext context) {
@@ -32,8 +29,7 @@
// Setting floatHeaderSlivers to true is required in order to float
// the outer slivers over the inner scrollable.
floatHeaderSlivers: true,
- headerSliverBuilder:
- (BuildContext context, bool innerBoxIsScrolled) {
+ headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
title: const Text('Floating Nested SliverAppBar'),
diff --git a/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.2.dart b/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.2.dart
index f3acbac..9ed8aae 100644
--- a/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.2.dart
+++ b/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.2.dart
@@ -2,34 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [NestedScrollView].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [NestedScrollView].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const NestedScrollViewExampleApp());
- static const String _title = 'Flutter Code Sample';
+class NestedScrollViewExampleApp extends StatelessWidget {
+ const NestedScrollViewExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: NestedScrollViewExample(),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class NestedScrollViewExample extends StatelessWidget {
+ const NestedScrollViewExample({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
- body: NestedScrollView(headerSliverBuilder:
- (BuildContext context, bool innerBoxIsScrolled) {
+ body: NestedScrollView(headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverOverlapAbsorber(
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
@@ -49,13 +45,11 @@
// If the "controller" property is set, then this scroll view will not
// be associated with the NestedScrollView.
slivers: <Widget>[
- SliverOverlapInjector(
- handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context)),
+ SliverOverlapInjector(handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context)),
SliverFixedExtentList(
itemExtent: 48.0,
delegate: SliverChildBuilderDelegate(
- (BuildContext context, int index) =>
- ListTile(title: Text('Item $index')),
+ (BuildContext context, int index) => ListTile(title: Text('Item $index')),
childCount: 30,
),
),
diff --git a/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view_state.0.dart b/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view_state.0.dart
index 4b27c48..6de7899 100644
--- a/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view_state.0.dart
+++ b/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view_state.0.dart
@@ -2,30 +2,27 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [NestedScrollViewState].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [NestedScrollViewState].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const NestedScrollViewStateExampleApp());
- static const String _title = 'Flutter Code Sample';
+class NestedScrollViewStateExampleApp extends StatelessWidget {
+ const NestedScrollViewStateExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: NestedScrollViewStateExample(),
);
}
}
final GlobalKey<NestedScrollViewState> globalKey = GlobalKey();
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class NestedScrollViewStateExample extends StatelessWidget {
+ const NestedScrollViewStateExample({super.key});
@override
@override
diff --git a/examples/api/lib/widgets/notification_listener/notification.0.dart b/examples/api/lib/widgets/notification_listener/notification.0.dart
index bce2018..40f7040 100644
--- a/examples/api/lib/widgets/notification_listener/notification.0.dart
+++ b/examples/api/lib/widgets/notification_listener/notification.0.dart
@@ -2,28 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Notification].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Notification].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const NotificationExampleApp());
- static const String _title = 'Flutter Code Sample';
+class NotificationExampleApp extends StatelessWidget {
+ const NotificationExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: NotificationExample(),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class NotificationExample extends StatelessWidget {
+ const NotificationExample({super.key});
static const List<String> _tabs = <String>['Months', 'Days'];
static const List<String> _months = <String>[
@@ -54,11 +51,10 @@
return true;
},
child: NestedScrollView(
- headerSliverBuilder:
- (BuildContext context, bool innerBoxIsScrolled) {
+ headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
- title: const Text('Flutter Code Sample'),
+ title: const Text('Notification Sample'),
pinned: true,
floating: true,
bottom: TabBar(
diff --git a/examples/api/lib/widgets/overflow_bar/overflow_bar.0.dart b/examples/api/lib/widgets/overflow_bar/overflow_bar.0.dart
index 338df0d..e870d72 100644
--- a/examples/api/lib/widgets/overflow_bar/overflow_bar.0.dart
+++ b/examples/api/lib/widgets/overflow_bar/overflow_bar.0.dart
@@ -2,33 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [OverflowBar].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [OverflowBar].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const OverflowBarExampleApp());
- static const String _title = 'Flutter Code Sample';
+class OverflowBarExampleApp extends StatelessWidget {
+ const OverflowBarExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('OverflowBar Sample')),
body: const Center(
- child: MyStatelessWidget(),
+ child: OverflowBarExample(),
),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class OverflowBarExample extends StatelessWidget {
+ const OverflowBarExample({super.key});
@override
Widget build(BuildContext context) {
@@ -39,8 +36,7 @@
child: Material(
color: Colors.white,
elevation: 24,
- shape: const RoundedRectangleBorder(
- borderRadius: BorderRadius.all(Radius.circular(4))),
+ shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4))),
child: Padding(
padding: const EdgeInsets.all(8),
child: SingleChildScrollView(
@@ -56,9 +52,7 @@
overflowAlignment: OverflowBarAlignment.end,
children: <Widget>[
TextButton(child: const Text('Cancel'), onPressed: () {}),
- TextButton(
- child: const Text('Really Really Cancel'),
- onPressed: () {}),
+ TextButton(child: const Text('Really Really Cancel'), onPressed: () {}),
OutlinedButton(child: const Text('OK'), onPressed: () {}),
],
),
diff --git a/examples/api/lib/widgets/overlay/overlay.0.dart b/examples/api/lib/widgets/overlay/overlay.0.dart
index fa2bab7..41a769c 100644
--- a/examples/api/lib/widgets/overlay/overlay.0.dart
+++ b/examples/api/lib/widgets/overlay/overlay.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Overlay].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Overlay].
+
void main() => runApp(const OverlayApp());
class OverlayApp extends StatelessWidget {
@@ -65,13 +65,13 @@
children: <Widget>[
Text(
'Explore page',
- style: TextStyle(
- color: Colors.red,
- ),
+ style: TextStyle(
+ color: Colors.red,
),
+ ),
Icon(
Icons.arrow_downward,
- color: Colors.red
+ color: Colors.red,
),
],
);
@@ -80,13 +80,13 @@
children: <Widget>[
Text(
'Commute page',
- style: TextStyle(
- color: Colors.green,
- ),
+ style: TextStyle(
+ color: Colors.green,
),
+ ),
Icon(
Icons.arrow_downward,
- color: Colors.green
+ color: Colors.green,
),
],
);
@@ -95,13 +95,13 @@
children: <Widget>[
Text(
'Saved page',
- style: TextStyle(
- color: Colors.orange,
- ),
+ style: TextStyle(
+ color: Colors.orange,
),
+ ),
Icon(
Icons.arrow_downward,
- color: Colors.orange
+ color: Colors.orange,
),
],
);
diff --git a/examples/api/lib/widgets/overlay/overlay_portal.0.dart b/examples/api/lib/widgets/overlay/overlay_portal.0.dart
index d0465bc..a3fcead 100644
--- a/examples/api/lib/widgets/overlay/overlay_portal.0.dart
+++ b/examples/api/lib/widgets/overlay/overlay_portal.0.dart
@@ -2,19 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for OverlayPortal
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [OverlayPortal].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const OverlayPortalExampleApp());
+
+class OverlayPortalExampleApp extends StatelessWidget {
+ const OverlayPortalExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: 'Flutter Code Sample',
home: Scaffold(
appBar: AppBar(title: const Text('OverlayPortal Example')),
body: const Center(child: ClickableTooltipWidget()),
diff --git a/examples/api/lib/widgets/overscroll_indicator/glowing_overscroll_indicator.0.dart b/examples/api/lib/widgets/overscroll_indicator/glowing_overscroll_indicator.0.dart
index ac9705b..fc695e4 100644
--- a/examples/api/lib/widgets/overscroll_indicator/glowing_overscroll_indicator.0.dart
+++ b/examples/api/lib/widgets/overscroll_indicator/glowing_overscroll_indicator.0.dart
@@ -2,36 +2,32 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [GlowingOverscrollIndicator].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [GlowingOverscrollIndicator].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const GlowingOverscrollIndicatorExampleApp());
- static const String _title = 'Flutter Code Sample';
+class GlowingOverscrollIndicatorExampleApp extends StatelessWidget {
+ const GlowingOverscrollIndicatorExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('GlowingOverscrollIndicator Sample')),
+ body: const GlowingOverscrollIndicatorExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class GlowingOverscrollIndicatorExample extends StatelessWidget {
+ const GlowingOverscrollIndicatorExample({super.key});
@override
Widget build(BuildContext context) {
- final double leadingPaintOffset =
- MediaQuery.of(context).padding.top + AppBar().preferredSize.height;
+ final double leadingPaintOffset = MediaQuery.of(context).padding.top + AppBar().preferredSize.height;
return NotificationListener<OverscrollIndicatorNotification>(
onNotification: (OverscrollIndicatorNotification notification) {
if (notification.leading) {
diff --git a/examples/api/lib/widgets/overscroll_indicator/glowing_overscroll_indicator.1.dart b/examples/api/lib/widgets/overscroll_indicator/glowing_overscroll_indicator.1.dart
index 2ad79f9..a9a5532 100644
--- a/examples/api/lib/widgets/overscroll_indicator/glowing_overscroll_indicator.1.dart
+++ b/examples/api/lib/widgets/overscroll_indicator/glowing_overscroll_indicator.1.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [GlowingOverscrollIndicator].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [GlowingOverscrollIndicator].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const GlowingOverscrollIndicatorExampleApp());
- static const String _title = 'Flutter Code Sample';
+class GlowingOverscrollIndicatorExampleApp extends StatelessWidget {
+ const GlowingOverscrollIndicatorExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('GlowingOverscrollIndicator Sample')),
+ body: const GlowingOverscrollIndicatorExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class GlowingOverscrollIndicatorExample extends StatelessWidget {
+ const GlowingOverscrollIndicatorExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/widgets/page_storage/page_storage.0.dart b/examples/api/lib/widgets/page_storage/page_storage.0.dart
index b6d541e..78c7319 100644
--- a/examples/api/lib/widgets/page_storage/page_storage.0.dart
+++ b/examples/api/lib/widgets/page_storage/page_storage.0.dart
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [PageStorage].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [PageStorage].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const PageStorageExampleApp());
+
+class PageStorageExampleApp extends StatelessWidget {
+ const PageStorageExampleApp({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/widgets/page_view/page_view.0.dart b/examples/api/lib/widgets/page_view/page_view.0.dart
index f21d689..862aafc 100644
--- a/examples/api/lib/widgets/page_view/page_view.0.dart
+++ b/examples/api/lib/widgets/page_view/page_view.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [PageView].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [PageView].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const PageViewExampleApp());
- static const String _title = 'Flutter Code Sample';
+class PageViewExampleApp extends StatelessWidget {
+ const PageViewExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('PageView Sample')),
+ body: const PageViewExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class PageViewExample extends StatelessWidget {
+ const PageViewExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/widgets/preferred_size/preferred_size.0.dart b/examples/api/lib/widgets/preferred_size/preferred_size.0.dart
index e04de9c..8ea542f 100644
--- a/examples/api/lib/widgets/preferred_size/preferred_size.0.dart
+++ b/examples/api/lib/widgets/preferred_size/preferred_size.0.dart
@@ -2,22 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [PreferredSize].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [PreferredSize].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const PreferredSizeExampleApp());
- static const String _title = 'Flutter Code Sample';
+class PreferredSizeExampleApp extends StatelessWidget {
+ const PreferredSizeExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: PreferredSizeExample(),
);
}
}
@@ -63,8 +60,8 @@
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class PreferredSizeExample extends StatelessWidget {
+ const PreferredSizeExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/widgets/restoration/restoration_mixin.0.dart b/examples/api/lib/widgets/restoration/restoration_mixin.0.dart
index 3a4c9e2..5f401a2 100644
--- a/examples/api/lib/widgets/restoration/restoration_mixin.0.dart
+++ b/examples/api/lib/widgets/restoration/restoration_mixin.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RestorationMixin].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [RestorationMixin].
+
void main() => runApp(const RestorationExampleApp());
class RestorationExampleApp extends StatelessWidget {
@@ -32,8 +32,7 @@
// The [State] object uses the [RestorationMixin] to make the current value
// of the counter restorable.
-class _RestorableCounterState extends State<RestorableCounter>
- with RestorationMixin {
+class _RestorableCounterState extends State<RestorableCounter> with RestorationMixin {
// The current value of the counter is stored in a [RestorableProperty].
// During state restoration it is automatically restored to its old value.
// If no restoration data is available to restore the counter from, it is
diff --git a/examples/api/lib/widgets/restoration_properties/restorable_value.0.dart b/examples/api/lib/widgets/restoration_properties/restorable_value.0.dart
index 1b33167..f16a699 100644
--- a/examples/api/lib/widgets/restoration_properties/restorable_value.0.dart
+++ b/examples/api/lib/widgets/restoration_properties/restorable_value.0.dart
@@ -2,41 +2,40 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RestorableValue].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [RestorableValue].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const RestorableValueExampleApp());
+
+class RestorableValueExampleApp extends StatelessWidget {
+ const RestorableValueExampleApp({super.key});
@override
Widget build(BuildContext context) {
return WidgetsApp(
- title: 'Flutter Code Sample',
+ title: 'RestorableValue Sample',
color: const Color(0xffffffff),
builder: (BuildContext context, Widget? child) {
return const Center(
- child: MyStatefulWidget(restorationId: 'main'),
+ child: RestorableValueExample(restorationId: 'main'),
);
},
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key, this.restorationId});
+class RestorableValueExample extends StatefulWidget {
+ const RestorableValueExample({super.key, this.restorationId});
final String? restorationId;
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<RestorableValueExample> createState() => _RestorableValueExampleState();
}
/// RestorationProperty objects can be used because of RestorationMixin.
-class _MyStatefulWidgetState extends State<MyStatefulWidget>
- with RestorationMixin {
+class _RestorableValueExampleState extends State<RestorableValueExample> with RestorationMixin {
// In this example, the restoration ID for the mixin is passed in through
// the [StatefulWidget]'s constructor.
@override
diff --git a/examples/api/lib/widgets/routes/popup_route.0.dart b/examples/api/lib/widgets/routes/popup_route.0.dart
index c3b6a82..ea1384e 100644
--- a/examples/api/lib/widgets/routes/popup_route.0.dart
+++ b/examples/api/lib/widgets/routes/popup_route.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [PopupRoute].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [PopupRoute].
+
void main() => runApp(const PopupRouteApp());
class PopupRouteApp extends StatelessWidget {
diff --git a/examples/api/lib/widgets/routes/show_general_dialog.0.dart b/examples/api/lib/widgets/routes/show_general_dialog.0.dart
index 33073c8..339a2ce 100644
--- a/examples/api/lib/widgets/routes/show_general_dialog.0.dart
+++ b/examples/api/lib/widgets/routes/show_general_dialog.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [showGeneralDialog].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [showGeneralDialog].
+
void main() => runApp(const GeneralDialogApp());
class GeneralDialogApp extends StatelessWidget {
@@ -39,8 +39,7 @@
}
@pragma('vm:entry-point')
- static Route<Object?> _dialogBuilder(
- BuildContext context, Object? arguments) {
+ static Route<Object?> _dialogBuilder(BuildContext context, Object? arguments) {
return RawDialogRoute<void>(
pageBuilder: (
BuildContext context,
diff --git a/examples/api/lib/widgets/scroll_position/scroll_metrics_notification.0.dart b/examples/api/lib/widgets/scroll_position/scroll_metrics_notification.0.dart
index a667161..cd53ffc 100644
--- a/examples/api/lib/widgets/scroll_position/scroll_metrics_notification.0.dart
+++ b/examples/api/lib/widgets/scroll_position/scroll_metrics_notification.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ScrollMetricsNotification].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ScrollMetricsNotification].
+
void main() => runApp(const ScrollMetricsDemo());
class ScrollMetricsDemo extends StatefulWidget {
diff --git a/examples/api/lib/widgets/scroll_view/custom_scroll_view.1.dart b/examples/api/lib/widgets/scroll_view/custom_scroll_view.1.dart
index 2822dad..213175d 100644
--- a/examples/api/lib/widgets/scroll_view/custom_scroll_view.1.dart
+++ b/examples/api/lib/widgets/scroll_view/custom_scroll_view.1.dart
@@ -2,34 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CustomScrollView].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [CustomScrollView].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const CustomScrollViewExampleApp());
- static const String _title = 'Flutter Code Sample';
+class CustomScrollViewExampleApp extends StatelessWidget {
+ const CustomScrollViewExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: CustomScrollViewExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class CustomScrollViewExample extends StatefulWidget {
+ const CustomScrollViewExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<CustomScrollViewExample> createState() => _CustomScrollViewExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _CustomScrollViewExampleState extends State<CustomScrollViewExample> {
List<int> top = <int>[];
List<int> bottom = <int>[0];
diff --git a/examples/api/lib/widgets/scroll_view/listview_select.1.dart b/examples/api/lib/widgets/scroll_view/list_view.0.dart
similarity index 89%
rename from examples/api/lib/widgets/scroll_view/listview_select.1.dart
rename to examples/api/lib/widgets/scroll_view/list_view.0.dart
index d1e915f..954995f 100644
--- a/examples/api/lib/widgets/scroll_view/listview_select.1.dart
+++ b/examples/api/lib/widgets/scroll_view/list_view.0.dart
@@ -2,22 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ListTile] selection in a ListView or GridView.
-// Long press any ListTile to enable selection mode.
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [ListTile] selection in a [ListView] or [GridView].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ListViewExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ListViewExampleApp extends StatelessWidget {
+ const ListViewExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
home: ListTileSelectExample(),
);
}
@@ -104,8 +100,7 @@
onPressed: () {
_selectAll = !_selectAll;
setState(() {
- _selected =
- List<bool>.generate(listLength, (_) => _selectAll);
+ _selected = List<bool>.generate(listLength, (_) => _selectAll);
});
}),
],
@@ -161,8 +156,7 @@
Widget build(BuildContext context) {
return GridView.builder(
itemCount: widget.selectedList.length,
- gridDelegate:
- const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2),
+ gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2),
itemBuilder: (_, int index) {
return InkWell(
onTap: () => _toggle(index),
@@ -177,9 +171,7 @@
child: GridTile(
child: Container(
child: widget.isSelectionMode
- ? Checkbox(
- onChanged: (bool? x) => _toggle(index),
- value: widget.selectedList[index])
+ ? Checkbox(onChanged: (bool? x) => _toggle(index), value: widget.selectedList[index])
: const Icon(Icons.image),
)),
);
diff --git a/examples/api/lib/widgets/scrollbar/raw_scrollbar.0.dart b/examples/api/lib/widgets/scrollbar/raw_scrollbar.0.dart
index c8e0ac0..c707aa1 100644
--- a/examples/api/lib/widgets/scrollbar/raw_scrollbar.0.dart
+++ b/examples/api/lib/widgets/scrollbar/raw_scrollbar.0.dart
@@ -2,45 +2,41 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RawScrollbar].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [RawScrollbar].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const RawScrollbarExampleApp());
- static const String _title = 'Flutter Code Sample';
+class RawScrollbarExampleApp extends StatelessWidget {
+ const RawScrollbarExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('RawScrollbar Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: RawScrollbarExample(),
),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class RawScrollbarExample extends StatefulWidget {
+ const RawScrollbarExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<RawScrollbarExample> createState() => _RawScrollbarExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _RawScrollbarExampleState extends State<RawScrollbarExample> {
final ScrollController _firstController = ScrollController();
@override
Widget build(BuildContext context) {
- return LayoutBuilder(
- builder: (BuildContext context, BoxConstraints constraints) {
+ return LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) {
return Row(
children: <Widget>[
SizedBox(
@@ -78,9 +74,7 @@
itemBuilder: (BuildContext context, int index) {
return Container(
height: 50,
- color: index.isEven
- ? Colors.amberAccent
- : Colors.blueAccent,
+ color: index.isEven ? Colors.amberAccent : Colors.blueAccent,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text('Scrollable 2 : Index $index'),
diff --git a/examples/api/lib/widgets/scrollbar/raw_scrollbar.1.dart b/examples/api/lib/widgets/scrollbar/raw_scrollbar.1.dart
index 4b5ed24..2ff22cf 100644
--- a/examples/api/lib/widgets/scrollbar/raw_scrollbar.1.dart
+++ b/examples/api/lib/widgets/scrollbar/raw_scrollbar.1.dart
@@ -2,39 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RawScrollbar].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [RawScrollbar].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const RawScrollbarExampleApp());
- static const String _title = 'Flutter Code Sample';
+class RawScrollbarExampleApp extends StatelessWidget {
+ const RawScrollbarExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('RawScrollbar Sample')),
+ body: const RawScrollbarExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class RawScrollbarExample extends StatelessWidget {
+ const RawScrollbarExample({super.key});
@override
Widget build(BuildContext context) {
return RawScrollbar(
child: GridView.builder(
itemCount: 120,
- gridDelegate:
- const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
+ gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
itemBuilder: (BuildContext context, int index) {
return Center(
child: Text('item $index'),
diff --git a/examples/api/lib/widgets/scrollbar/raw_scrollbar.2.dart b/examples/api/lib/widgets/scrollbar/raw_scrollbar.2.dart
index 72447b5..f8aeb10 100644
--- a/examples/api/lib/widgets/scrollbar/raw_scrollbar.2.dart
+++ b/examples/api/lib/widgets/scrollbar/raw_scrollbar.2.dart
@@ -2,37 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RawScrollbar].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [RawScrollbar].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const RawScrollbarExampleApp());
- static const String _title = 'Flutter Code Sample';
+class RawScrollbarExampleApp extends StatelessWidget {
+ const RawScrollbarExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatefulWidget(),
+ appBar: AppBar(title: const Text('RawScrollbar Sample')),
+ body: const RawScrollbarExample(),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class RawScrollbarExample extends StatefulWidget {
+ const RawScrollbarExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<RawScrollbarExample> createState() => _RawScrollbarExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _RawScrollbarExampleState extends State<RawScrollbarExample> {
final ScrollController _controllerOne = ScrollController();
@override
@@ -43,8 +40,7 @@
child: GridView.builder(
controller: _controllerOne,
itemCount: 120,
- gridDelegate:
- const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
+ gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
itemBuilder: (BuildContext context, int index) {
return Center(
child: Text('item $index'),
diff --git a/examples/api/lib/widgets/scrollbar/raw_scrollbar.desktop.0.dart b/examples/api/lib/widgets/scrollbar/raw_scrollbar.desktop.0.dart
index 31d231b..b917dac 100644
--- a/examples/api/lib/widgets/scrollbar/raw_scrollbar.desktop.0.dart
+++ b/examples/api/lib/widgets/scrollbar/raw_scrollbar.desktop.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Scrollbar].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [Scrollbar].
+
void main() => runApp(const ScrollbarApp());
class ScrollbarApp extends StatelessWidget {
@@ -17,27 +17,26 @@
home: Scaffold(
appBar: AppBar(title: const Text('Scrollbar Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: DesktopExample(),
),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class DesktopExample extends StatefulWidget {
+ const DesktopExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<DesktopExample> createState() => _DesktopExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _DesktopExampleState extends State<DesktopExample> {
final ScrollController controller = ScrollController();
@override
Widget build(BuildContext context) {
- return LayoutBuilder(
- builder: (BuildContext context, BoxConstraints constraints) {
+ return LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) {
return Row(
children: <Widget>[
SizedBox(
@@ -73,8 +72,7 @@
thickness: 20.0,
thumbVisibility: true,
child: ScrollConfiguration(
- behavior: ScrollConfiguration.of(context)
- .copyWith(scrollbars: false),
+ behavior: ScrollConfiguration.of(context).copyWith(scrollbars: false),
child: ListView.builder(
primary: true,
itemCount: 100,
diff --git a/examples/api/lib/widgets/scrollbar/raw_scrollbar.shape.0.dart b/examples/api/lib/widgets/scrollbar/raw_scrollbar.shape.0.dart
index dd58df9..1993cc5 100644
--- a/examples/api/lib/widgets/scrollbar/raw_scrollbar.shape.0.dart
+++ b/examples/api/lib/widgets/scrollbar/raw_scrollbar.shape.0.dart
@@ -2,35 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RawScrollbar.shape].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [RawScrollbar.shape].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ShapeExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ShapeExampleApp extends StatelessWidget {
+ const ShapeExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: ShapeExample(),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class ShapeExample extends StatelessWidget {
+ const ShapeExample({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: RawScrollbar(
- shape: const StadiumBorder(
- side: BorderSide(color: Colors.brown, width: 3.0)),
+ shape: const StadiumBorder(side: BorderSide(color: Colors.brown, width: 3.0)),
thickness: 15.0,
thumbColor: Colors.blue,
thumbVisibility: true,
@@ -41,8 +37,7 @@
// PrimaryScrollController requires ScrollView.primary be set.
primary: true,
physics: const BouncingScrollPhysics(),
- children: List<Text>.generate(
- 100, (int index) => Text((index * index).toString())),
+ children: List<Text>.generate(100, (int index) => Text((index * index).toString())),
),
),
);
diff --git a/examples/api/lib/widgets/shared_app_data/shared_app_data.0.dart b/examples/api/lib/widgets/shared_app_data/shared_app_data.0.dart
index 8063eab..2a2c698 100644
--- a/examples/api/lib/widgets/shared_app_data/shared_app_data.0.dart
+++ b/examples/api/lib/widgets/shared_app_data/shared_app_data.0.dart
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SharedAppData].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [SharedAppData].
+
class ShowSharedValue extends StatelessWidget {
- const ShowSharedValue({ super.key, required this.appDataKey });
+ const ShowSharedValue({super.key, required this.appDataKey});
final String appDataKey;
@@ -25,7 +25,7 @@
// widgets to be rebuilt. In this case that's the ShowSharedValue widget that's
// displaying the value of a key whose value has been updated.
class Home extends StatefulWidget {
- const Home({ super.key });
+ const Home({super.key});
@override
State<Home> createState() => _HomeState();
@@ -52,7 +52,8 @@
_fooVersion += 1;
// Changing the SharedAppData's value for 'foo' causes the
// widgets that depend on 'foo' to be rebuilt.
- SharedAppData.setValue<String, String?>(context, 'foo', 'FOO $_fooVersion'); // no need to call setState()
+ SharedAppData.setValue<String, String?>(
+ context, 'foo', 'FOO $_fooVersion'); // no need to call setState()
},
),
const SizedBox(height: 16),
@@ -60,7 +61,8 @@
child: const Text('change bar'),
onPressed: () {
_barVersion += 1;
- SharedAppData.setValue<String, String?>(context, 'bar', 'BAR $_barVersion'); // no need to call setState()
+ SharedAppData.setValue<String, String?>(
+ context, 'bar', 'BAR $_barVersion'); // no need to call setState()
},
),
],
diff --git a/examples/api/lib/widgets/shared_app_data/shared_app_data.1.dart b/examples/api/lib/widgets/shared_app_data/shared_app_data.1.dart
index 123e2bc..76b081e 100644
--- a/examples/api/lib/widgets/shared_app_data/shared_app_data.1.dart
+++ b/examples/api/lib/widgets/shared_app_data/shared_app_data.1.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SharedAppData].
-
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
+/// Flutter code sample for [SharedAppData].
+
// A single lazily-constructed object that's shared with the entire application
// via `SharedObject.of(context)`. The value of the object can be changed with
// `SharedObject.reset(context)`. Resetting the value will cause all of the
@@ -34,7 +34,7 @@
// An example of a widget which depends on the SharedObject's value, which might
// be provided - along with SharedObject - in a Dart package.
class CustomWidget extends StatelessWidget {
- const CustomWidget({ super.key });
+ const CustomWidget({super.key});
@override
Widget build(BuildContext context) {
@@ -49,14 +49,12 @@
}
class Home extends StatelessWidget {
- const Home({ super.key });
+ const Home({super.key});
@override
Widget build(BuildContext context) {
return const Scaffold(
- body: Center(
- child: CustomWidget()
- ),
+ body: Center(child: CustomWidget()),
);
}
}
diff --git a/examples/api/lib/widgets/shortcuts/character_activator.0.dart b/examples/api/lib/widgets/shortcuts/character_activator.0.dart
index 56ed8a4..08e703c 100644
--- a/examples/api/lib/widgets/shortcuts/character_activator.0.dart
+++ b/examples/api/lib/widgets/shortcuts/character_activator.0.dart
@@ -2,25 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [CharacterActivator].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [CharacterActivator].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const CharacterActivatorExampleApp());
- static const String _title = 'Flutter Code Sample';
+class CharacterActivatorExampleApp extends StatelessWidget {
+ const CharacterActivatorExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('CharacterActivator Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: CharacterActivatorExample(),
),
),
);
@@ -31,14 +28,14 @@
const HelpMenuIntent();
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class CharacterActivatorExample extends StatefulWidget {
+ const CharacterActivatorExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<CharacterActivatorExample> createState() => _CharacterActivatorExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _CharacterActivatorExampleState extends State<CharacterActivatorExample> {
@override
Widget build(BuildContext context) {
return Shortcuts(
diff --git a/examples/api/lib/widgets/shortcuts/logical_key_set.0.dart b/examples/api/lib/widgets/shortcuts/logical_key_set.0.dart
index 6a35565..e784c72 100644
--- a/examples/api/lib/widgets/shortcuts/logical_key_set.0.dart
+++ b/examples/api/lib/widgets/shortcuts/logical_key_set.0.dart
@@ -2,26 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [LogicalKeySet].
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [LogicalKeySet].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const LogicalKeySetExampleApp());
- static const String _title = 'Flutter Code Sample';
+class LogicalKeySetExampleApp extends StatelessWidget {
+ const LogicalKeySetExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('LogicalKeySet Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: LogicalKeySetExample(),
),
),
);
@@ -32,22 +29,21 @@
const IncrementIntent();
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class LogicalKeySetExample extends StatefulWidget {
+ const LogicalKeySetExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<LogicalKeySetExample> createState() => _LogicalKeySetExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _LogicalKeySetExampleState extends State<LogicalKeySetExample> {
int count = 0;
@override
Widget build(BuildContext context) {
return Shortcuts(
shortcuts: <ShortcutActivator, Intent>{
- LogicalKeySet(LogicalKeyboardKey.keyC, LogicalKeyboardKey.controlLeft):
- const IncrementIntent(),
+ LogicalKeySet(LogicalKeyboardKey.keyC, LogicalKeyboardKey.controlLeft): const IncrementIntent(),
},
child: Actions(
actions: <Type, Action<Intent>>{
diff --git a/examples/api/lib/widgets/shortcuts/shortcuts.0.dart b/examples/api/lib/widgets/shortcuts/shortcuts.0.dart
index 772ef74..d88825c 100644
--- a/examples/api/lib/widgets/shortcuts/shortcuts.0.dart
+++ b/examples/api/lib/widgets/shortcuts/shortcuts.0.dart
@@ -2,26 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Shortcuts].
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Shortcuts].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ShortcutsExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ShortcutsExampleApp extends StatelessWidget {
+ const ShortcutsExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('Shortcuts Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: ShortcutsExample(),
),
),
);
@@ -36,14 +33,14 @@
const DecrementIntent();
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class ShortcutsExample extends StatefulWidget {
+ const ShortcutsExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<ShortcutsExample> createState() => _ShortcutsExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _ShortcutsExampleState extends State<ShortcutsExample> {
int count = 0;
@override
@@ -71,8 +68,7 @@
child: Column(
children: <Widget>[
const Text('Add to the counter by pressing the up arrow key'),
- const Text(
- 'Subtract from the counter by pressing the down arrow key'),
+ const Text('Subtract from the counter by pressing the down arrow key'),
Text('count: $count'),
],
),
diff --git a/examples/api/lib/widgets/shortcuts/shortcuts.1.dart b/examples/api/lib/widgets/shortcuts/shortcuts.1.dart
index 81964d0..6f1281d 100644
--- a/examples/api/lib/widgets/shortcuts/shortcuts.1.dart
+++ b/examples/api/lib/widgets/shortcuts/shortcuts.1.dart
@@ -2,26 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Shortcuts].
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Shortcuts].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ShortcutsExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ShortcutsExampleApp extends StatelessWidget {
+ const ShortcutsExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('Shortcuts Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: ShortcutsExample(),
),
),
);
@@ -75,14 +72,14 @@
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class ShortcutsExample extends StatefulWidget {
+ const ShortcutsExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<ShortcutsExample> createState() => _ShortcutsExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _ShortcutsExampleState extends State<ShortcutsExample> {
Model model = Model();
@override
@@ -102,8 +99,7 @@
child: Column(
children: <Widget>[
const Text('Add to the counter by pressing the up arrow key'),
- const Text(
- 'Subtract from the counter by pressing the down arrow key'),
+ const Text('Subtract from the counter by pressing the down arrow key'),
AnimatedBuilder(
animation: model,
builder: (BuildContext context, Widget? child) {
diff --git a/examples/api/lib/widgets/shortcuts/single_activator.single_activator.0.dart b/examples/api/lib/widgets/shortcuts/single_activator.single_activator.0.dart
index 30973a0..5cb5eb8 100644
--- a/examples/api/lib/widgets/shortcuts/single_activator.single_activator.0.dart
+++ b/examples/api/lib/widgets/shortcuts/single_activator.single_activator.0.dart
@@ -2,26 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SingleActivator.SingleActivator].
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SingleActivator.SingleActivator].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SingleActivatorExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SingleActivatorExampleApp extends StatelessWidget {
+ const SingleActivatorExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('SingleActivator Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: SingleActivatorExample(),
),
),
);
@@ -32,22 +29,21 @@
const IncrementIntent();
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class SingleActivatorExample extends StatefulWidget {
+ const SingleActivatorExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<SingleActivatorExample> createState() => _SingleActivatorExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _SingleActivatorExampleState extends State<SingleActivatorExample> {
int count = 0;
@override
Widget build(BuildContext context) {
return Shortcuts(
shortcuts: const <ShortcutActivator, Intent>{
- SingleActivator(LogicalKeyboardKey.keyC, control: true):
- IncrementIntent(),
+ SingleActivator(LogicalKeyboardKey.keyC, control: true): IncrementIntent(),
},
child: Actions(
actions: <Type, Action<Intent>>{
diff --git a/examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.0.dart b/examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.0.dart
index 110c5b1..c0be195 100644
--- a/examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.0.dart
+++ b/examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.0.dart
@@ -2,28 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SingleChildScrollView].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SingleChildScrollView].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SingleChildScrollViewExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SingleChildScrollViewExampleApp extends StatelessWidget {
+ const SingleChildScrollViewExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: SingleChildScrollViewExample(),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class SingleChildScrollViewExample extends StatelessWidget {
+ const SingleChildScrollViewExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.1.dart b/examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.1.dart
index 4a82db2..9a21cb2 100644
--- a/examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.1.dart
+++ b/examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.1.dart
@@ -2,28 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SingleChildScrollView].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SingleChildScrollView].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SingleChildScrollViewExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SingleChildScrollViewExampleApp extends StatelessWidget {
+ const SingleChildScrollViewExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatelessWidget(),
+ home: SingleChildScrollViewExample(),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class SingleChildScrollViewExample extends StatelessWidget {
+ const SingleChildScrollViewExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/widgets/sliver/sliver_opacity.1.dart b/examples/api/lib/widgets/sliver/sliver_opacity.1.dart
index 64e0434..e2ea349 100644
--- a/examples/api/lib/widgets/sliver/sliver_opacity.1.dart
+++ b/examples/api/lib/widgets/sliver/sliver_opacity.1.dart
@@ -2,34 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SliverOpacity].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SliverOpacity].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SliverOpacityExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SliverOpacityExampleApp extends StatelessWidget {
+ const SliverOpacityExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: SliverOpacityExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class SliverOpacityExample extends StatefulWidget {
+ const SliverOpacityExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<SliverOpacityExample> createState() => _SliverOpacityExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _SliverOpacityExampleState extends State<SliverOpacityExample> {
static const List<Widget> _listItems = <Widget>[
ListTile(title: Text('Now you see me,')),
ListTile(title: Text("Now you don't!")),
diff --git a/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.0.dart b/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.0.dart
index bc34e5c..fe5c745 100644
--- a/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.0.dart
+++ b/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SliverFillRemaining].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SliverFillRemaining].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SliverFillRemainingExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SliverFillRemainingExampleApp extends StatelessWidget {
+ const SliverFillRemainingExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('SliverFillRemaining Sample')),
+ body: const SliverFillRemainingExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class SliverFillRemainingExample extends StatelessWidget {
+ const SliverFillRemainingExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.1.dart b/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.1.dart
index b31b70b..5d0f4c8 100644
--- a/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.1.dart
+++ b/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.1.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SliverFillRemaining].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SliverFillRemaining].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SliverFillRemainingExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SliverFillRemainingExampleApp extends StatelessWidget {
+ const SliverFillRemainingExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('SliverFillRemaining Sample')),
+ body: const SliverFillRemainingExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class SliverFillRemainingExample extends StatelessWidget {
+ const SliverFillRemainingExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.2.dart b/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.2.dart
index fa4a748..5f3fff4 100644
--- a/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.2.dart
+++ b/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.2.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SliverFillRemaining].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SliverFillRemaining].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SliverFillRemainingExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SliverFillRemainingExampleApp extends StatelessWidget {
+ const SliverFillRemainingExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('SliverFillRemaining Sample')),
+ body: const SliverFillRemainingExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class SliverFillRemainingExample extends StatelessWidget {
+ const SliverFillRemainingExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.3.dart b/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.3.dart
index 84db1ee..45d8626 100644
--- a/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.3.dart
+++ b/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.3.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SliverFillRemaining].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SliverFillRemaining].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SliverFillRemainingExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SliverFillRemainingExampleApp extends StatelessWidget {
+ const SliverFillRemainingExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('SliverFillRemaining Sample')),
+ body: const SliverFillRemainingExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class SliverFillRemainingExample extends StatelessWidget {
+ const SliverFillRemainingExample({super.key});
@override
Widget build(BuildContext context) {
@@ -38,8 +35,7 @@
// example, which are provided by default on the iOS platform.
// BouncingScrollPhysics is combined with AlwaysScrollableScrollPhysics to
// allow for the overscroll, regardless of the depth of the scrollable.
- physics:
- const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),
+ physics: const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),
slivers: <Widget>[
SliverToBoxAdapter(
child: Container(
diff --git a/examples/api/lib/widgets/slotted_render_object_widget/slotted_multi_child_render_object_widget_mixin.0.dart b/examples/api/lib/widgets/slotted_render_object_widget/slotted_multi_child_render_object_widget_mixin.0.dart
index f623709..e93e5f9 100644
--- a/examples/api/lib/widgets/slotted_render_object_widget/slotted_multi_child_render_object_widget_mixin.0.dart
+++ b/examples/api/lib/widgets/slotted_render_object_widget/slotted_multi_child_render_object_widget_mixin.0.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SlottedMultiChildRenderObjectWidgetMixin].
-
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
+/// Flutter code sample for [SlottedMultiChildRenderObjectWidgetMixin].
+
/// Slots used for the children of [Diagonal] and [RenderDiagonal].
enum DiagonalSlot {
topLeft,
@@ -69,7 +69,8 @@
/// A render object that demonstrates the usage of
/// [SlottedContainerRenderObjectMixin] by providing slots for two children that
/// will be arranged diagonally.
-class RenderDiagonal extends RenderBox with SlottedContainerRenderObjectMixin<DiagonalSlot>, DebugOverflowIndicatorMixin {
+class RenderDiagonal extends RenderBox
+ with SlottedContainerRenderObjectMixin<DiagonalSlot>, DebugOverflowIndicatorMixin {
RenderDiagonal({Color? backgroundColor}) : _backgroundColor = backgroundColor;
// Getters and setters to configure the [RenderObject] with the configuration
@@ -100,10 +101,8 @@
@override
Iterable<RenderBox> get children {
return <RenderBox>[
- if (_topLeft != null)
- _topLeft!,
- if (_bottomRight != null)
- _bottomRight!,
+ if (_topLeft != null) _topLeft!,
+ if (_bottomRight != null) _bottomRight!,
];
}
@@ -157,8 +156,7 @@
if (backgroundColor != null) {
context.canvas.drawRect(
offset & size,
- Paint()
- ..color = backgroundColor!,
+ Paint()..color = backgroundColor!,
);
}
@@ -193,7 +191,7 @@
// HIT TEST
@override
- bool hitTestChildren(BoxHitTestResult result, { required Offset position }) {
+ bool hitTestChildren(BoxHitTestResult result, {required Offset position}) {
for (final RenderBox child in children) {
final BoxParentData parentData = child.parentData! as BoxParentData;
final bool isHit = result.addWithPaintOffset(
@@ -226,7 +224,8 @@
double computeMaxIntrinsicWidth(double height) {
final double topLeftWidth = _topLeft?.getMaxIntrinsicWidth(double.infinity) ?? 0;
final double bottomRightWith = _bottomRight?.getMaxIntrinsicWidth(double.infinity) ?? 0;
- return topLeftWidth + bottomRightWith; }
+ return topLeftWidth + bottomRightWith;
+ }
@override
double computeMinIntrinsicHeight(double width) {
diff --git a/examples/api/lib/widgets/table/table.0.dart b/examples/api/lib/widgets/table/table.0.dart
index c917ccd..531b6e9 100644
--- a/examples/api/lib/widgets/table/table.0.dart
+++ b/examples/api/lib/widgets/table/table.0.dart
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [Table].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [Table].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const TableExampleApp());
- static const String _title = 'Flutter Code Sample';
+class TableExampleApp extends StatelessWidget {
+ const TableExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
- body: const MyStatelessWidget(),
+ appBar: AppBar(title: const Text('Table Sample')),
+ body: const TableExample(),
),
);
}
}
-class MyStatelessWidget extends StatelessWidget {
- const MyStatelessWidget({super.key});
+class TableExample extends StatelessWidget {
+ const TableExample({super.key});
@override
Widget build(BuildContext context) {
diff --git a/examples/api/lib/widgets/tap_region/text_field_tap_region.0.dart b/examples/api/lib/widgets/tap_region/text_field_tap_region.0.dart
index a755ebe..e4e08a4 100644
--- a/examples/api/lib/widgets/tap_region/text_field_tap_region.0.dart
+++ b/examples/api/lib/widgets/tap_region/text_field_tap_region.0.dart
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [TextFieldTapRegion].
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
+/// Flutter code sample for [TextFieldTapRegion].
+
void main() => runApp(const TapRegionApp());
class TapRegionApp extends StatelessWidget {
diff --git a/examples/api/lib/widgets/text/text.0.dart b/examples/api/lib/widgets/text/text.0.dart
index 5a97202..26ea189 100644
--- a/examples/api/lib/widgets/text/text.0.dart
+++ b/examples/api/lib/widgets/text/text.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [DefaultTextStyle].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [DefaultTextStyle].
+
void main() => runApp(const DefaultTextStyleApp());
class DefaultTextStyleApp extends StatelessWidget {
diff --git a/examples/api/lib/widgets/text_magnifier/text_magnifier.0.dart b/examples/api/lib/widgets/text_magnifier/text_magnifier.0.dart
index 86501d6..4afc7dc 100644
--- a/examples/api/lib/widgets/text_magnifier/text_magnifier.0.dart
+++ b/examples/api/lib/widgets/text_magnifier/text_magnifier.0.dart
@@ -5,10 +5,10 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp(text: 'Hello world!'));
+void main() => runApp(const TextMagnifierExampleApp(text: 'Hello world!'));
-class MyApp extends StatelessWidget {
- const MyApp({
+class TextMagnifierExampleApp extends StatelessWidget {
+ const TextMagnifierExampleApp({
super.key,
this.textDirection = TextDirection.ltr,
required this.text,
@@ -62,8 +62,7 @@
// positioning cases.
return ValueListenableBuilder<MagnifierInfo>(
valueListenable: magnifierInfo,
- builder: (BuildContext context,
- MagnifierInfo currentMagnifierInfo, _) {
+ builder: (BuildContext context, MagnifierInfo currentMagnifierInfo, _) {
// We want to position the magnifier at the global position of the gesture.
Offset magnifierPosition = currentMagnifierInfo.globalGesturePosition;
diff --git a/examples/api/lib/widgets/transitions/align_transition.0.dart b/examples/api/lib/widgets/transitions/align_transition.0.dart
index a978846..fa7118c 100644
--- a/examples/api/lib/widgets/transitions/align_transition.0.dart
+++ b/examples/api/lib/widgets/transitions/align_transition.0.dart
@@ -2,37 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AlignTransition].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [AlignTransition].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const AlignTransitionExampleApp());
- static const String _title = 'Flutter Code Sample';
+class AlignTransitionExampleApp extends StatelessWidget {
+ const AlignTransitionExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: AlignTransitionExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class AlignTransitionExample extends StatefulWidget {
+ const AlignTransitionExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<AlignTransitionExample> createState() => _AlignTransitionExampleState();
}
/// [AnimationController]s can be created with `vsync: this` because of
/// [TickerProviderStateMixin].
-class _MyStatefulWidgetState extends State<MyStatefulWidget>
- with TickerProviderStateMixin {
+class _AlignTransitionExampleState extends State<AlignTransitionExample> with TickerProviderStateMixin {
// Using `late final` for lazy initialization. See
// https://dart.dev/null-safety/understanding-null-safety#lazy-initialization.
late final AnimationController _controller = AnimationController(
diff --git a/examples/api/lib/widgets/transitions/animated_builder.0.dart b/examples/api/lib/widgets/transitions/animated_builder.0.dart
index 49d4d81..89abd21 100644
--- a/examples/api/lib/widgets/transitions/animated_builder.0.dart
+++ b/examples/api/lib/widgets/transitions/animated_builder.0.dart
@@ -2,39 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AnimatedBuilder].
-
import 'dart:math' as math;
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [AnimatedBuilder].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const AnimatedBuilderExampleApp());
- static const String _title = 'Flutter Code Sample';
+class AnimatedBuilderExampleApp extends StatelessWidget {
+ const AnimatedBuilderExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: AnimatedBuilderExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class AnimatedBuilderExample extends StatefulWidget {
+ const AnimatedBuilderExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<AnimatedBuilderExample> createState() => _AnimatedBuilderExampleState();
}
/// AnimationControllers can be created with `vsync: this` because of
/// TickerProviderStateMixin.
-class _MyStatefulWidgetState extends State<MyStatefulWidget>
- with TickerProviderStateMixin {
+class _AnimatedBuilderExampleState extends State<AnimatedBuilderExample> with TickerProviderStateMixin {
late final AnimationController _controller = AnimationController(
duration: const Duration(seconds: 10),
vsync: this,
diff --git a/examples/api/lib/widgets/transitions/animated_widget.0.dart b/examples/api/lib/widgets/transitions/animated_widget.0.dart
index 1ab888e..93c98bc 100644
--- a/examples/api/lib/widgets/transitions/animated_widget.0.dart
+++ b/examples/api/lib/widgets/transitions/animated_widget.0.dart
@@ -2,24 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [AnimatedWidget].
-
import 'dart:math' as math;
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [AnimatedWidget].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const AnimatedWidgetExampleApp());
- static const String _title = 'Flutter Code Sample';
+class AnimatedWidgetExampleApp extends StatelessWidget {
+ const AnimatedWidgetExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: AnimatedWidgetExample(),
);
}
}
@@ -41,17 +38,16 @@
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class AnimatedWidgetExample extends StatefulWidget {
+ const AnimatedWidgetExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<AnimatedWidgetExample> createState() => _AnimatedWidgetExampleState();
}
/// [AnimationController]s can be created with `vsync: this` because of
/// [TickerProviderStateMixin].
-class _MyStatefulWidgetState extends State<MyStatefulWidget>
- with TickerProviderStateMixin {
+class _AnimatedWidgetExampleState extends State<AnimatedWidgetExample> with TickerProviderStateMixin {
late final AnimationController _controller = AnimationController(
duration: const Duration(seconds: 10),
vsync: this,
diff --git a/examples/api/lib/widgets/transitions/decorated_box_transition.0.dart b/examples/api/lib/widgets/transitions/decorated_box_transition.0.dart
index 703b44f..2ff7ef3 100644
--- a/examples/api/lib/widgets/transitions/decorated_box_transition.0.dart
+++ b/examples/api/lib/widgets/transitions/decorated_box_transition.0.dart
@@ -2,37 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [DecoratedBoxTransition].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [DecoratedBoxTransition].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const DecoratedBoxTransitionExampleApp());
- static const String _title = 'Flutter Code Sample';
+class DecoratedBoxTransitionExampleApp extends StatelessWidget {
+ const DecoratedBoxTransitionExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: DecoratedBoxTransitionExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class DecoratedBoxTransitionExample extends StatefulWidget {
+ const DecoratedBoxTransitionExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<DecoratedBoxTransitionExample> createState() => _DecoratedBoxTransitionExampleState();
}
/// [AnimationController]s can be created with `vsync: this` because of
/// [TickerProviderStateMixin].
-class _MyStatefulWidgetState extends State<MyStatefulWidget>
- with TickerProviderStateMixin {
+class _DecoratedBoxTransitionExampleState extends State<DecoratedBoxTransitionExample> with TickerProviderStateMixin {
final DecorationTween decorationTween = DecorationTween(
begin: BoxDecoration(
color: const Color(0xFFFFFFFF),
diff --git a/examples/api/lib/widgets/transitions/default_text_style_transition.0.dart b/examples/api/lib/widgets/transitions/default_text_style_transition.0.dart
index 92185eb..bd62f97 100644
--- a/examples/api/lib/widgets/transitions/default_text_style_transition.0.dart
+++ b/examples/api/lib/widgets/transitions/default_text_style_transition.0.dart
@@ -2,36 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [DefaultTextStyleTransition].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [DefaultTextStyleTransition].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const DefaultTextStyleTransitionExampleApp());
- static const String _title = 'Flutter Code Sample';
+class DefaultTextStyleTransitionExampleApp extends StatelessWidget {
+ const DefaultTextStyleTransitionExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: DefaultTextStyleTransitionExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class DefaultTextStyleTransitionExample extends StatefulWidget {
+ const DefaultTextStyleTransitionExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<DefaultTextStyleTransitionExample> createState() => _DefaultTextStyleTransitionExampleState();
}
/// [AnimationController]s can be created with `vsync: this` because of
/// [TickerProviderStateMixin].
-class _MyStatefulWidgetState extends State<MyStatefulWidget>
+class _DefaultTextStyleTransitionExampleState extends State<DefaultTextStyleTransitionExample>
with TickerProviderStateMixin {
late AnimationController _controller;
late TextStyleTween _styleTween;
@@ -45,10 +42,8 @@
vsync: this,
)..repeat(reverse: true);
_styleTween = TextStyleTween(
- begin: const TextStyle(
- fontSize: 50, color: Colors.blue, fontWeight: FontWeight.w900),
- end: const TextStyle(
- fontSize: 50, color: Colors.red, fontWeight: FontWeight.w100),
+ begin: const TextStyle(fontSize: 50, color: Colors.blue, fontWeight: FontWeight.w900),
+ end: const TextStyle(fontSize: 50, color: Colors.red, fontWeight: FontWeight.w100),
);
_curvedAnimation = CurvedAnimation(
parent: _controller,
diff --git a/examples/api/lib/widgets/transitions/fade_transition.0.dart b/examples/api/lib/widgets/transitions/fade_transition.0.dart
index fbe97f5..a6dd324 100644
--- a/examples/api/lib/widgets/transitions/fade_transition.0.dart
+++ b/examples/api/lib/widgets/transitions/fade_transition.0.dart
@@ -2,37 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [FadeTransition].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [FadeTransition].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const FadeTransitionExampleApp());
- static const String _title = 'Flutter Code Sample';
+class FadeTransitionExampleApp extends StatelessWidget {
+ const FadeTransitionExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: FadeTransitionExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class FadeTransitionExample extends StatefulWidget {
+ const FadeTransitionExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<FadeTransitionExample> createState() => _FadeTransitionExampleState();
}
/// [AnimationController]s can be created with `vsync: this` because of
/// [TickerProviderStateMixin].
-class _MyStatefulWidgetState extends State<MyStatefulWidget>
- with TickerProviderStateMixin {
+class _FadeTransitionExampleState extends State<FadeTransitionExample> with TickerProviderStateMixin {
late final AnimationController _controller = AnimationController(
duration: const Duration(seconds: 2),
vsync: this,
diff --git a/examples/api/lib/widgets/transitions/listenable_builder.0.dart b/examples/api/lib/widgets/transitions/listenable_builder.0.dart
index 26e9eed..e0cd2ef 100644
--- a/examples/api/lib/widgets/transitions/listenable_builder.0.dart
+++ b/examples/api/lib/widgets/transitions/listenable_builder.0.dart
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ListenableBuilder].
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [ListenableBuilder].
+
void main() => runApp(const ListenableBuilderExample());
/// This widget listens for changes in the focus state of the subtree defined by
diff --git a/examples/api/lib/widgets/transitions/listenable_builder.1.dart b/examples/api/lib/widgets/transitions/listenable_builder.1.dart
index eb737a7..4d83bad 100644
--- a/examples/api/lib/widgets/transitions/listenable_builder.1.dart
+++ b/examples/api/lib/widgets/transitions/listenable_builder.1.dart
@@ -2,11 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for a [ValueNotifier] with a [ListenableBuilder].
-
import 'package:flutter/material.dart';
-void main() { runApp(const ListenableBuilderExample()); }
+/// Flutter code sample for a [ValueNotifier] with a [ListenableBuilder].
+
+void main() {
+ runApp(const ListenableBuilderExample());
+}
class ListenableBuilderExample extends StatefulWidget {
const ListenableBuilderExample({super.key});
diff --git a/examples/api/lib/widgets/transitions/listenable_builder.2.dart b/examples/api/lib/widgets/transitions/listenable_builder.2.dart
index d9c2e79..f417bfc 100644
--- a/examples/api/lib/widgets/transitions/listenable_builder.2.dart
+++ b/examples/api/lib/widgets/transitions/listenable_builder.2.dart
@@ -2,11 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for a [ChangeNotifier] with a [ListenableBuilder].
-
import 'package:flutter/material.dart';
-void main() { runApp(const ListenableBuilderExample()); }
+/// Flutter code sample for a [ChangeNotifier] with a [ListenableBuilder].
+
+void main() {
+ runApp(const ListenableBuilderExample());
+}
class CounterModel with ChangeNotifier {
int _count = 0;
diff --git a/examples/api/lib/widgets/transitions/listenable_builder.3.dart b/examples/api/lib/widgets/transitions/listenable_builder.3.dart
index 518c331..9d65da2 100644
--- a/examples/api/lib/widgets/transitions/listenable_builder.3.dart
+++ b/examples/api/lib/widgets/transitions/listenable_builder.3.dart
@@ -2,12 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for a [ChangeNotifier] with a [ListenableBuilder].
-
import 'dart:math' as math;
import 'package:flutter/material.dart';
-void main() { runApp(const ListenableBuilderExample()); }
+/// Flutter code sample for a [ChangeNotifier] with a [ListenableBuilder].
+
+void main() {
+ runApp(const ListenableBuilderExample());
+}
class ListModel with ChangeNotifier {
final List<int> _values = <int>[];
diff --git a/examples/api/lib/widgets/transitions/positioned_transition.0.dart b/examples/api/lib/widgets/transitions/positioned_transition.0.dart
index ef8f6ee..5adf8b1 100644
--- a/examples/api/lib/widgets/transitions/positioned_transition.0.dart
+++ b/examples/api/lib/widgets/transitions/positioned_transition.0.dart
@@ -2,37 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [PositionedTransition].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [PositionedTransition].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const PositionedTransitionExampleApp());
- static const String _title = 'Flutter Code Sample';
+class PositionedTransitionExampleApp extends StatelessWidget {
+ const PositionedTransitionExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: PositionedTransitionExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class PositionedTransitionExample extends StatefulWidget {
+ const PositionedTransitionExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<PositionedTransitionExample> createState() => _PositionedTransitionExampleState();
}
/// [AnimationController]s can be created with `vsync: this` because of
/// [TickerProviderStateMixin].
-class _MyStatefulWidgetState extends State<MyStatefulWidget>
- with TickerProviderStateMixin {
+class _PositionedTransitionExampleState extends State<PositionedTransitionExample> with TickerProviderStateMixin {
late final AnimationController _controller = AnimationController(
duration: const Duration(seconds: 2),
vsync: this,
@@ -57,17 +53,21 @@
PositionedTransition(
rect: RelativeRectTween(
begin: RelativeRect.fromSize(
- const Rect.fromLTWH(0, 0, smallLogo, smallLogo), biggest),
+ const Rect.fromLTWH(0, 0, smallLogo, smallLogo),
+ biggest,
+ ),
end: RelativeRect.fromSize(
- Rect.fromLTWH(biggest.width - bigLogo,
- biggest.height - bigLogo, bigLogo, bigLogo),
- biggest),
+ Rect.fromLTWH(biggest.width - bigLogo, biggest.height - bigLogo, bigLogo, bigLogo),
+ biggest,
+ ),
).animate(CurvedAnimation(
parent: _controller,
curve: Curves.elasticInOut,
)),
child: const Padding(
- padding: EdgeInsets.all(8), child: FlutterLogo()),
+ padding: EdgeInsets.all(8),
+ child: FlutterLogo(),
+ ),
),
],
);
diff --git a/examples/api/lib/widgets/transitions/relative_positioned_transition.0.dart b/examples/api/lib/widgets/transitions/relative_positioned_transition.0.dart
index aad99c7..3b5f57c 100644
--- a/examples/api/lib/widgets/transitions/relative_positioned_transition.0.dart
+++ b/examples/api/lib/widgets/transitions/relative_positioned_transition.0.dart
@@ -2,36 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RelativePositionedTransition].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [RelativePositionedTransition].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const RelativePositionedTransitionExampleApp());
- static const String _title = 'Flutter Code Sample';
+class RelativePositionedTransitionExampleApp extends StatelessWidget {
+ const RelativePositionedTransitionExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: RelativePositionedTransitionExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class RelativePositionedTransitionExample extends StatefulWidget {
+ const RelativePositionedTransitionExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<RelativePositionedTransitionExample> createState() => _RelativePositionedTransitionExampleState();
}
/// [AnimationController]s can be created with `vsync: this` because of
/// [TickerProviderStateMixin].
-class _MyStatefulWidgetState extends State<MyStatefulWidget>
+class _RelativePositionedTransitionExampleState extends State<RelativePositionedTransitionExample>
with TickerProviderStateMixin {
late final AnimationController _controller = AnimationController(
duration: const Duration(seconds: 2),
@@ -58,14 +55,20 @@
size: biggest,
rect: RectTween(
begin: const Rect.fromLTWH(0, 0, bigLogo, bigLogo),
- end: Rect.fromLTWH(biggest.width - smallLogo,
- biggest.height - smallLogo, smallLogo, smallLogo),
+ end: Rect.fromLTWH(
+ biggest.width - smallLogo,
+ biggest.height - smallLogo,
+ smallLogo,
+ smallLogo,
+ ),
).animate(CurvedAnimation(
parent: _controller,
curve: Curves.elasticInOut,
)),
child: const Padding(
- padding: EdgeInsets.all(8), child: FlutterLogo()),
+ padding: EdgeInsets.all(8),
+ child: FlutterLogo(),
+ ),
),
],
);
diff --git a/examples/api/lib/widgets/transitions/rotation_transition.0.dart b/examples/api/lib/widgets/transitions/rotation_transition.0.dart
index aa554b4..58001da 100644
--- a/examples/api/lib/widgets/transitions/rotation_transition.0.dart
+++ b/examples/api/lib/widgets/transitions/rotation_transition.0.dart
@@ -2,37 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [RotationTransition].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [RotationTransition].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const RotationTransitionExampleApp());
- static const String _title = 'Flutter Code Sample';
+class RotationTransitionExampleApp extends StatelessWidget {
+ const RotationTransitionExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: RotationTransitionExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class RotationTransitionExample extends StatefulWidget {
+ const RotationTransitionExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<RotationTransitionExample> createState() => _RotationTransitionExampleState();
}
/// [AnimationController]s can be created with `vsync: this` because of
/// [TickerProviderStateMixin].
-class _MyStatefulWidgetState extends State<MyStatefulWidget>
- with TickerProviderStateMixin {
+class _RotationTransitionExampleState extends State<RotationTransitionExample> with TickerProviderStateMixin {
late final AnimationController _controller = AnimationController(
duration: const Duration(seconds: 2),
vsync: this,
diff --git a/examples/api/lib/widgets/transitions/scale_transition.0.dart b/examples/api/lib/widgets/transitions/scale_transition.0.dart
index d1eeed8..34b3527 100644
--- a/examples/api/lib/widgets/transitions/scale_transition.0.dart
+++ b/examples/api/lib/widgets/transitions/scale_transition.0.dart
@@ -2,37 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [ScaleTransition].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [ScaleTransition].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const ScaleTransitionExampleApp());
- static const String _title = 'Flutter Code Sample';
+class ScaleTransitionExampleApp extends StatelessWidget {
+ const ScaleTransitionExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: ScaleTransitionExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class ScaleTransitionExample extends StatefulWidget {
+ const ScaleTransitionExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<ScaleTransitionExample> createState() => _ScaleTransitionExampleState();
}
/// [AnimationController]s can be created with `vsync: this` because of
/// [TickerProviderStateMixin].
-class _MyStatefulWidgetState extends State<MyStatefulWidget>
- with TickerProviderStateMixin {
+class _ScaleTransitionExampleState extends State<ScaleTransitionExample> with TickerProviderStateMixin {
late final AnimationController _controller = AnimationController(
duration: const Duration(seconds: 2),
vsync: this,
diff --git a/examples/api/lib/widgets/transitions/size_transition.0.dart b/examples/api/lib/widgets/transitions/size_transition.0.dart
index 5358f36..cfd9525 100644
--- a/examples/api/lib/widgets/transitions/size_transition.0.dart
+++ b/examples/api/lib/widgets/transitions/size_transition.0.dart
@@ -2,37 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SizeTransition].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SizeTransition].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SizeTransitionExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SizeTransitionExampleApp extends StatelessWidget {
+ const SizeTransitionExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: SizeTransitionExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class SizeTransitionExample extends StatefulWidget {
+ const SizeTransitionExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<SizeTransitionExample> createState() => _SizeTransitionExampleState();
}
/// [AnimationController]s can be created with `vsync: this` because of
/// [TickerProviderStateMixin].
-class _MyStatefulWidgetState extends State<MyStatefulWidget>
- with TickerProviderStateMixin {
+class _SizeTransitionExampleState extends State<SizeTransitionExample> with TickerProviderStateMixin {
late final AnimationController _controller = AnimationController(
duration: const Duration(seconds: 3),
vsync: this,
diff --git a/examples/api/lib/widgets/transitions/slide_transition.0.dart b/examples/api/lib/widgets/transitions/slide_transition.0.dart
index 767b969..861dc7f 100644
--- a/examples/api/lib/widgets/transitions/slide_transition.0.dart
+++ b/examples/api/lib/widgets/transitions/slide_transition.0.dart
@@ -2,40 +2,36 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SlideTransition].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SlideTransition].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SlideTransitionExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SlideTransitionExampleApp extends StatelessWidget {
+ const SlideTransitionExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('SlideTransition Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: SlideTransitionExample(),
),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class SlideTransitionExample extends StatefulWidget {
+ const SlideTransitionExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<SlideTransitionExample> createState() => _SlideTransitionExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget>
- with SingleTickerProviderStateMixin {
+class _SlideTransitionExampleState extends State<SlideTransitionExample> with SingleTickerProviderStateMixin {
late final AnimationController _controller = AnimationController(
duration: const Duration(seconds: 2),
vsync: this,
diff --git a/examples/api/lib/widgets/transitions/sliver_fade_transition.0.dart b/examples/api/lib/widgets/transitions/sliver_fade_transition.0.dart
index b7db200..bdd364b 100644
--- a/examples/api/lib/widgets/transitions/sliver_fade_transition.0.dart
+++ b/examples/api/lib/widgets/transitions/sliver_fade_transition.0.dart
@@ -2,40 +2,36 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [SliverFadeTransition].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [SliverFadeTransition].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const SliverFadeTransitionExampleApp());
- static const String _title = 'Flutter Code Sample';
+class SliverFadeTransitionExampleApp extends StatelessWidget {
+ const SliverFadeTransitionExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('SliverFadeTransition Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: SliverFadeTransitionExample(),
),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class SliverFadeTransitionExample extends StatefulWidget {
+ const SliverFadeTransitionExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<SliverFadeTransitionExample> createState() => _SliverFadeTransitionExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget>
- with SingleTickerProviderStateMixin {
+class _SliverFadeTransitionExampleState extends State<SliverFadeTransitionExample> with SingleTickerProviderStateMixin {
late final AnimationController controller = AnimationController(
duration: const Duration(milliseconds: 1000),
vsync: this,
diff --git a/examples/api/lib/widgets/tween_animation_builder/tween_animation_builder.0.dart b/examples/api/lib/widgets/tween_animation_builder/tween_animation_builder.0.dart
index b8b4877..65d9587 100644
--- a/examples/api/lib/widgets/tween_animation_builder/tween_animation_builder.0.dart
+++ b/examples/api/lib/widgets/tween_animation_builder/tween_animation_builder.0.dart
@@ -2,39 +2,36 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [TweenAnimationBuilder].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [TweenAnimationBuilder].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const TweenAnimationBuilderExampleApp());
- static const String _title = 'Flutter Code Sample';
+class TweenAnimationBuilderExampleApp extends StatelessWidget {
+ const TweenAnimationBuilderExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: _title,
home: Scaffold(
- appBar: AppBar(title: const Text(_title)),
+ appBar: AppBar(title: const Text('TweenAnimationBuilder Sample')),
body: const Center(
- child: MyStatefulWidget(),
+ child: TweenAnimationBuilderExample(),
),
),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class TweenAnimationBuilderExample extends StatefulWidget {
+ const TweenAnimationBuilderExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<TweenAnimationBuilderExample> createState() => _TweenAnimationBuilderExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _TweenAnimationBuilderExampleState extends State<TweenAnimationBuilderExample> {
double targetValue = 24.0;
@override
diff --git a/examples/api/lib/widgets/undo_history/undo_history_controller.0.dart b/examples/api/lib/widgets/undo_history/undo_history_controller.0.dart
index 55cd50d..33a0dfe 100644
--- a/examples/api/lib/widgets/undo_history/undo_history_controller.0.dart
+++ b/examples/api/lib/widgets/undo_history/undo_history_controller.0.dart
@@ -2,23 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for UndoHistoryController.
-
import 'package:flutter/material.dart';
+/// Flutter code sample for [UndoHistoryController].
+
void main() {
- runApp(const MyApp());
+ runApp(const UndoHistoryControllerExampleApp());
}
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
-
- static const String _title = 'Flutter Code Sample';
+class UndoHistoryControllerExampleApp extends StatelessWidget {
+ const UndoHistoryControllerExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
home: MyHomePage(),
);
}
diff --git a/examples/api/lib/widgets/will_pop_scope/will_pop_scope.0.dart b/examples/api/lib/widgets/will_pop_scope/will_pop_scope.0.dart
index 74efd94..46dafa5 100644
--- a/examples/api/lib/widgets/will_pop_scope/will_pop_scope.0.dart
+++ b/examples/api/lib/widgets/will_pop_scope/will_pop_scope.0.dart
@@ -2,34 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flutter code sample for [WillPopScope].
-
import 'package:flutter/material.dart';
-void main() => runApp(const MyApp());
+/// Flutter code sample for [WillPopScope].
-class MyApp extends StatelessWidget {
- const MyApp({super.key});
+void main() => runApp(const WillPopScopeExampleApp());
- static const String _title = 'Flutter Code Sample';
+class WillPopScopeExampleApp extends StatelessWidget {
+ const WillPopScopeExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
- title: _title,
- home: MyStatefulWidget(),
+ home: WillPopScopeExample(),
);
}
}
-class MyStatefulWidget extends StatefulWidget {
- const MyStatefulWidget({super.key});
+class WillPopScopeExample extends StatefulWidget {
+ const WillPopScopeExample({super.key});
@override
- State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
+ State<WillPopScopeExample> createState() => _WillPopScopeExampleState();
}
-class _MyStatefulWidgetState extends State<MyStatefulWidget> {
+class _WillPopScopeExampleState extends State<WillPopScopeExample> {
bool shouldPop = true;
@override
Widget build(BuildContext context) {
@@ -51,7 +48,7 @@
Navigator.of(context).push<void>(
MaterialPageRoute<void>(
builder: (BuildContext context) {
- return const MyStatefulWidget();
+ return const WillPopScopeExample();
},
),
);
diff --git a/examples/api/test/material/action_buttons/action_icon_theme.0_test.dart b/examples/api/test/material/action_buttons/action_icon_theme.0_test.dart
index 3a72490..a8cedc3 100644
--- a/examples/api/test/material/action_buttons/action_icon_theme.0_test.dart
+++ b/examples/api/test/material/action_buttons/action_icon_theme.0_test.dart
@@ -11,7 +11,7 @@
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
- body: example.MyApp(),
+ body: example.ActionIconThemeExampleApp(),
),
),
);
diff --git a/examples/api/test/material/bottom_navigation_bar/bottom_navigation_bar.2_test.dart b/examples/api/test/material/bottom_navigation_bar/bottom_navigation_bar.2_test.dart
index 726698b..4607d7a 100644
--- a/examples/api/test/material/bottom_navigation_bar/bottom_navigation_bar.2_test.dart
+++ b/examples/api/test/material/bottom_navigation_bar/bottom_navigation_bar.2_test.dart
@@ -9,7 +9,7 @@
void main() {
testWidgets('BottomNavigationBar Updates Screen Content', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.BottomNavigationBarExampleApp(),
);
expect(find.widgetWithText(AppBar, 'BottomNavigationBar Sample'), findsOneWidget);
diff --git a/examples/api/test/material/card/card.1_test.dart b/examples/api/test/material/card/card.1_test.dart
index a107a42..6bdf1cb 100644
--- a/examples/api/test/material/card/card.1_test.dart
+++ b/examples/api/test/material/card/card.1_test.dart
@@ -8,7 +8,7 @@
void main() {
testWidgets('Card has clip applied', (WidgetTester tester) async {
- await tester.pumpWidget(const example.MyApp());
+ await tester.pumpWidget(const example.CardExampleApp());
final Card card = tester.firstWidget(find.byType(Card));
expect(card.clipBehavior, Clip.hardEdge);
diff --git a/examples/api/test/material/context_menu/context_menu_controller.0_test.dart b/examples/api/test/material/context_menu/context_menu_controller.0_test.dart
index a22cc69..a2d7177 100644
--- a/examples/api/test/material/context_menu/context_menu_controller.0_test.dart
+++ b/examples/api/test/material/context_menu/context_menu_controller.0_test.dart
@@ -12,7 +12,7 @@
void main() {
testWidgets('showing and hiding the custom context menu in the whole app', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.ContextMenuControllerExampleApp(),
);
expect(BrowserContextMenu.enabled, !kIsWeb);
diff --git a/examples/api/test/material/context_menu/editable_text_toolbar_builder.0_test.dart b/examples/api/test/material/context_menu/editable_text_toolbar_builder.0_test.dart
index c497300..b7b7adf 100644
--- a/examples/api/test/material/context_menu/editable_text_toolbar_builder.0_test.dart
+++ b/examples/api/test/material/context_menu/editable_text_toolbar_builder.0_test.dart
@@ -12,7 +12,7 @@
void main() {
testWidgets('showing and hiding the context menu in TextField with custom buttons', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.EditableTextToolbarBuilderExampleApp(),
);
expect(BrowserContextMenu.enabled, !kIsWeb);
diff --git a/examples/api/test/material/context_menu/editable_text_toolbar_builder.1_test.dart b/examples/api/test/material/context_menu/editable_text_toolbar_builder.1_test.dart
index 4b2b42a..ed7e432 100644
--- a/examples/api/test/material/context_menu/editable_text_toolbar_builder.1_test.dart
+++ b/examples/api/test/material/context_menu/editable_text_toolbar_builder.1_test.dart
@@ -12,7 +12,7 @@
void main() {
testWidgets('showing and hiding the custom context menu in TextField with a specific selection', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.EditableTextToolbarBuilderExampleApp(),
);
expect(BrowserContextMenu.enabled, !kIsWeb);
diff --git a/examples/api/test/material/context_menu/editable_text_toolbar_builder.2_test.dart b/examples/api/test/material/context_menu/editable_text_toolbar_builder.2_test.dart
index bd91cd0..2bcf2ea 100644
--- a/examples/api/test/material/context_menu/editable_text_toolbar_builder.2_test.dart
+++ b/examples/api/test/material/context_menu/editable_text_toolbar_builder.2_test.dart
@@ -12,7 +12,7 @@
void main() {
testWidgets('showing and hiding the context menu in TextField with a custom toolbar', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.EditableTextToolbarBuilderExampleApp(),
);
expect(BrowserContextMenu.enabled, !kIsWeb);
diff --git a/examples/api/test/material/context_menu/selectable_region_toolbar_builder.0_test.dart b/examples/api/test/material/context_menu/selectable_region_toolbar_builder.0_test.dart
index 59be9cc..dd07306 100644
--- a/examples/api/test/material/context_menu/selectable_region_toolbar_builder.0_test.dart
+++ b/examples/api/test/material/context_menu/selectable_region_toolbar_builder.0_test.dart
@@ -12,7 +12,7 @@
void main() {
testWidgets('showing and hiding the custom context menu on SelectionArea', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.SelectableRegionToolbarBuilderExampleApp(),
);
expect(BrowserContextMenu.enabled, !kIsWeb);
diff --git a/examples/api/test/material/dialog/alert_dialog.0_test.dart b/examples/api/test/material/dialog/alert_dialog.0_test.dart
index 4a3bb34..550487b 100644
--- a/examples/api/test/material/dialog/alert_dialog.0_test.dart
+++ b/examples/api/test/material/dialog/alert_dialog.0_test.dart
@@ -12,7 +12,7 @@
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
- body: example.MyApp(),
+ body: example.AlertDialogExampleApp(),
),
),
);
diff --git a/examples/api/test/material/dialog/alert_dialog.1_test.dart b/examples/api/test/material/dialog/alert_dialog.1_test.dart
index 1f90174..6bf829e 100644
--- a/examples/api/test/material/dialog/alert_dialog.1_test.dart
+++ b/examples/api/test/material/dialog/alert_dialog.1_test.dart
@@ -12,7 +12,7 @@
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
- body: example.MyApp(),
+ body: example.AlertDialogExampleApp(),
),
),
);
diff --git a/examples/api/test/material/dialog/dialog.0_test.dart b/examples/api/test/material/dialog/dialog.0_test.dart
index b6fb588..617c546 100644
--- a/examples/api/test/material/dialog/dialog.0_test.dart
+++ b/examples/api/test/material/dialog/dialog.0_test.dart
@@ -13,7 +13,7 @@
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
- body: example.MyApp(),
+ body: example.DialogExampleApp(),
),
),
);
@@ -35,7 +35,7 @@
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
- body: example.MyApp(),
+ body: example.DialogExampleApp(),
),
),
);
diff --git a/examples/api/test/material/dialog/show_dialog.0_test.dart b/examples/api/test/material/dialog/show_dialog.0_test.dart
index b56a121..5bd4b36 100644
--- a/examples/api/test/material/dialog/show_dialog.0_test.dart
+++ b/examples/api/test/material/dialog/show_dialog.0_test.dart
@@ -12,7 +12,7 @@
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
- body: example.MyApp(),
+ body: example.ShowDialogExampleApp(),
),
),
);
diff --git a/examples/api/test/material/dialog/show_dialog.1_test.dart b/examples/api/test/material/dialog/show_dialog.1_test.dart
index be2b4fd..0cc8e83 100644
--- a/examples/api/test/material/dialog/show_dialog.1_test.dart
+++ b/examples/api/test/material/dialog/show_dialog.1_test.dart
@@ -12,7 +12,7 @@
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
- body: example.MyApp(),
+ body: example.ShowDialogExampleApp(),
),
),
);
diff --git a/examples/api/test/material/dialog/show_dialog.2_test.dart b/examples/api/test/material/dialog/show_dialog.2_test.dart
index d234b59..06fe8ca 100644
--- a/examples/api/test/material/dialog/show_dialog.2_test.dart
+++ b/examples/api/test/material/dialog/show_dialog.2_test.dart
@@ -12,7 +12,7 @@
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
- body: example.MyApp(),
+ body: example.ShowDialogExampleApp(),
),
),
);
diff --git a/examples/api/test/material/divider/divider.0_test.dart b/examples/api/test/material/divider/divider.0_test.dart
index 9234d54..ac135a1 100644
--- a/examples/api/test/material/divider/divider.0_test.dart
+++ b/examples/api/test/material/divider/divider.0_test.dart
@@ -11,7 +11,7 @@
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
- body: example.MyApp(),
+ body: example.DividerExampleApp(),
),
),
);
diff --git a/examples/api/test/material/divider/divider.1_test.dart b/examples/api/test/material/divider/divider.1_test.dart
index a0cedbb..afd441a 100644
--- a/examples/api/test/material/divider/divider.1_test.dart
+++ b/examples/api/test/material/divider/divider.1_test.dart
@@ -11,7 +11,7 @@
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
- body: example.MyApp(),
+ body: example.DividerExampleApp(),
),
),
);
diff --git a/examples/api/test/material/divider/vertical_divider.0_test.dart b/examples/api/test/material/divider/vertical_divider.0_test.dart
index 41e0b98..3b61173 100644
--- a/examples/api/test/material/divider/vertical_divider.0_test.dart
+++ b/examples/api/test/material/divider/vertical_divider.0_test.dart
@@ -11,7 +11,7 @@
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
- body: example.MyApp(),
+ body: example.VerticalDividerExampleApp(),
),
),
);
diff --git a/examples/api/test/material/divider/vertical_divider.1_test.dart b/examples/api/test/material/divider/vertical_divider.1_test.dart
index 8840fee..8dbe5c1 100644
--- a/examples/api/test/material/divider/vertical_divider.1_test.dart
+++ b/examples/api/test/material/divider/vertical_divider.1_test.dart
@@ -11,7 +11,7 @@
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
- body: example.MyApp(),
+ body: example.VerticalDividerExampleApp(),
),
),
);
diff --git a/examples/api/test/material/floating_action_button/floating_action_button.0_test.dart b/examples/api/test/material/floating_action_button/floating_action_button.0_test.dart
index a6bfce5..9fa5b6c 100644
--- a/examples/api/test/material/floating_action_button/floating_action_button.0_test.dart
+++ b/examples/api/test/material/floating_action_button/floating_action_button.0_test.dart
@@ -10,7 +10,7 @@
void main() {
testWidgets('FloatingActionButton', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.FloatingActionButtonExampleApp(),
);
expect(find.byType(FloatingActionButton), findsOneWidget);
diff --git a/examples/api/test/material/floating_action_button/floating_action_button.1_test.dart b/examples/api/test/material/floating_action_button/floating_action_button.1_test.dart
index e055b1d..049d635 100644
--- a/examples/api/test/material/floating_action_button/floating_action_button.1_test.dart
+++ b/examples/api/test/material/floating_action_button/floating_action_button.1_test.dart
@@ -10,7 +10,7 @@
void main() {
testWidgets('FloatingActionButton.extended', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.FloatingActionButtonExampleApp(),
);
expect(find.byType(FloatingActionButton), findsOneWidget);
diff --git a/examples/api/test/material/floating_action_button/floating_action_button.2_test.dart b/examples/api/test/material/floating_action_button/floating_action_button.2_test.dart
index 6606296..d7cd0ed 100644
--- a/examples/api/test/material/floating_action_button/floating_action_button.2_test.dart
+++ b/examples/api/test/material/floating_action_button/floating_action_button.2_test.dart
@@ -13,7 +13,7 @@
return tester.widget<RawMaterialButton>(finder);
}
await tester.pumpWidget(
- const example.MyApp(),
+ const example.FloatingActionButtonExampleApp(),
);
expect(find.byType(FloatingActionButton), findsOneWidget);
diff --git a/examples/api/test/material/floating_action_button/floating_action_button.3_test.dart b/examples/api/test/material/floating_action_button/floating_action_button.3_test.dart
index c3fcb05..173ef74 100644
--- a/examples/api/test/material/floating_action_button/floating_action_button.3_test.dart
+++ b/examples/api/test/material/floating_action_button/floating_action_button.3_test.dart
@@ -14,7 +14,7 @@
}
await tester.pumpWidget(
- const example.MyApp(),
+ const example.FloatingActionButtonExampleApp(),
);
final ThemeData theme = ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true);
diff --git a/examples/api/test/material/ink/ink.image_clip.0_test.dart b/examples/api/test/material/ink/ink.image_clip.0_test.dart
index 474fa09..233b56f 100644
--- a/examples/api/test/material/ink/ink.image_clip.0_test.dart
+++ b/examples/api/test/material/ink/ink.image_clip.0_test.dart
@@ -21,7 +21,7 @@
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
- body: example.MyStatelessWidget(
+ body: example.ImageClipExample(
image: MemoryImage(Uint8List.fromList(kTransparentImage)),
),
),
diff --git a/examples/api/test/material/ink/ink.image_clip.1_test.dart b/examples/api/test/material/ink/ink.image_clip.1_test.dart
index 0428c36..a1a19ae 100644
--- a/examples/api/test/material/ink/ink.image_clip.1_test.dart
+++ b/examples/api/test/material/ink/ink.image_clip.1_test.dart
@@ -21,7 +21,7 @@
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
- body: example.MyStatelessWidget(
+ body: example.ImageClipExample(
image: MemoryImage(Uint8List.fromList(kTransparentImage)),
),
),
diff --git a/examples/api/test/material/input_decorator/input_decoration.floating_label_style_error.0_test.dart b/examples/api/test/material/input_decorator/input_decoration.floating_label_style_error.0_test.dart
index 4e1d913..0ee5818 100644
--- a/examples/api/test/material/input_decorator/input_decoration.floating_label_style_error.0_test.dart
+++ b/examples/api/test/material/input_decorator/input_decoration.floating_label_style_error.0_test.dart
@@ -9,7 +9,7 @@
void main() {
testWidgets('InputDecorator label uses error color', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.FloatingLabelStyleErrorExampleApp(),
);
final Theme theme = tester.firstWidget(find.byType(Theme));
diff --git a/examples/api/test/material/input_decorator/input_decoration.label_style_error.0_test.dart b/examples/api/test/material/input_decorator/input_decoration.label_style_error.0_test.dart
index 95238b1..640b8fd 100644
--- a/examples/api/test/material/input_decorator/input_decoration.label_style_error.0_test.dart
+++ b/examples/api/test/material/input_decorator/input_decoration.label_style_error.0_test.dart
@@ -9,7 +9,7 @@
void main() {
testWidgets('InputDecorator label uses error color', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.LabelStyleErrorExampleApp(),
);
final Theme theme = tester.firstWidget(find.byType(Theme));
diff --git a/examples/api/test/material/input_decorator/input_decoration.prefix_icon.0_test.dart b/examples/api/test/material/input_decorator/input_decoration.prefix_icon.0_test.dart
index aeb791d..fcfa9a1 100644
--- a/examples/api/test/material/input_decorator/input_decoration.prefix_icon.0_test.dart
+++ b/examples/api/test/material/input_decorator/input_decoration.prefix_icon.0_test.dart
@@ -9,7 +9,7 @@
void main() {
testWidgets('InputDecorator prefixIcon alignment', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.PrefixIconExampleApp(),
);
expect(tester.getCenter(find.byIcon(Icons.person)).dy, 28.0);
});
diff --git a/examples/api/test/material/input_decorator/input_decoration.suffix_icon.0_test.dart b/examples/api/test/material/input_decorator/input_decoration.suffix_icon.0_test.dart
index 15d8a90..7dd5538 100644
--- a/examples/api/test/material/input_decorator/input_decoration.suffix_icon.0_test.dart
+++ b/examples/api/test/material/input_decorator/input_decoration.suffix_icon.0_test.dart
@@ -9,7 +9,7 @@
void main() {
testWidgets('InputDecorator suffixIcon alignment', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.SuffixIconExampleApp(),
);
expect(tester.getCenter(find.byIcon(Icons.remove_red_eye)).dy, 28.0);
});
diff --git a/examples/api/test/material/navigation_rail/navigation_rail.0_test.dart b/examples/api/test/material/navigation_rail/navigation_rail.0_test.dart
index 165c0c0..afe0ac9 100644
--- a/examples/api/test/material/navigation_rail/navigation_rail.0_test.dart
+++ b/examples/api/test/material/navigation_rail/navigation_rail.0_test.dart
@@ -11,7 +11,7 @@
testWidgets('Navigation rail updates destination on tap',
(WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.NavigationRailExampleApp(),
);
final NavigationRail navigationRailWidget =
tester.firstWidget(find.byType(NavigationRail));
@@ -37,7 +37,7 @@
testWidgets('Navigation rail updates label type', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.NavigationRailExampleApp(),
);
// initial label type set to all.
@@ -56,7 +56,7 @@
testWidgets('Navigation rail updates group alignment', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.NavigationRailExampleApp(),
);
// initial group alignment set top top.
@@ -75,7 +75,7 @@
testWidgets('Navigation rail shows leading/trailing widgets', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.NavigationRailExampleApp(),
);
// Initially leading/trailing widgets are hidden.
diff --git a/examples/api/test/material/navigation_rail/navigation_rail.1_test.dart b/examples/api/test/material/navigation_rail/navigation_rail.1_test.dart
index ea266fb..1c3eee1 100644
--- a/examples/api/test/material/navigation_rail/navigation_rail.1_test.dart
+++ b/examples/api/test/material/navigation_rail/navigation_rail.1_test.dart
@@ -11,7 +11,7 @@
testWidgets('Navigation rail updates destination on tap',
(WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.NavigationRailExampleApp(),
);
final NavigationRail navigationRailWidget =
tester.firstWidget(find.byType(NavigationRail));
@@ -37,7 +37,7 @@
testWidgets('Navigation rail updates label type', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.NavigationRailExampleApp(),
);
// initial label type set to all.
@@ -56,7 +56,7 @@
testWidgets('Navigation rail updates group alignment', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.NavigationRailExampleApp(),
);
// initial group alignment set top top.
@@ -75,7 +75,7 @@
testWidgets('Navigation rail shows leading/trailing widgets', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.NavigationRailExampleApp(),
);
// Initially leading/trailing widgets are hidden.
diff --git a/examples/api/test/material/refresh_indicator/refresh_indicator.0_test.dart b/examples/api/test/material/refresh_indicator/refresh_indicator.0_test.dart
index d7e42e7..418f746 100644
--- a/examples/api/test/material/refresh_indicator/refresh_indicator.0_test.dart
+++ b/examples/api/test/material/refresh_indicator/refresh_indicator.0_test.dart
@@ -9,7 +9,7 @@
void main() {
testWidgets('Trigger RefreshIndicator - Pull from top', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.RefreshIndicatorExampleApp(),
);
await tester.fling(find.text('Item 1'), const Offset(0.0, 300.0), 1000.0);
@@ -22,7 +22,7 @@
testWidgets('Trigger RefreshIndicator - Button', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.RefreshIndicatorExampleApp(),
);
await tester.tap(find.byType(FloatingActionButton));
diff --git a/examples/api/test/material/refresh_indicator/refresh_indicator.1_test.dart b/examples/api/test/material/refresh_indicator/refresh_indicator.1_test.dart
index 452c3db..9a97fe8 100644
--- a/examples/api/test/material/refresh_indicator/refresh_indicator.1_test.dart
+++ b/examples/api/test/material/refresh_indicator/refresh_indicator.1_test.dart
@@ -9,7 +9,7 @@
void main() {
testWidgets('Pulling from nested scroll view triggers refresh indicator', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.RefreshIndicatorExampleApp(),
);
// Pull from the upper scroll view.
diff --git a/examples/api/test/material/text_field/text_field.0_test.dart b/examples/api/test/material/text_field/text_field.0_test.dart
index d013fbf..ebaa998 100644
--- a/examples/api/test/material/text_field/text_field.0_test.dart
+++ b/examples/api/test/material/text_field/text_field.0_test.dart
@@ -8,7 +8,7 @@
void main() {
testWidgets('TextField is obscured and has "Password" as labelText', (WidgetTester tester) async {
- await tester.pumpWidget(const example.MyApp());
+ await tester.pumpWidget(const example.TextFieldExampleApp());
expect(find.byType(TextField), findsOneWidget);
diff --git a/examples/api/test/material/toggle_buttons/toggle_buttons.0_test.dart b/examples/api/test/material/toggle_buttons/toggle_buttons.0_test.dart
index d1d15e6..e183031 100644
--- a/examples/api/test/material/toggle_buttons/toggle_buttons.0_test.dart
+++ b/examples/api/test/material/toggle_buttons/toggle_buttons.0_test.dart
@@ -15,7 +15,7 @@
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
- body: example.MyApp(),
+ body: example.ToggleButtonsExampleApp(),
),
),
);
@@ -50,7 +50,7 @@
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
- body: example.MyApp(),
+ body: example.ToggleButtonsExampleApp(),
),
),
);
@@ -86,7 +86,7 @@
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
- body: example.MyApp(),
+ body: example.ToggleButtonsExampleApp(),
),
),
);
diff --git a/examples/api/test/material/tooltip/tooltip.0_test.dart b/examples/api/test/material/tooltip/tooltip.0_test.dart
index 316bafe..599b938 100644
--- a/examples/api/test/material/tooltip/tooltip.0_test.dart
+++ b/examples/api/test/material/tooltip/tooltip.0_test.dart
@@ -12,7 +12,7 @@
const String tooltipText = 'I am a Tooltip';
await tester.pumpWidget(
- const example.MyApp(),
+ const example.TooltipExampleApp(),
);
TestGesture? gesture = await tester.createGesture(kind: PointerDeviceKind.mouse);
diff --git a/examples/api/test/material/tooltip/tooltip.1_test.dart b/examples/api/test/material/tooltip/tooltip.1_test.dart
index 6116f2c..f689478 100644
--- a/examples/api/test/material/tooltip/tooltip.1_test.dart
+++ b/examples/api/test/material/tooltip/tooltip.1_test.dart
@@ -12,7 +12,7 @@
const String tooltipText = 'I am a Tooltip';
await tester.pumpWidget(
- const example.MyApp(),
+ const example.TooltipExampleApp(),
);
TestGesture? gesture = await tester.createGesture(kind: PointerDeviceKind.mouse);
diff --git a/examples/api/test/material/tooltip/tooltip.2_test.dart b/examples/api/test/material/tooltip/tooltip.2_test.dart
index 8aa1411..ba35b02 100644
--- a/examples/api/test/material/tooltip/tooltip.2_test.dart
+++ b/examples/api/test/material/tooltip/tooltip.2_test.dart
@@ -12,7 +12,7 @@
const String tooltipText = 'I am a rich tooltip. I am another span of this rich tooltip';
await tester.pumpWidget(
- const example.MyApp(),
+ const example.TooltipExampleApp(),
);
TestGesture? gesture = await tester.createGesture(kind: PointerDeviceKind.mouse);
diff --git a/examples/api/test/material/tooltip/tooltip.3_test.dart b/examples/api/test/material/tooltip/tooltip.3_test.dart
index 24e528d..7ef639b 100644
--- a/examples/api/test/material/tooltip/tooltip.3_test.dart
+++ b/examples/api/test/material/tooltip/tooltip.3_test.dart
@@ -11,7 +11,7 @@
const String tooltipText = 'I am a Tooltip';
await tester.pumpWidget(
- const example.MyApp(),
+ const example.TooltipExampleApp(),
);
// Tooltip is not visible before tapping the button.
diff --git a/examples/api/test/services/mouse_cursor/mouse_cursor.0_test.dart b/examples/api/test/services/mouse_cursor/mouse_cursor.0_test.dart
index 5ed743d..456bad4 100644
--- a/examples/api/test/services/mouse_cursor/mouse_cursor.0_test.dart
+++ b/examples/api/test/services/mouse_cursor/mouse_cursor.0_test.dart
@@ -9,7 +9,7 @@
void main() {
testWidgets('Uses Text Cursor', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.MouseCursorExampleApp(),
);
expect(find.byType(MouseRegion), findsNWidgets(2)); // There's one in the MaterialApp
diff --git a/examples/api/test/services/text_input/text_input_control.0_test.dart b/examples/api/test/services/text_input/text_input_control.0_test.dart
index da933c8..0f16238 100644
--- a/examples/api/test/services/text_input/text_input_control.0_test.dart
+++ b/examples/api/test/services/text_input/text_input_control.0_test.dart
@@ -10,7 +10,7 @@
void main() {
testWidgets('Enter text using the VKB', (WidgetTester tester) async {
- await tester.pumpWidget(const example.MyApp());
+ await tester.pumpWidget(const example.TextInputControlExampleApp());
await tester.pumpAndSettle();
await tester.tap(find.descendant(
diff --git a/examples/api/test/widgets/app/widgets_app.widgets_app.0_test.dart b/examples/api/test/widgets/app/widgets_app.widgets_app.0_test.dart
index 603e88f..6412fc1 100644
--- a/examples/api/test/widgets/app/widgets_app.widgets_app.0_test.dart
+++ b/examples/api/test/widgets/app/widgets_app.widgets_app.0_test.dart
@@ -8,7 +8,7 @@
void main() {
testWidgets('WidgetsApp test', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.WidgetsAppExampleApp(),
);
expect(find.text('Hello World'), findsOneWidget);
diff --git a/examples/api/test/widgets/binding/widget_binding_observer.0_test.dart b/examples/api/test/widgets/binding/widget_binding_observer.0_test.dart
index 759463f..f3f7764 100644
--- a/examples/api/test/widgets/binding/widget_binding_observer.0_test.dart
+++ b/examples/api/test/widgets/binding/widget_binding_observer.0_test.dart
@@ -18,7 +18,7 @@
}
await tester.pumpWidget(
- const example.MyApp(),
+ const example.WidgetBindingObserverExampleApp(),
);
expect(find.text('There are no AppLifecycleStates to show.'), findsOneWidget);
diff --git a/examples/api/test/widgets/layout_builder/layout_builder.0_test.dart b/examples/api/test/widgets/layout_builder/layout_builder.0_test.dart
index 51c0ac6..c2c954b 100644
--- a/examples/api/test/widgets/layout_builder/layout_builder.0_test.dart
+++ b/examples/api/test/widgets/layout_builder/layout_builder.0_test.dart
@@ -9,7 +9,7 @@
void main() {
testWidgets('has two containers when wide', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.LayoutBuilderExampleApp(),
);
final Finder containerFinder = find.byType(Container);
@@ -19,7 +19,7 @@
await tester.pumpWidget(
ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 400),
- child: const example.MyApp(),
+ child: const example.LayoutBuilderExampleApp(),
),
);
diff --git a/examples/api/test/widgets/magnifier/magnifier.0_test.dart b/examples/api/test/widgets/magnifier/magnifier.0_test.dart
index b488b31..75702af 100644
--- a/examples/api/test/widgets/magnifier/magnifier.0_test.dart
+++ b/examples/api/test/widgets/magnifier/magnifier.0_test.dart
@@ -9,7 +9,7 @@
void main() {
testWidgets('should update magnifier position on drag', (WidgetTester tester) async {
- await tester.pumpWidget(const example.MyApp());
+ await tester.pumpWidget(const example.MagnifierExampleApp());
Matcher isPositionedAt(Offset at) {
return isA<Positioned>().having(
@@ -40,7 +40,7 @@
});
testWidgets('should match golden', (WidgetTester tester) async {
- await tester.pumpWidget(const example.MyApp());
+ await tester.pumpWidget(const example.MagnifierExampleApp());
final Offset centerOfFlutterLogo = tester.getCenter(find.byType(Positioned));
const Offset dragDistance = Offset(10, 10);
diff --git a/examples/api/test/widgets/overlay/overlay_portal.0_test.dart b/examples/api/test/widgets/overlay/overlay_portal.0_test.dart
index 4a79cdf..2f104af 100644
--- a/examples/api/test/widgets/overlay/overlay_portal.0_test.dart
+++ b/examples/api/test/widgets/overlay/overlay_portal.0_test.dart
@@ -9,7 +9,7 @@
void main() {
const String tooltipText = 'tooltip';
testWidgets('Tooltip is shown on press', (WidgetTester tester) async {
- await tester.pumpWidget(const example.MyApp());
+ await tester.pumpWidget(const example.OverlayPortalExampleApp());
expect(find.text(tooltipText), findsNothing);
await tester.tap(find.byType(example.ClickableTooltipWidget));
@@ -22,11 +22,11 @@
});
testWidgets('Tooltip is shown at the right location', (WidgetTester tester) async {
- await tester.pumpWidget(const example.MyApp());
+ await tester.pumpWidget(const example.OverlayPortalExampleApp());
await tester.tap(find.byType(example.ClickableTooltipWidget));
await tester.pump();
- final Size canvasSize = tester.getSize(find.byType(example.MyApp));
+ final Size canvasSize = tester.getSize(find.byType(example.OverlayPortalExampleApp));
expect(
tester.getBottomRight(find.text(tooltipText)),
canvasSize - const Size(50, 50),
@@ -34,7 +34,7 @@
});
testWidgets('Tooltip is shown with the right font size', (WidgetTester tester) async {
- await tester.pumpWidget(const example.MyApp());
+ await tester.pumpWidget(const example.OverlayPortalExampleApp());
await tester.tap(find.byType(example.ClickableTooltipWidget));
await tester.pump();
diff --git a/examples/api/test/widgets/scrollview/listview_select_test.1.dart b/examples/api/test/widgets/scroll_view/list_view.0_test.dart
similarity index 91%
rename from examples/api/test/widgets/scrollview/listview_select_test.1.dart
rename to examples/api/test/widgets/scroll_view/list_view.0_test.dart
index 11087ceb..1515492 100644
--- a/examples/api/test/widgets/scrollview/listview_select_test.1.dart
+++ b/examples/api/test/widgets/scroll_view/list_view.0_test.dart
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
-import 'package:flutter_api_samples/widgets/scroll_view/listview_select.1.dart'
+import 'package:flutter_api_samples/widgets/scroll_view/list_view.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
@@ -11,7 +11,7 @@
testWidgets('long press ListTile should enable edit mode',
(WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.ListViewExampleApp(),
);
final Finder listView = find.byType(ListView);
@@ -29,7 +29,7 @@
testWidgets('Pressing cross button should disable edit mode',
(WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.ListViewExampleApp(),
);
final Finder listView = find.byType(ListView);
@@ -52,7 +52,7 @@
testWidgets('tapping ListTile or checkBox should toggle ListTile state',
(WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.ListViewExampleApp(),
);
final Finder listView = find.byType(ListView);
diff --git a/examples/api/test/widgets/sliver/sliver_opacity.1_test.dart b/examples/api/test/widgets/sliver/sliver_opacity.1_test.dart
index 08ea906..3c72f5e 100644
--- a/examples/api/test/widgets/sliver/sliver_opacity.1_test.dart
+++ b/examples/api/test/widgets/sliver/sliver_opacity.1_test.dart
@@ -10,7 +10,7 @@
void main() {
testWidgets('SliverOpacity example', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.SliverOpacityExampleApp(),
);
final Finder button = find.byType(FloatingActionButton);
diff --git a/examples/api/test/widgets/text_magnifier/text_magnifier.0_test.dart b/examples/api/test/widgets/text_magnifier/text_magnifier.0_test.dart
index c7c9a54..9d94d93 100644
--- a/examples/api/test/widgets/text_magnifier/text_magnifier.0_test.dart
+++ b/examples/api/test/widgets/text_magnifier/text_magnifier.0_test.dart
@@ -84,13 +84,13 @@
}
testWidgets('should show custom magnifier on drag', (WidgetTester tester) async {
- await tester.pumpWidget(const example.MyApp(text: defaultText));
+ await tester.pumpWidget(const example.TextMagnifierExampleApp(text: defaultText));
await showMagnifier(tester, 'e');
expect(find.byType(example.CustomMagnifier), findsOneWidget);
await expectLater(
- find.byType(example.MyApp),
+ find.byType(example.TextMagnifierExampleApp),
matchesGoldenFile('text_magnifier.0_test.png'),
);
}, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.android }));
@@ -101,7 +101,7 @@
final String text = textDirection == TextDirection.rtl ? 'أثارت زر' : defaultText;
final String textToTapOn = textDirection == TextDirection.rtl ? 'ت' : 'e';
- await tester.pumpWidget(example.MyApp(textDirection: textDirection, text: text));
+ await tester.pumpWidget(example.TextMagnifierExampleApp(textDirection: textDirection, text: text));
await showMagnifier(tester, textToTapOn);
diff --git a/examples/api/test/widgets/will_pop_scope/will_pop_scope.0_test.dart b/examples/api/test/widgets/will_pop_scope/will_pop_scope.0_test.dart
index 1a0720d..ad05943 100644
--- a/examples/api/test/widgets/will_pop_scope/will_pop_scope.0_test.dart
+++ b/examples/api/test/widgets/will_pop_scope/will_pop_scope.0_test.dart
@@ -8,7 +8,7 @@
void main() {
testWidgets('pressing shouldPop button changes shouldPop', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.WillPopScopeExampleApp(),
);
final Finder buttonFinder = find.text('shouldPop: true');
@@ -19,14 +19,14 @@
});
testWidgets('pressing Push button pushes route', (WidgetTester tester) async {
await tester.pumpWidget(
- const example.MyApp(),
+ const example.WillPopScopeExampleApp(),
);
final Finder buttonFinder = find.text('Push');
expect(buttonFinder, findsOneWidget);
- expect(find.byType(example.MyStatefulWidget), findsOneWidget);
+ expect(find.byType(example.WillPopScopeExample), findsOneWidget);
await tester.tap(buttonFinder);
await tester.pumpAndSettle();
- expect(find.byType(example.MyStatefulWidget, skipOffstage: false), findsNWidgets(2));
+ expect(find.byType(example.WillPopScopeExample, skipOffstage: false), findsNWidgets(2));
});
}