|
| 1 | +>>> |
| 2 | +class C { |
| 3 | + @override |
| 4 | + Widget build(BuildContext context) { |
| 5 | + return PlatformProvider( |
| 6 | + builder: |
| 7 | + (context) => PlatformTheme( |
| 8 | + builder: |
| 9 | + (context) => PlatformApp( |
| 10 | + localizationsDelegates: <LocalizationsDelegate<dynamic>>[ |
| 11 | + DefaultMaterialLocalizations.delegate, |
| 12 | + DefaultWidgetsLocalizations.delegate, |
| 13 | + DefaultCupertinoLocalizations.delegate, |
| 14 | + ], |
| 15 | + title: 'Flutter Platform Widgets', |
| 16 | + home: MyHomePage(title: 'Flutter Platform Widgets Demo'), |
| 17 | + ), |
| 18 | + ), |
| 19 | + ); |
| 20 | + } |
| 21 | +} |
| 22 | +<<< |
| 23 | +class C { |
| 24 | + @override |
| 25 | + Widget build(BuildContext context) { |
| 26 | + return PlatformProvider( |
| 27 | + builder: (context) => PlatformTheme( |
| 28 | + builder: (context) => PlatformApp( |
| 29 | + localizationsDelegates: <LocalizationsDelegate<dynamic>>[ |
| 30 | + DefaultMaterialLocalizations.delegate, |
| 31 | + DefaultWidgetsLocalizations.delegate, |
| 32 | + DefaultCupertinoLocalizations.delegate, |
| 33 | + ], |
| 34 | + title: 'Flutter Platform Widgets', |
| 35 | + home: MyHomePage(title: 'Flutter Platform Widgets Demo'), |
| 36 | + ), |
| 37 | + ), |
| 38 | + ); |
| 39 | + } |
| 40 | +} |
| 41 | +<<< 3.7 |
| 42 | +class C { |
| 43 | + @override |
| 44 | + Widget build(BuildContext context) { |
| 45 | + return PlatformProvider( |
| 46 | + builder: |
| 47 | + (context) => PlatformTheme( |
| 48 | + builder: |
| 49 | + (context) => PlatformApp( |
| 50 | + localizationsDelegates: <LocalizationsDelegate<dynamic>>[ |
| 51 | + DefaultMaterialLocalizations.delegate, |
| 52 | + DefaultWidgetsLocalizations.delegate, |
| 53 | + DefaultCupertinoLocalizations.delegate, |
| 54 | + ], |
| 55 | + title: 'Flutter Platform Widgets', |
| 56 | + home: MyHomePage(title: 'Flutter Platform Widgets Demo'), |
| 57 | + ), |
| 58 | + ), |
| 59 | + ); |
| 60 | + } |
| 61 | +} |
0 commit comments