launchApp static method
void
launchApp(
- BuildContext context, {
- String? leadingTitle,
- required String title,
- String? bgImage,
- required Map<
String, dynamic> wallpaperUrls, - PlacementBuilder? placementBuilder,
- EventActionCallback? onTapEvent,
- Future<
bool> onSetOrDownloadWallpaper()?, - bool isTrendingEnabled = true,
- bool isCacheEnabled = true,
Implementation
static void launchApp(
BuildContext context, {
/// This [leadingTitle] will be added before main [title]
final String? leadingTitle,
/// This is the main title text
required final String title,
/// This will be added as a background image with blur effect
final String? bgImage,
/// This will be list of all wallpaper URLs that a user wants to add inn the package
required final Map<String, dynamic> wallpaperUrls,
/// [placementBuilder] is used to build your custom widget at specific places
final PlacementBuilder? placementBuilder,
/// [onTapEvent] will be call on every event preformed by the user
final EventActionCallback? onTapEvent,
/// [onSetOrDownloadWallpaper] will be call when user set or download wallpaper
final Future<bool> Function(BuildContext)? onSetOrDownloadWallpaper,
/// If this [isTrendingEnabled = true], package gather all wallpapers
/// automatically and create a new category called trending
final bool isTrendingEnabled = true,
/// If [isCacheEnabled = true], package gather all wallpapers urls
/// automatically from the shared preferences and get all wallpapers from the
/// cache from url as cache key
final bool isCacheEnabled = true,
}) =>
Navigator.of(context).push(
MaterialPageRoute(
fullscreenDialog: true,
builder: (context) => Scaffold(
body: EasyWallpaperApp(
leadingTitle: leadingTitle,
title: title,
bgImage: bgImage,
wallpaperUrls: wallpaperUrls,
placementBuilder: placementBuilder,
onTapEvent: onTapEvent,
onSetOrDownloadWallpaper: onSetOrDownloadWallpaper,
isCacheEnabled: isCacheEnabled,
isTrendingEnabled: isTrendingEnabled,
),
),
),
);