flutter_start/lib/src/models/start_configuration.dart

64 lines
1.9 KiB
Dart
Raw Normal View History

2024-01-24 14:37:59 +01:00
import 'package:flutter/material.dart';
import 'package:flutter_introduction/flutter_introduction.dart';
@immutable
class StartUserStoryConfiguration {
const StartUserStoryConfiguration({
this.splashScreenBuilder,
2024-01-31 11:56:38 +01:00
this.introductionBuilder,
this.introductionOptionsBuilder,
2024-01-24 14:37:59 +01:00
this.introductionService,
this.homeEntry,
2024-01-31 11:56:38 +01:00
this.homeScreenRoute,
2024-01-24 14:37:59 +01:00
this.introductionFallbackScreen,
this.introductionScrollPhysics,
this.showIntroduction = true,
2024-01-24 16:56:53 +01:00
this.useKillswitch = false,
2024-01-31 11:56:38 +01:00
this.minimumSplashScreenDuration = 3,
this.splashScreenFuture,
this.splashScreenCenterWidget,
this.splashScreenBackgroundColor,
2024-01-24 14:37:59 +01:00
});
2024-01-31 11:56:38 +01:00
/// You can use this to build your own splash screen.
2024-01-24 14:37:59 +01:00
final Widget Function(
BuildContext context,
Function() onFinish,
)? splashScreenBuilder;
2024-01-31 11:56:38 +01:00
/// This is used to wrap the introduction widget in your own custom page.
final Widget Function(
BuildContext context,
Widget introductionPage,
)? introductionBuilder;
/// The route that is used to navigate to the home screen.
final String? homeScreenRoute;
2024-01-24 14:37:59 +01:00
final Widget? homeEntry;
2024-01-31 11:56:38 +01:00
final IntroductionOptions Function(BuildContext context)?
introductionOptionsBuilder;
2024-01-24 14:37:59 +01:00
final Widget? introductionFallbackScreen;
final IntroductionService? introductionService;
final ScrollPhysics? introductionScrollPhysics;
2024-01-31 11:56:38 +01:00
/// If the introduction should be shown.
final bool showIntroduction;
/// If the killswitch is enabled this app can be remotely disabled.
final bool useKillswitch;
/// The widget that is shown in the center of the splash screen.
final WidgetBuilder? splashScreenCenterWidget;
/// The background color of the splash screen.
final Color? splashScreenBackgroundColor;
/// The minimum duration the splash screen in seconds.
final int minimumSplashScreenDuration;
/// The future that is awaited before the splash screen is closed.
2024-02-13 11:57:58 +01:00
final Future<String?> Function(BuildContext context)? splashScreenFuture;
2024-01-24 14:37:59 +01:00
}