@@ -8,22 +8,24 @@ import 'icons_page.dart';
88import 'logo.dart' ;
99import 'material_ios_page.dart' ;
1010import 'platform_widget_example.dart' ;
11- import 'tab_impl_page.dart' ;
1211import 'sliver_app_bar_page.dart' ;
12+ import 'tab_impl_page.dart' ;
1313
1414class PlatformPage extends StatelessWidget {
15+ const PlatformPage ({super .key});
16+
1517 @override
1618 Widget build (BuildContext context) {
1719 return PlatformScaffold (
18- appBar: PlatformAppBar (
20+ appBar: const PlatformAppBar (
1921 title: Text ('Flutter Platform Widgets' ),
2022 ),
2123 body: PlatformScrollbar (
2224 thumbVisibility: true ,
2325 child: ListView (
2426 children: [
25- FlutterPlatformWidgetsLogo (size: 60 ),
26- Divider (thickness: 10 ),
27+ const FlutterPlatformWidgetsLogo (size: 60 ),
28+ const Divider (thickness: 10 ),
2729 Padding (
2830 padding: const EdgeInsets .all (8.0 ),
2931 child: PlatformElevatedButton (
@@ -49,15 +51,15 @@ class PlatformPage extends StatelessWidget {
4951 PlatformTheme .of (context)? .themeMode = newMode;
5052 }),
5153 ),
52- Divider (thickness: 10 ),
54+ const Divider (thickness: 10 ),
5355 // ! PlatformSearchBar
5456 PlatformWidgetExample (
5557 title:
5658 'PlatformSearchBar ${isMaterial (context ) ? " (Material 3 only)" : "" }' ,
5759 builder: (context, platform) => PlatformSearchBar (
5860 onChanged: (value) =>
59- print ('${platform .text } SearchBar changed: $value ' ),
60- onTap: () => print ('${platform .text } SearchBar tapped' ),
61+ debugPrint ('${platform .text } SearchBar changed: $value ' ),
62+ onTap: () => debugPrint ('${platform .text } SearchBar tapped' ),
6163 hintText: '${platform .text } SearchBar' ,
6264 ),
6365 ),
@@ -66,10 +68,10 @@ class PlatformPage extends StatelessWidget {
6668 title: 'PlatformListTile' ,
6769 builder: (_, platform) => PlatformListTile (
6870 leading: Icon (context.platformIcons.book),
69- title: PlatformText (" title" ),
70- subtitle: PlatformText (" subtitle" ),
71+ title: PlatformText (' title' ),
72+ subtitle: PlatformText (' subtitle' ),
7173 trailing: Icon (context.platformIcons.rightChevron),
72- onTap: () => print ('${platform .text } PlatformListTile' ),
74+ onTap: () => debugPrint ('${platform .text } PlatformListTile' ),
7375 ),
7476 ),
7577 // ! PlatformText
@@ -145,7 +147,7 @@ class PlatformPage extends StatelessWidget {
145147 title: 'PlatformElevatedButton' ,
146148 builder: (_, platform) => PlatformElevatedButton (
147149 child: Text (platform.text),
148- onPressed: () => print ('${platform .text } PlatformButton' ),
150+ onPressed: () => debugPrint ('${platform .text } PlatformButton' ),
149151 padding: const EdgeInsets .all (8 ),
150152 color: Colors .orange,
151153 ),
@@ -154,10 +156,10 @@ class PlatformPage extends StatelessWidget {
154156 title: 'PlatformElevatedButton Icon' ,
155157 builder: (_, platform) => PlatformElevatedButton (
156158 child: Text (platform.text),
157- onPressed: () => print ('${platform .text } PlatformButton' ),
159+ onPressed: () => debugPrint ('${platform .text } PlatformButton' ),
158160 padding: const EdgeInsets .all (8 ),
159161 material: (_, __) => MaterialElevatedButtonData (
160- icon: Icon (Icons .home),
162+ icon: const Icon (Icons .home),
161163 ),
162164 cupertino: (_, __) => CupertinoElevatedButtonData (
163165 originalStyle: true ,
@@ -169,18 +171,18 @@ class PlatformPage extends StatelessWidget {
169171 title: 'PlatformTextButton' ,
170172 builder: (_, platform) => PlatformTextButton (
171173 child: Text (platform.text),
172- onPressed: () => print ('${platform .text } PlatformButton' ),
174+ onPressed: () => debugPrint ('${platform .text } PlatformButton' ),
173175 padding: const EdgeInsets .all (8 ),
174176 ),
175177 ),
176178 PlatformWidgetExample (
177179 title: 'PlatformTextButton Icon' ,
178180 builder: (_, platform) => PlatformTextButton (
179181 child: Text (platform.text),
180- onPressed: () => print ('${platform .text } PlatformButton' ),
182+ onPressed: () => debugPrint ('${platform .text } PlatformButton' ),
181183 padding: const EdgeInsets .all (8 ),
182184 material: (_, __) => MaterialTextButtonData (
183- icon: Icon (Icons .home),
185+ icon: const Icon (Icons .home),
184186 ),
185187 cupertino: (_, __) => CupertinoTextButtonData (
186188 originalStyle: true ,
@@ -256,11 +258,11 @@ class PlatformPage extends StatelessWidget {
256258 builder: (_, platform) => PlatformWidgetBuilder (
257259 cupertino: (_, child, __) => GestureDetector (
258260 child: child,
259- onTap: () => print ('Cupertino PlatformWidgetBuilder' ),
261+ onTap: () => debugPrint ('Cupertino PlatformWidgetBuilder' ),
260262 ),
261263 material: (_, child, __) => InkWell (
262264 child: child,
263- onTap: () => print ('Material PlatformWidgetBuilder' ),
265+ onTap: () => debugPrint ('Material PlatformWidgetBuilder' ),
264266 ),
265267 child: Container (
266268 padding: const EdgeInsets .all (12 ),
@@ -351,11 +353,11 @@ class PlatformPage extends StatelessWidget {
351353 Padding (
352354 padding: const EdgeInsets .all (8.0 ),
353355 child: PlatformElevatedButton (
354- child: Text ('Show Tabbed Pages' ),
356+ child: const Text ('Show Tabbed Pages' ),
355357 onPressed: () => Navigator .of (context).push (
356358 platformPageRoute (
357359 context: context,
358- builder: (context) => TabImplementationPage (),
360+ builder: (context) => const TabImplementationPage (),
359361 ),
360362 ),
361363 ),
@@ -365,11 +367,11 @@ class PlatformPage extends StatelessWidget {
365367 Padding (
366368 padding: const EdgeInsets .all (8.0 ),
367369 child: PlatformElevatedButton (
368- child: Text ('Show Sliver AppBar Page' ),
370+ child: const Text ('Show Sliver AppBar Page' ),
369371 onPressed: () => Navigator .of (context).push (
370372 platformPageRoute (
371373 context: context,
372- builder: (context) => PlatformSliverAppBarPage (),
374+ builder: (context) => const PlatformSliverAppBarPage (),
373375 ),
374376 ),
375377 ),
@@ -380,11 +382,11 @@ class PlatformPage extends StatelessWidget {
380382 Padding (
381383 padding: const EdgeInsets .all (8.0 ),
382384 child: PlatformElevatedButton (
383- child: Text ('Show Platform Icons' ),
385+ child: const Text ('Show Platform Icons' ),
384386 onPressed: () => Navigator .of (context).push (
385387 platformPageRoute (
386388 context: context,
387- builder: (context) => IconsPage (),
389+ builder: (context) => const IconsPage (),
388390 ),
389391 ),
390392 ),
@@ -394,11 +396,11 @@ class PlatformPage extends StatelessWidget {
394396 Padding (
395397 padding: const EdgeInsets .all (8.0 ),
396398 child: PlatformElevatedButton (
397- child: Text ('Show Material on iOS' ),
399+ child: const Text ('Show Material on iOS' ),
398400 onPressed: () => Navigator .of (context).push (
399401 platformPageRoute (
400402 context: context,
401- builder: (context) => IosMaterialPage (),
403+ builder: (context) => const IosMaterialPage (),
402404 ),
403405 ),
404406 ),
@@ -429,7 +431,7 @@ ThemeMode _cycleThemeMode(ThemeMode? mode) {
429431 }
430432}
431433
432- _showDatePicker (BuildContext context) async {
434+ Future < void > _showDatePicker (BuildContext context) async {
433435 final now = DateUtils .dateOnly (DateTime .now ());
434436 final date = await showPlatformDatePicker (
435437 context: context,
@@ -443,11 +445,11 @@ _showDatePicker(BuildContext context) async {
443445 }
444446}
445447
446- _showExampleDialog (BuildContext context, String text) {
448+ void _showExampleDialog (BuildContext context, String text) {
447449 showPlatformDialog (
448450 context: context,
449451 builder: (_) => PlatformAlertDialog (
450- title: Text ('Alert' ),
452+ title: const Text ('Alert' ),
451453 content: Text ('$text content' ),
452454 actions: < Widget > [
453455 PlatformDialogAction (
@@ -465,7 +467,7 @@ _showExampleDialog(BuildContext context, String text) {
465467 );
466468}
467469
468- _showPopupSheet (BuildContext context, String text) {
470+ void _showPopupSheet (BuildContext context, String text) {
469471 showPlatformModalSheet (
470472 context: context,
471473 builder: (_) => PlatformWidget (
0 commit comments