Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

splash screen flutter null safety

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

void main() {
  runApp(MaterialApp(
    home: SplashScreen.navigate(
      name: 'assets/intro.flr',
      next: (context) => SplashTela(),
      startAnimation: '1',
      backgroundColor: Color(0xff3333),
      until: () => Future.delayed(Duration(seconds: 5)),
    ),
  ));
}

class SplashTela extends StatefulWidget {
  @override
  _SplashTelaState createState() => _SplashTelaState();
}

class _SplashTelaState extends State<SplashTela> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: null,
      body: Container(
        color: Colors.redAccent,
      ),
    );
  }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #splash #screen #flutter #null #safety
ADD COMMENT
Topic
Name
1+7 =