diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/data/data_providers/app.dart | 27 | ||||
-rw-r--r-- | lib/export.dart | 1 | ||||
-rw-r--r-- | lib/presentation/screens/home/home_ci.dart | 20 |
3 files changed, 38 insertions, 10 deletions
diff --git a/lib/data/data_providers/app.dart b/lib/data/data_providers/app.dart index acfaa01..3368a83 100644 --- a/lib/data/data_providers/app.dart +++ b/lib/data/data_providers/app.dart @@ -1,25 +1,32 @@ import '../../export.dart'; +final homeScreenProvider = Provider((ref) { + final Map<String, String> envVars = Platform.environment; + final ciFlagStr = envVars['HOMESCREEN_DEMO_CI']; + final bool ciFlag = ciFlagStr != null && ciFlagStr != "0"; + return ciFlag ? const HomeScreenCI() : const HomeScreen(); +}); + class App extends StatelessWidget { const App({super.key}); @override Widget build(BuildContext context) { - return const AppView(); - } -} - -class AppView extends StatelessWidget { - const AppView({super.key}); - - @override - Widget build(BuildContext context) { return ProviderScope( child: MaterialApp( debugShowCheckedModeBanner: false, theme: theme, - home: const HomeScreen(), + home: const AppView(), ), ); } } + +class AppView extends ConsumerWidget { + const AppView({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + return ref.watch(homeScreenProvider); + } +} diff --git a/lib/export.dart b/lib/export.dart index ef029c7..90ed196 100644 --- a/lib/export.dart +++ b/lib/export.dart @@ -16,6 +16,7 @@ export 'data/models/hybrid.dart'; //Screens export 'presentation/screens/home/home.dart'; +export 'presentation/screens/home/home_ci.dart'; export 'presentation/screens/home/widgets/custom_tile.dart'; export 'presentation/screens/dashboard/dashboard.dart'; export 'presentation/screens/dashboard/widgets/hybrid/hybrid.dart'; diff --git a/lib/presentation/screens/home/home_ci.dart b/lib/presentation/screens/home/home_ci.dart new file mode 100644 index 0000000..8584420 --- /dev/null +++ b/lib/presentation/screens/home/home_ci.dart @@ -0,0 +1,20 @@ +import 'package:flutter_ics_homescreen/export.dart'; + +// Simple fixed pattern homescreen for AGL CI screenshot testing + +class HomeScreenCI extends StatelessWidget { + const HomeScreenCI({super.key}); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + // Note that the colors are specified with hex in order to match + // Qt's red/blue/green constants, which are different than Flutter's. + Container(width: 1080, height: 216, color: Color(0xFF0000FF)), + Container(width: 1080, height: 1488, color: Color(0xFFFF0000)), + Container(width: 1080, height: 216, color: Color(0xFF008000)) + ], + ); + } +} |