A small splashscreen used as intro for flutter applications easily with a lot of customizations ❤️🥳

Overview

Splash Screen

  • A splashscreen package to be used for an intro for any flutter application easily with a lot of customization

Currently Supported by awesome DPLYR

image (alt)

  • DPLYR is a new generation of cloud platforms and aims to help developers in their road with open source contributions, and at the end we can say thanks.

Screenshots

screenshot description (alt)

Usage

Example

To use this package :

  dependencies:
    flutter:
      sdk: flutter
    splashscreen:

How to use

new SplashScreen.timer(
  seconds: 14,
  navigateAfterSeconds: new AfterSplash(),
  title: new Text('Welcome In SplashScreen'),
  image: new Image.asset('screenshot.png'),
  backgroundColor: Colors.white,
  styleTextUnderTheLoader: new TextStyle(),
  photoSize: 100.0,
  loaderColor: Colors.red
);

Example

As time based...

import 'package:flutter/material.dart';
import 'package:splashscreen/splashscreen.dart';

void main() {
  runApp(MaterialApp(home: MyApp()));
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return SplashScreen.timer(
      seconds: 14,
      navigateAfterSeconds: AfterSplash(),
      title: Text(
        'Welcome In SplashScreen',
        style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0),
      ),
      image: Image.network(
        'https://flutter.io/images/catalog-widget-placeholder.png',
      ),
      backgroundColor: Colors.white,
      loaderColor: Colors.red,
    );
  }
}

class AfterSplash extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Welcome In SplashScreen Package'),
        automaticallyImplyLeading: false,
      ),
      body: Center(
        child: Text(
          'Succeeded!',
          style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30.0),
        ),
      ),
    );
  }
}

As future based...

import 'package:flutter/material.dart';
import 'package:splashscreen/splashscreen.dart';

void main() {
  runApp(MaterialApp(home: MyApp()));
}

Future<Widget> loadFromFuture() async {
  // <fetch data from server. ex. login>
  return AfterSplash();
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return SplashScreen.future(
      navigateAfterFuture: loadFromFuture(),
      navigateAfterSeconds: AfterSplash(),
      title: Text(
        'Welcome In SplashScreen',
        style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0),
      ),
      image: Image.network(
        'https://flutter.io/images/catalog-widget-placeholder.png',
      ),
      backgroundColor: Colors.white,
      loaderColor: Colors.red,
    );
  }
}

class AfterSplash extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Welcome In SplashScreen Package'),
        automaticallyImplyLeading: false,
      ),
      body: Center(
        child: Text(
          'Succeeded!',
          style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30.0),
        ),
      ),
    );
  }
}

Animate the main image with the hero animation

The main image has this tag attached to it splashscreenImage. Add it to whatever page you'll navigate to. This will animate the main Image to the same image you put in another page

Adding a custom page tranistion

You can use the pageRoute to do just this. Here's an example

import 'package:flutter/material.dart';
import 'package:splashscreen/splashscreen.dart';

void main() {
  runApp(MaterialApp(home: MyApp()));
}

Route _createRoute() {
  return PageRouteBuilder(
    pageBuilder: (context, animation, secondaryAnimation) => AfterSplash(),
    transitionsBuilder: (context, animation, secondaryAnimation, child) {
      var begin = Offset(0.0, 1.0);
      var end = Offset.zero;
      var curve = Curves.ease;
      var tween = Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
      return SlideTransition(
        position: animation.drive(tween),
        child: child,
      );
    },
  );
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return SplashScreen.timer(
      seconds: 14,
      navigateAfterSeconds: AfterSplash(),
      title: Text(
        'Welcome In SplashScreen',
        style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0),
      ),
      image: Image.network(
        'https://flutter.io/images/catalog-widget-placeholder.png',
      ),
      backgroundColor: Colors.white,
      loaderColor: Colors.red,
      pageRoute: _createRoute(),
    );
  }
}

class AfterSplash extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Welcome In SplashScreen Package'),
        automaticallyImplyLeading: false,
      ),
      body: Center(
        child: Text(
          'Succeeded!',
          style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30.0),
        ),
      ),
    );
  }
}

All Supported Projects by DPLYR

  • Splash Screen - Flutter
    a flutter package created to show simple splashscreen

  • In App Call Alert - Flutter
    a flutter package created to show call alert with sound

  • File Manager
    a php project created to manage machines/servers through ftp servers

  • Countries Js
    a javascript project created for retrieving country details with flexibility.

  • Block temp mails
    a javascript api to prevent temporary emails from signing up on your website. Super easy to use

  • Disposable Emails List
    a python script to generate the temporary and spam doamins to prevent them and you can block them through this API Block temp mails

  • Basic CRM
    A crm that is developed with Node Js for entreprenurs who need a basic CRM with text replacment feature

  • Basic Finance
    A finance that is developed with Node Js

About DPLYR

DPLYR is a SaaS tool that helps developers just like you to deploy their web apps more easily. It supports deploying Node.js apps with MongoDB, MySQL or PostgreSQL databases all for free. Go now to www.dplyr.dev and create a free account.

Created by Karim Mohamed

Comments
  • Null-Safety support

    Null-Safety support

    Is your feature request related to a problem? Please describe. No dart null-safety support which prevents us from migrating to null-safety

    Describe the solution you'd like Add dart null-safety support

    Describe alternatives you've considered Copy your code and implement null-safety inside our project

    Additional context NA

    opened by kuromukira 8
  • Splash Screen is not supported with nullsafety

    Splash Screen is not supported with nullsafety

    When I am trying to implement splash screen in my code with null safety. Then it shows - package: splashscreen is not supported with null safety. Flutter version: 2.2.0 Framework • revision b22742018b Engine • revision a9d88a4d18 Tools • Dart 2.13.0 splash scree

    opened by Ankit-jailwal 7
  • Invalid argument(s): widget.routeName must be a String beginning with forward slash (/)

    Invalid argument(s): widget.routeName must be a String beginning with forward slash (/)

    It has been working well but after the update you made, it is giving an error.

    Here is my code

    class WelcomeScreen extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'WKS', home: Scaffold( backgroundColor: kAccentLight, body: SafeArea( child: SplashScreen( seconds: 4, navigateAfterSeconds: App(), title: new Text('Title', style: TextStyle(fontSize: 36, color: kAmber400, fontWeight: FontWeight.bold), ), backgroundColor: kAccent, styleTextUnderTheLoader: new TextStyle(), loaderColor: kBrown900, ), ), ) ); } }

    opened by Nkurayijahubert 6
  • No MediaQuery widget ancestor found

    No MediaQuery widget ancestor found

    I have tried to use the basic example from pub.dev but I am getting this error:

    ======== Exception caught by widgets library =======================================================
    The following assertion was thrown building SplashScreen(state: _SplashScreenState#179cb):
    No MediaQuery widget ancestor found.
    
    Scaffold widgets require a MediaQuery widget ancestor.
    The specific widget that could not find a MediaQuery ancestor was: Scaffold
      dirty
      state: ScaffoldState#1979d(lifecycle state: initialized, tickers: tracking 2 tickers)
    The ownership chain for the affected widget is: "Scaffold ← SplashScreen ← MyApp ← [root]"
    
    No MediaQuery ancestor could be found starting from the context that was passed to MediaQuery.of(). This can happen because you have not added a WidgetsApp, CupertinoApp, or MaterialApp widget (those widgets introduce a MediaQuery), or it can happen if the context you use comes from a widget above those widgets.
    
    The relevant error-causing widget was: 
      SplashScreen file:///G:/TAMIR/Desktop/Ghinbli%20app/Ghibli-fun/lib/main.dart:29:13
    When the exception was thrown, this was the stack: 
    #0      debugCheckHasMediaQuery.<anonymous closure> (package:flutter/src/widgets/debug.dart:218:7)
    #1      debugCheckHasMediaQuery (package:flutter/src/widgets/debug.dart:233:4)
    #2      MediaQuery.of (package:flutter/src/widgets/media_query.dart:820:12)
    #3      ScaffoldState.didChangeDependencies (package:flutter/src/material/scaffold.dart:2775:50)
    #4      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4843:11)
    ...
    ====================================================================================================
    
    

    My code (taken from the library readme example page):

    import 'package:flutter/material.dart';
    import 'package:splashscreen/splashscreen.dart';
    
    void main() {
      runApp(MyApp());
    }
    
    class MyApp extends StatefulWidget {
      @override
      _MyAppState createState() => new _MyAppState();
    }
    
    class _MyAppState extends State<MyApp> {
      @override
      Widget build(BuildContext context) {
        return  SplashScreen(
          seconds: 14,
          navigateAfterSeconds: new AfterSplash(),
          title:  Text('Welcome In SplashScreen', style:  TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0),
          ),
          image:  Image.network(
              'https://flutter.io/images/catalog-widget-placeholder.png'),
          backgroundColor: Colors.white,
          loaderColor: Colors.red,
        );
      }
    }
    
    

    I am getting this error while using:

    • Nexus 5 API emulator
    • Os is windows 10

    Widget test fails with No MediaQuery widget found is the closest thing I could find searching for this problem but it didn't solve my problem.

    opened by Tamir198 4
  • Error while executing code

    Error while executing code

    Please find below the error message that I have received when I used the example file

    Invalid argument(s): widget.routeName must be a String beginning with forward slash (/)

    The relevant error-causing widget was: LeviSplash file:///Users/**/Desktop/Flutter/*/lib/main.dart:7:13 When the exception was thrown, this was the stack: #0 _SplashScreenState.initState (package:splashscreen/splashscreen.dart:86:7) #1 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4765:58) #2 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4601:5) #3 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14) #4 Element.updateChild (package:flutter/src/widgets/framework.dart:3324:20)

    What should i do ?


    Describe the bug A clear and concise description of what the bug is.

    To Reproduce Steps to reproduce the behavior:

    1. Go to '...'
    2. Click on '....'
    3. Scroll down to '....'
    4. See error

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots If applicable, add screenshots to help explain your problem.

    Desktop (please complete the following information):

    • OS: [e.g. iOS]
    • Browser [e.g. chrome, safari]
    • Version [e.g. 22]

    Smartphone (please complete the following information):

    • Device: [e.g. iPhone6]
    • OS: [e.g. iOS8.1]
    • Browser [e.g. stock browser, safari]
    • Version [e.g. 22]

    Additional context Add any other context about the problem here.

    opened by johnfriend 4
  • How I set an asset image as background?

    How I set an asset image as background?

    class _WelcomePageState extends State { @override Widget build(BuildContext context) { return SplashScreen( seconds: 25, navigateAfterSeconds: HomePage(), title: Text('Ace Squad', style: TextStyle( fontWeight: FontWeight.bold, fontSize: 30.0 ),), image: Image.asset("images/skull.png", height: 250.0, width: 250.0 ), imageBackground: , //backgroundColor: Colors.black, styleTextUnderTheLoader: TextStyle(), photoSize: 100.0, onClick: ()=>print("Flutter Egypt"), loaderColor: Colors.white
    ); } }

    opened by mhsampaio 4
  • how to fill splash screen image to screen??

    how to fill splash screen image to screen??

    Is there any way to compleately fill hight width with certain image ?? photoSize currently takes an integer and its hard to provide specific data for filling an image to splash screen.

    opened by TusharAswal 4
  • Option to disable loader

    Option to disable loader

    Hi, It's possible to add an option to disable the loader ? Like :

    new SplashScreen(
            seconds: 3,
            navigateAfterSeconds: new HomeScreen(),
            title: new Text('Welcome In SplashScreen'),
            useLoader: false // remove the loader
    )
    
    opened by EmilienLeroy 3
  • [PR] Close the splashscreen programmatically

    [PR] Close the splashscreen programmatically

    There are certain use cases, when the splash screen should stay until the app is actually ready e.g. load DB, settings, connect to the backend and etc. In such cases, the splash screen should be removed from the app, once everything is ready and this moment might vary on different devices. Hence instead of seconds property, it would be nice to have a method e.g. hide, which hides the splash screen programmatically. In case such method exists, please let me know, otherwise, I believe it would be worthwhile to have it implemented.

    opened by angel1st 3
  •  Can't return a value from a void function

    Can't return a value from a void function

    I am having an issue as shown below.

    compiler message: file:///Users/niyazitoros/.pub-cache/hosted/pub.dartlang.org/splashscreen-1.1.0/lib/splashscreen.dart:49:40: Warning: Can't return a value from a void function.
    compiler message:           return **Navigator.of(context).pushReplacementNamed(widget.navigateAfterSeconds);**
    compiler message:                                        ^
    compiler message: file:///Users/niyazitoros/.pub-cache/hosted/pub.dartlang.org/splashscreen-1.1.0/lib/splashscreen.dart:51:40: Warning: Can't return a value from a void function.
    compiler message:           r### eturn Navigator.of(context).pushReplacement(new MaterialPageRoute(builder: (BuildContext context) => widget.navigateAfterSeconds));
    compiler message:  
    

    Niyazis-MBP:capital_splash niyazitoros$ dart --version Dart VM version: 2.0.0-dev.69.5 (Tue Jul 31 15:05:14 2018 +0200) on "macos_x64"

    Niyazis-MBP:capital_splash niyazitoros$ flutter --version Flutter 0.8.2 • channel beta • https://github.com/flutter/flutter.git Framework • revision 5ab9e70727 (3 weeks ago) • 2018-09-07 12:33:05 -0700 Engine • revision 58a1894a1c

    opened by NTMS2017 3
  • Fix: wrong assumption on routeName

    Fix: wrong assumption on routeName

    Current assumption always validates to true. I guess the initial intention was to throw an error if a route does not start with a forward slash. fixes #50

    opened by fezu54 2
  • Splash in landscape mode

    Splash in landscape mode

    Hi guys, I hope you're alright.

    First of all, thanks for making this package available, it helps a lot when creating splashes for apps.

    I sent a message to Johannes on Youtube (https://www.youtube.com/watch?v=8ME8Czqc-Oc&lc) a while ago asking if it was possible to configure splash in landscape mode, however he told me that the package doesn't allow this configuration yet.

    So, what do you think about implementing this functionality in the package? Could you do this?

    opened by lucasfv1 0
  • doc: dependency version + package version added

    doc: dependency version + package version added

    This PR is to make the package version visible on the main documentation page. In the setup of the package, the version was missing, and also the version is added in this PR. Closes #68

    opened by sachin-dahal 0
  • Navigate after seconds function

    Navigate after seconds function

    I was using Getx as a route manager and it was necessary to use a function instead of an object, then I created this attribute which is a function to navigate after the splash is over.

    opened by gfb-47 1
  • Adding custom loader widget.

    Adding custom loader widget.

    The issue #66 "Custom loader widgets" suggest the functionality of using a custom loader widget instead of using the default circular. I added the functionality and I would like to receive your opinion and to be notified if changes are needed.

    opened by dmorales414 0
Owner
DPLYR
DPLYR
☀️ A Flutter package for some material design app intro screens with some cool animations.

IntroViews is inspired by Paper Onboarding and developed with love from scratch. Checkout our fully responsive live example app. Table of contents Fea

Ayush Agarwal 652 Dec 30, 2022
Intro to Flutter - Lewis Capaldi App

Intro to Flutter - Lewis Capaldi App Welcome to the Intro to Flutter event hosted by DSC Texas A&M Today's session will be a simple UI crash course. T

Rohan Kadkol 1 Aug 4, 2021
IntroAnimationSlider - A simple Flutte Animation Introduction for Mobile app easy to implement Using intro Views flutter

introappanimation simple Flutte Animation Introduction for Mobile app easy to im

null 3 Sep 22, 2022
A light weight library to easily manage a progress dialog with simple steps whenever you need to do it. You can easily show and hide it.

progress_dialog A light weight package to show progress dialog. As it is a stateful widget, you can change the text shown on the dialog dynamically. T

Mohammad Fayaz 202 Dec 11, 2022
A small library for creating snapping lists.

snaplist A small cozy library that allows you to make snappable list views. Issues and Pull Requests are really appreciated! Snaplist supports differe

David Leibovych 415 Dec 21, 2022
Multi directional infinite list with Sticky headers for Flutter applications

Sticky Infinite List Infinite list with sticky headers. This package was made in order to make possible render infinite list in both directions with s

Denis Beketsky 291 Dec 20, 2022
An advance flutter UI Kit for developing responsive, cross platform applications.

Liquid Build fast, responsive, cross platform apps with Liquid. Liquid is an open source UI toolkit for developing cross platform apps in Flutter. Qui

StackOrient Pvt. Ltd. 29 Dec 9, 2022
On-boarding page for flutter applications

onboarding This is a sample flutter onboarding plugin you use to attract first-time users when they land on your page, hence the name onboarding. You

Eyoel Defare 9 Nov 2, 2022
A Flutter widget that easily adds the flipping animation to any widget

flip_card A component that provides a flip card animation. It could be used for hiding and showing details of a product. How to use import 'package:fl

Bruno Jurković 314 Dec 31, 2022
A light weight package for flutter apps, that easily shows a splash screen with a nice fade animation.

Animated Splash Screen Using the package Get the library environment: sdk: ">=2.1.0 <3.0.0" Add dependency in pubspec.yaml dependencies: animated_

Mohammad Fayaz 112 Oct 6, 2022
A Flutter package for easily implementing Material Design navigation transitions.

Morpheus A Flutter package for easily implementing Material Design navigation transitions. Examples Parent-child transition You can use MorpheusPageRo

Sander R. D. Larsen 186 Jan 7, 2023
Easily add staggered animations to your ListView, GridView, Column and Row children.

Flutter Staggered Animations Easily add staggered animations to your ListView, GridView, Column and Row children as shown in Material Design guideline

null 1.2k Jan 6, 2023
Fade animation - Add fade animation to your app easily

fade_animation Add fade animation to your app easily using simple_animations pac

Mazouzi Aymene 3 Oct 6, 2022
🔔 A flutter package to create cool and beautiful text animations. [Flutter Favorite Package]

Animated Text Kit A flutter package which contains a collection of some cool and awesome text animations. Recommended package for text animations in C

Ayush Agarwal 1.4k Jan 6, 2023
This repository demonstrates use of various widgets in flutter and tricks to create beautiful UI elements in flutter for Android and IOS

AwesomeFlutterUI The purpose of this repository is to demonstrate the use of different widgets and tricks in flutter and how to use them in your proje

Subir Chakraborty 132 Nov 13, 2022
This is a Flutter URL preview plugin for Flutter that previews the content of a URL

flutter_link_preview This is a URL preview plugin that previews the content of a URL Language: English | 中文简体 Special feature Use multi-processing to

yung 67 Nov 2, 2022
Flutter liquid swipe - Liquid Swipe Animation Built With Flutter

Flutter Liquid Swipe liquid Swipe animation is amazing and its Created for iOS P

Jahongir Anvarov 6 Dec 1, 2022
A candy sorter game made with Flutter for the march flutter challenge.

A candy sorter game made with Flutter for the march flutter challenge.

Debjeet Das 1 Apr 9, 2022
✨ A collection of loading indicators animated with flutter. Heavily Inspired by http://tobiasahlin.com/spinkit.

✨ Flutter Spinkit A collection of loading indicators animated with flutter. Heavily inspired by @tobiasahlin's SpinKit. ?? Installing dependencies:

Jeremiah Ogbomo 2.7k Dec 30, 2022