This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| title: 'Partly Windy', | |
| theme: buildLightTheme(), | |
| darkTheme: buildDarkTheme(), | |
| themeMode: ThemeMode.system, | |
| debugShowCheckedModeBanner: false, | |
| home: const DailyForecastRoute(), | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Return the view appropriate for the device screen size | |
| return LayoutBuilder( | |
| builder: (BuildContext context, BoxConstraints constraints) { | |
| debugPrint('Host device screen width: ${constraints.maxWidth}'); | |
| // Watch-sized device | |
| if (constraints.maxWidth < 300) { | |
| return DailyForecastViewWatch(this); | |
| } | |
| // Phone-sized device |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// The Model Widget defines external parameters. | |
| class Page extends StatefulWidget { | |
| const Page({Key? key}) : super(key: key); | |
| @override | |
| PageController createState() => PageController(); | |
| } | |
| /// The Controller handles the state and business logic. | |
| class PageController extends State<Page> { |
NewerOlder