### Initialize and Display Lottie Splash Screen in Flutter Source: https://github.com/simformsolutionspvtltd/splash_master/blob/master/doc/documentation.md This example shows the setup for a Lottie splash screen using Splash Master. Ensure `WidgetsFlutterBinding.ensureInitialized()` and `SplashMaster.initialize()` are called. The `MaterialApp`'s `home` is set to `SplashMaster.lottie()` for the Lottie animation. Manual resume is not required for Lottie splashes. ```dart void main() { WidgetsFlutterBinding.ensureInitialized(); SplashMaster.initialize(); runApp( MaterialApp( home: SplashMaster.lottie(/* config */), ), ); } ``` -------------------------------- ### Initialize and Resume Splash Screen in Flutter Source: https://context7.com/simformsolutionspvtltd/splash_master/llms.txt This Dart code snippet demonstrates the initialization of the Splash Master package and the manual resumption of Flutter frames after application initialization tasks are completed. It ensures that the splash screen is displayed until all necessary setup is done, preventing UI rendering until ready. Dependencies include the 'splash_master' package. ```dart import 'package:flutter/material.dart'; import 'package:splash_master/splash_master.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); SplashMaster.initialize(); // Defer Flutter frames // Perform initialization tasks await performAppInitialization(); // Resume Flutter rendering after initialization SplashMaster.resume(); runApp(const MyApp()); } Future performAppInitialization() async { // Load preferences await loadUserPreferences(); // Initialize services await initializeDatabase(); // Fetch remote config await fetchRemoteConfiguration(); // Add artificial delay if needed await Future.delayed(const Duration(seconds: 2)); } Future loadUserPreferences() async { // Simulate loading preferences await Future.delayed(const Duration(milliseconds: 500)); } Future initializeDatabase() async { // Simulate database initialization await Future.delayed(const Duration(milliseconds: 300)); } Future fetchRemoteConfiguration() async { // Simulate network call await Future.delayed(const Duration(milliseconds: 700)); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( home: const HomeScreen(), ); } } class HomeScreen extends StatelessWidget { const HomeScreen({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('App Initialized')), body: const Center(child: Text('Ready to use! berlangganan')), ); } } ``` -------------------------------- ### Manual Resume for Image Splash Screen in Flutter Source: https://github.com/simformsolutionspvtltd/splash_master/blob/master/doc/documentation.md This example shows how to handle an image splash screen where manual resumption is required. After initializing Splash Master, `SplashMaster.resume()` must be explicitly called to transition from the native splash to the Flutter app. This is crucial for image-based splashes. ```dart void main() { WidgetsFlutterBinding.ensureInitialized(); SplashMaster.initialize(); // Perform any setup/config before resuming SplashMaster.resume(); runApp( MaterialApp( home: YourWidget(), // Your first screen ), ); } ``` -------------------------------- ### Initialize and Run Custom Splash Screen - Dart Source: https://context7.com/simformsolutionspvtltd/splash_master/llms.txt This Dart code snippet shows the main entry point of a Flutter application. It initializes the splash_master package and runs the MyApp widget, which sets up the MaterialApp and navigates to a custom splash widget. Ensure the splash_master package is added as a dependency. ```dart import 'package:flutter/material.dart'; import 'package:splash_master/splash_master.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); SplashMaster.initialize(); runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return const MaterialApp( home: CustomSplashWidget(), ); } } class CustomSplashWidget extends StatefulWidget { const CustomSplashWidget({super.key}); @override State createState() => _CustomSplashWidgetState(); } class _CustomSplashWidgetState extends State with SingleTickerProviderStateMixin { late AnimationController _controller; late Animation _fadeAnimation; late Animation _scaleAnimation; bool _isReady = false; @override void initState() { super.initState(); _controller = AnimationController( duration: const Duration(milliseconds: 1500), vsync: this, ); _fadeAnimation = Tween(begin: 0.0, end: 1.0).animate( CurvedAnimation(parent: _controller, curve: Curves.easeIn), ); _scaleAnimation = Tween(begin: 0.5, end: 1.0).animate( CurvedAnimation(parent: _controller, curve: Curves.easeOutBack), ); _initializeApp(); } Future _initializeApp() async { // Resume Flutter frames SplashMaster.resume(); // Start custom animation _controller.forward(); // Perform app initialization await Future.delayed(const Duration(seconds: 2)); setState(() => _isReady = true); // Navigate after animation completes await Future.delayed(const Duration(milliseconds: 500)); if (mounted) { Navigator.of(context).pushReplacement( MaterialPageRoute(builder: (_) => const HomeScreen()), ); } } @override void dispose() { _controller.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.deepPurple, body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ AnimatedBuilder( animation: _controller, builder: (context, child) { return Transform.scale( scale: _scaleAnimation.value, child: Opacity( opacity: _fadeAnimation.value, child: child, ), ); }, child: const Icon( Icons.rocket_launch, size: 100, color: Colors.white, ), ), const SizedBox(height: 24), if (_isReady) const FadeInText(text: 'Ready!'), ], ), ), ); } } class FadeInText extends StatefulWidget { final String text; const FadeInText({super.key, required this.text}); @override State createState() => _FadeInTextState(); } class _FadeInTextState extends State with SingleTickerProviderStateMixin { late AnimationController _controller; late Animation _animation; @override void initState() { super.initState(); _controller = AnimationController( duration: const Duration(milliseconds: 500), vsync: this, )..forward(); _animation = CurvedAnimation(parent: _controller, curve: Curves.easeIn); } @override void dispose() { _controller.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return FadeTransition( opacity: _animation, child: Text( widget.text, style: const TextStyle( fontSize: 24, fontWeight: FontWeight.bold, color: Colors.white, ), ), ); } } class HomeScreen extends StatelessWidget { const HomeScreen({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('Home')), body: const Center(child: Text('Welcome!')), ); } } ``` -------------------------------- ### Activate and Use Splash Master Globally Source: https://github.com/simformsolutionspvtltd/splash_master/blob/master/doc/documentation.md This demonstrates an alternative method to generate native splash screens by first activating the splash_master package globally. This allows you to run the creation command from any directory within your project. ```bash dart pub global activate splash_master splash_master create ``` -------------------------------- ### Generate Native Splash Screens using CLI Source: https://context7.com/simformsolutionspvtltd/splash_master/llms.txt This code demonstrates how to generate native splash screen configurations for Android and iOS using the Splash Master CLI tool. It covers adding configurations to `pubspec.yaml` and running the `create` command, including global activation. ```bash # Add splash_master configuration to pubspec.yaml cat >> pubspec.yaml << 'EOF' splash_master: color: '#FFFFFF' image: 'assets/splash.png' ios_content_mode: 'center' android_gravity: 'center' background_image: 'assets/background.png' ios_background_content_mode: 'scaleToFill' android_background_image_gravity: 'fill' image_dark_android: 'assets/splash_dark.png' android_dark_gravity_key: 'center' color_dark_android: '#000000' android_12_and_above: color: '#FFFFFF' image: 'assets/splash_12.png' branding_image: 'assets/branding.png' EOF # Generate native splash screens dart run splash_master create # Or activate globally and run dart pub global activate splash_master splash_master create ``` -------------------------------- ### Initialize and Display Video Splash Screen in Flutter Source: https://github.com/simformsolutionspvtltd/splash_master/blob/master/doc/documentation.md This snippet demonstrates how to initialize Splash Master and display a video splash screen. It requires `WidgetsFlutterBinding.ensureInitialized()` and `SplashMaster.initialize()`. The `home` property of `MaterialApp` is set to `SplashMaster.video()` to show the video splash. Manual resume is not needed for video splashes. ```dart void main() { WidgetsFlutterBinding.ensureInitialized(); SplashMaster.initialize(); runApp( MaterialApp( home: SplashMaster.video(/* config */), ), ); } ``` -------------------------------- ### Configure Splash Screen Media Sources in Dart Source: https://context7.com/simformsolutionspvtltd/splash_master/llms.txt Demonstrates how to configure various media sources for splash screens using the Splash Master package. Supports asset files, device files, network URLs, raw bytes, and pre-loaded Rive artboards. The `SplashMaster` widget can then utilize these sources for video, Lottie, or Rive animations. ```dart import 'package:flutter/material.dart'; import 'package:splash_master/splash_master.dart'; import 'dart:io'; import 'dart:typed_data'; import 'package:rive/rive.dart'; // Asset source - Load from Flutter assets final assetSource = AssetSource('assets/videos/splash.mp4'); // Device file source - Load from device storage final deviceFileSource = DeviceFileSource('/storage/emulated/0/splash.mp4'); await deviceFileSource.setSource(); // Initialize file reference File videoFile = deviceFileSource.file; // Network source - Load from URL final networkSource = NetworkFileSource('https://example.com/splash.mp4'); Uri? videoUrl = networkSource.url; // Automatically parsed // Bytes source - Load from memory final Uint8List videoBytes = await loadVideoBytes(); final bytesSource = BytesSource(videoBytes); // Rive artboard source - Use pre-loaded Rive artboard (Rive only) final riveData = await rootBundle.load('assets/rive/animation.riv'); final riveFile = RiveFile.import(riveData); final artboard = riveFile.mainArtboard; final riveArtboardSource = RiveArtboardSource(artboard); // Usage examples Widget buildVideoSplash() { return SplashMaster.video( source: networkSource, nextScreen: const HomeScreen(), ); } Widget buildLottieSplash() { return SplashMaster.lottie( source: bytesSource, nextScreen: const HomeScreen(), ); } Widget buildRiveSplash() { return SplashMaster.rive( source: riveArtboardSource, // Only RiveArtboardSource allowed for Rive nextScreen: const HomeScreen(), ); } ``` -------------------------------- ### Configure Video Splash Screen with VideoConfig (Dart) Source: https://context7.com/simformsolutionspvtltd/splash_master/llms.txt Demonstrates how to configure a video splash screen using SplashMaster's `video` constructor and `VideoConfig`. It shows how to set autoplay, display mode, SafeArea usage, and provides a callback for when the video controller is initialized. Inside the callback, you can access video properties, control playback, listen for completion, adjust speed, and set volume. ```dart import 'package:flutter/material.dart'; import 'package:splash_master/splash_master.dart'; import 'package:video_player/video_player.dart'; class VideoConfigExample extends StatelessWidget { const VideoConfigExample({super.key}); @override Widget build(BuildContext context) { return SplashMaster.video( source: AssetSource('assets/splash.mp4'), videoConfig: VideoConfig( // Auto-play video when loaded (default: true) playImmediately: true, // Display mode for video videoVisibilityEnum: VisibilityEnum.useAspectRatio, // Options: useFullScreen, useAspectRatio, none // Wrap video in SafeArea (default: false) useSafeArea: false, // Access video controller when initialized onVideoControllerInitialised: (VideoPlayerController controller) { print('Video initialized'); print('Duration: ${controller.value.duration}'); print('Size: ${controller.value.size}'); print('Aspect ratio: ${controller.value.aspectRatio}'); // Custom playback control if (!controller.value.isPlaying) { controller.play(); } // Listen to playback position controller.addListener(() { if (controller.value.position >= controller.value.duration) { print('Video completed'); } }); // Adjust playback speed controller.setPlaybackSpeed(1.5); // Set volume controller.setVolume(0.8); }, ), backGroundColor: Colors.black, nextScreen: const HomeScreen(), ); } } // Manual playback control example class ManualVideoPlaybackExample extends StatefulWidget { const ManualVideoPlaybackExample({super.key}); @override State createState() => _State(); } class _State extends State { VideoPlayerController? _videoController; @override Widget build(BuildContext context) { return SplashMaster.video( source: AssetSource('assets/splash.mp4'), videoConfig: VideoConfig( playImmediately: false, videoVisibilityEnum: VisibilityEnum.useFullScreen, onVideoControllerInitialised: (controller) { _videoController = controller; // Delay playback by 1 second Future.delayed(const Duration(seconds: 1), () { controller.play(); }); }, ), nextScreen: const HomeScreen(), ); } @override void dispose() { _videoController?.dispose(); super.dispose(); } } class HomeScreen extends StatelessWidget { const HomeScreen({super.key}); @override Widget build(BuildContext context) { return Scaffold(body: const Center(child: Text('Home'))); } } ``` -------------------------------- ### Generate Native Splash Screen using Dart CLI Source: https://github.com/simformsolutionspvtltd/splash_master/blob/master/doc/documentation.md This command initiates the generation of native splash screen files for Android and iOS. It ensures that the native components required for the splash screen are correctly set up within your project. ```bash dart run splash_master create ``` -------------------------------- ### Initialize and Display Rive Splash Screen in Flutter Source: https://github.com/simformsolutionspvtltd/splash_master/blob/master/doc/documentation.md This snippet illustrates how to implement a Rive animation as a splash screen with Splash Master. It includes `WidgetsFlutterBinding.ensureInitialized()`, `SplashMaster.initialize()`, and sets `SplashMaster.rive()` as the `home` for `MaterialApp`. Manual resume is not necessary for Rive splashes. ```dart void main() { WidgetsFlutterBinding.ensureInitialized(); SplashMaster.initialize(); runApp( MaterialApp( home: SplashMaster.rive(/* config */), ), ); } ``` -------------------------------- ### Implement Video Splash Screen in Flutter Source: https://context7.com/simformsolutionspvtltd/splash_master/llms.txt This Dart code snippet shows how to implement a video splash screen using the SplashMaster.video() function. It requires initializing SplashMaster and provides options for video source, configuration (like immediate playback and aspect ratio), background color, and the next screen. ```dart import 'package:flutter/material.dart'; import 'package:splash_master/splash_master.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); SplashMaster.initialize(); runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( home: SplashMaster.video( source: AssetSource('assets/videos/splash.mp4'), videoConfig: const VideoConfig( playImmediately: true, videoVisibilityEnum: VisibilityEnum.useAspectRatio, useSafeArea: false, onVideoControllerInitialised: (controller) { // Access video controller for custom controls print('Video duration: ${controller.value.duration}'); }, ), backGroundColor: Colors.white, nextScreen: const HomeScreen(), onSourceLoaded: () { print('Video loaded'); SplashMaster.resume(); // Called automatically if not provided }, ), ); } } class HomeScreen extends StatelessWidget { const HomeScreen({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('Home')), body: const Center(child: Text('Welcome!')), ); } } ``` -------------------------------- ### Configure Splash Master in pubspec.yaml Source: https://context7.com/simformsolutionspvtltd/splash_master/llms.txt This snippet shows how to add Splash Master configuration to your `pubspec.yaml` file. It includes settings for background color, images (including dark mode and Android 12+ specifics), and content modes for different platforms. ```yaml splash_master: color: '#FFFFFF' image: 'assets/splash.png' ios_content_mode: 'center' android_gravity: 'center' background_image: 'assets/background.png' ios_background_content_mode: 'scaleToFill' android_background_image_gravity: 'fill' image_dark_android: 'assets/splash_dark.png' android_dark_gravity_key: 'center' color_dark_android: '#000000' android_12_and_above: color: '#FFFFFF' image: 'assets/splash_12.png' branding_image: 'assets/branding.png' ``` -------------------------------- ### Using a Custom Widget for Splash Screen in Flutter Source: https://github.com/simformsolutionspvtltd/splash_master/blob/master/doc/documentation.md This snippet demonstrates how to use a custom widget as the splash screen with Splash Master. Initialize the package and then set your custom widget as the `home` of the `MaterialApp`. This allows for complete control over the splash screen's appearance and behavior. ```dart void main() { WidgetsFlutterBinding.ensureInitialized(); SplashMaster.initialize(); runApp( MaterialApp( home: YourCustomWidget(), ), ); } ``` -------------------------------- ### Flutter Lottie Animation Splash Screen with SplashMaster Source: https://context7.com/simformsolutionspvtltd/splash_master/llms.txt Renders a Lottie animation as a splash screen. It supports various configurations for animation playback, appearance, and error handling. Requires the 'splash_master' and 'lottie' packages. ```dart import 'package:flutter/material.dart'; import 'package:splash_master/splash_master.dart'; import 'package:lottie/lottie.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); SplashMaster.initialize(); runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( home: SplashMaster.lottie( source: AssetSource('assets/lottie/splash.json'), lottieConfig: LottieConfig( animate: true, repeat: false, reverse: false, fit: BoxFit.contain, alignment: Alignment.center, width: 300, height: 300, frameRate: FrameRate.composition, visibilityEnum: VisibilityEnum.useAspectRatio, aspectRatio: 9 / 16, overrideBoxFit: true, addRepaintBoundary: true, filterQuality: FilterQuality.high, onLoaded: (composition) { print('Lottie loaded: ${composition.duration}'); }, onWarning: (warning) { print('Lottie warning: $warning'); }, errorBuilder: (context, error, stackTrace) { return const Center(child: Text('Failed to load animation')); }, ), backGroundColor: Colors.blue, nextScreen: const DashboardScreen(), ), ); } } class DashboardScreen extends StatelessWidget { const DashboardScreen({super.key}); @override Widget build(BuildContext context) { return Scaffold( body: const Center(child: Text('Dashboard')), ); } } ``` -------------------------------- ### Add Splash Master Dependency to pubspec.yaml Source: https://github.com/simformsolutionspvtltd/splash_master/blob/master/doc/documentation.md This snippet shows how to add the splash_master package as a dependency in your Flutter project's pubspec.yaml file. Ensure you replace `` with the current version from pub.dev. ```yaml dependencies: splash_master: ``` -------------------------------- ### Import Splash Master Package in Dart Source: https://github.com/simformsolutionspvtltd/splash_master/blob/master/doc/documentation.md This import statement is required in your Dart files to access and utilize the functionalities provided by the splash_master Flutter plugin. ```dart import 'package:splash_master/splash_master.dart'; ``` -------------------------------- ### Flutter Rive Animation Splash Screen with SplashMaster Source: https://context7.com/simformsolutionspvtltd/splash_master/llms.txt Displays a Rive animation as a splash screen, supporting state machines and custom controllers. It allows for detailed configuration of animation playback, appearance, and error handling. Requires the 'splash_master' and 'rive' packages. ```dart import 'package:flutter/material.dart'; import 'package:splash_master/splash_master.dart'; import 'package:rive/rive.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); SplashMaster.initialize(); runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( home: SplashMaster.rive( source: AssetSource('assets/rive/splash.riv'), riveConfig: RiveConfig( stateMachineName: ['State Machine 1'], animations: ['Animation 1', 'Timeline 1'], artboardName: 'Artboard', autoplay: true, fit: BoxFit.contain, alignment: Alignment.center, useSafeArea: false, loadCdnAssets: true, isTouchScrollEnabled: false, speedMultiplier: 1.0, antialiasing: true, enablePointerEvents: false, splashDuration: const Duration(seconds: 3), onInit: (artboard) { print('Rive artboard initialized: ${artboard.name}'); }, placeHolder: const CircularProgressIndicator(), ), backGroundColor: Colors.white, nextScreen: const MainScreen(), ), ); } } // Using pre-loaded RiveArtboardSource class RiveArtboardSplashExample extends StatefulWidget { const RiveArtboardSplashExample({super.key}); @override State createState() => _State(); } class _State extends State { Artboard? _artboard; @override void initState() { super.initState(); _loadRiveFile(); } Future _loadRiveFile() async { final data = await rootBundle.load('assets/rive/splash.riv'); final file = RiveFile.import(data); setState(() { _artboard = file.mainArtboard; }); } @override Widget build(BuildContext context) { if (_artboard == null) { return const CircularProgressIndicator(); } return SplashMaster.rive( source: RiveArtboardSource(_artboard!), riveConfig: const RiveConfig( stateMachineName: ['State Machine 1'], splashDuration: Duration(seconds: 2), ), nextScreen: const HomeScreen(), ); } } class MainScreen extends StatelessWidget { const MainScreen({super.key}); @override Widget build(BuildContext context) { return Scaffold( body: const Center(child: Text('Main Screen')), ); } } ``` -------------------------------- ### Configure Splash Master in pubspec.yaml Source: https://github.com/simformsolutionspvtltd/splash_master/blob/master/doc/documentation.md This configuration section within your pubspec.yaml file allows you to customize various aspects of the splash screen, including colors, images, content modes for iOS, and gravity for Android. It also supports dark mode and Android 12+ specific settings. ```yaml splash_master: # Use to specifies the color for the splash screen color: '#FFFFFF' # Use to specifies the splash image image: 'assets/splash.png' # Provides content mode for splash image in iOS # iOS content mode options: scaleToFill, scaleAspectFit, scaleAspectFill, redraw, center, top, bottom, # left, right, topLeft, topRight, bottomLeft, bottomRight. ios_content_mode: 'center' # Provides gravity for splash image in Android # Android gravity options: center, clip_horizontal, clip_vertical, fill_horizontal, fill, center_vertical, # bottom, fill_vertical, center_horizontal, top, end, left, right, start android_gravity: 'center' # Use to specifies the splash image background_image: 'assets/background_image.png' # Provided content mode for splash image in background for iOS ios_background_content_mode: 'scaleToFill' # Provides gravity for background image in Android # Android gravity options: center, clip_horizontal, clip_vertical, fill_horizontal, fill, center_vertical, # bottom, fill_vertical, center_horizontal, top, end, left, right, start android_background_image_gravity: 'fill' # Use to specifies image for android in dark mode image_dark_android: 'assets/splash_dark.png' # Provides gravity for splash image for Android in dark mode android_dark_gravity_key: 'center' # Use to specifies the color for the splash screen for Android in dark mode color_dark_android: '#000000' # Section to specifies the configuration for the splash in Android 12+ android_12_and_above: # Provides the background color of splash screen color: '#FFFFFF' # Provides custom icon to replace the default app icon image: 'assets/splash_12.png' # Provides branding image which is shown under main icon image. branding_image: 'assets/branding_image.png' ``` -------------------------------- ### Implement Custom Navigation After Splash Screen in Dart Source: https://context7.com/simformsolutionspvtltd/splash_master/llms.txt Shows how to override the default navigation behavior after a splash screen using custom transitions and routing logic within the Splash Master package. This allows for custom animations or navigation to specific named routes upon completion of the splash screen. ```dart import 'package:flutter/material.dart'; import 'package:splash_master/splash_master.dart'; class CustomNavigationExample extends StatelessWidget { const CustomNavigationExample({super.key}); @override Widget build(BuildContext context) { return MaterialApp( home: SplashMaster.video( source: AssetSource('assets/splash.mp4'), nextScreen: const HomeScreen(), customNavigation: () { // Custom fade transition instead of default MaterialPageRoute Navigator.of(context).pushReplacement( PageRouteBuilder( pageBuilder: (context, animation, secondaryAnimation) { return const HomeScreen(); }, transitionsBuilder: (context, animation, secondaryAnimation, child) { return FadeTransition( opacity: animation, child: child, ); }, transitionDuration: const Duration(milliseconds: 800), ), ); }, ), ); } } // Using named routes with custom navigation class NamedRouteExample extends StatelessWidget { const NamedRouteExample({super.key}); @override Widget build(BuildContext context) { return MaterialApp( routes: { '/home': (context) => const HomeScreen(), '/dashboard': (context) => const DashboardScreen(), }, home: SplashMaster.lottie( source: AssetSource('assets/splash.json'), customNavigation: () { Navigator.of(context).pushReplacementNamed('/dashboard'); }, ), ); } } class HomeScreen extends StatelessWidget { const HomeScreen({super.key}); @override Widget build(BuildContext context) { return Scaffold(body: const Center(child: Text('Home'))); } } class DashboardScreen extends StatelessWidget { const DashboardScreen({super.key}); @override Widget build(BuildContext context) { return Scaffold(body: const Center(child: Text('Dashboard'))); } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.