launchApp static method

void launchApp(
  1. BuildContext context, {
  2. String? leadingTitle,
  3. required String title,
  4. String? bgImage,
  5. required Map<String, dynamic> wallpaperUrls,
  6. PlacementBuilder? placementBuilder,
  7. EventActionCallback? onTapEvent,
  8. Future<bool> onSetOrDownloadWallpaper(
    1. BuildContext
    )?,
  9. bool isTrendingEnabled = true,
  10. 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,
          ),
        ),
      ),
    );