fz3hra / vaultify

1 stars 1 forks source link

Add a Splash screen #3

Open baimamboukar opened 1 year ago

baimamboukar commented 1 year ago

A splash screen is the initial screen that appears when the app is launched, providing a smooth and visually appealing transition into the main interface. This task involves designing and implementing a splash screen for your Flutter mobile app

Todo

Shahabmustafa commented 1 year ago

i added some code please add this code to your project

import 'dart:async';

import 'package:band_two_pro/utils/routes/route_name.dart'; import 'package:flutter/material.dart';

class SplashPage extends StatefulWidget { const SplashPage({Key? key}) : super(key: key);

@override State createState() => _SplashPageState(); }

class _SplashPageState extends State {

SplashServer(BuildContext context){ Timer(Duration(seconds: 3), () { Navigator.pushNamed(context, RoutesName.location); }); }

@override void initState() { // TODO: implement initState super.initState(); SplashServer(context); } Widget build(BuildContext context) { final size = MediaQuery.sizeOf(context); return Container( decoration: BoxDecoration( image: DecorationImage( image: AssetImage("assets/images/img.png"), fit: BoxFit.fill, ), ), child: Scaffold( backgroundColor: Colors.transparent, body: Container( height: size.height 1, width: size.width 1, decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ Colors.black.withOpacity(0.2), Colors.black.withOpacity(0.2), ], ), ), ), ), ); } }

Abhinav771 commented 3 weeks ago

I would like to add splash screen. Please assign this issue to me.