Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:agrocontabil/app/modules/home/home_page.dart';
- import 'package:agrocontabil/app/modules/splashscreen/components.dart';
- import 'package:flutter/material.dart';
- import 'package:flutter/services.dart';
- class SplashScreenPage extends StatefulWidget {
- @override
- _SplashScreenPageState createState() => _SplashScreenPageState();
- }
- class _SplashScreenPageState extends State<SplashScreenPage>
- with SingleTickerProviderStateMixin {
- AnimationController animationController;
- Animation animGreenContainer;
- @override
- void initState() {
- animationController = AnimationController(
- duration: Duration(seconds: 3),
- vsync: this,
- );
- animationController.forward();
- SystemChrome.setEnabledSystemUIOverlays([]);
- Future.delayed(Duration(seconds: 4)).then((value) =>
- Navigator.pushReplacement(
- context, MaterialPageRoute(builder: (context) => HomePage())));
- super.initState();
- }
- @override
- void didChangeDependencies() {
- animGreenContainer = Tween(
- begin: 350.0,
- end: -10.0,
- ).animate(animationController);
- super.didChangeDependencies();
- }
- @override
- void dispose() {
- animationController.dispose();
- super.dispose();
- }
- @override
- Widget build(BuildContext context) {
- return Container(
- color: Colors.white,
- child: Stack(
- children: <Widget>[
- Positioned(
- top: 45,
- left: 50,
- right: 50,
- child: Container(
- child: Image.asset('imagens/logo.png'),
- ),
- ),
- AnimatedBuilder(
- animation: animGreenContainer,
- child: ClipPath(
- clipper: Clipper(),
- child: Container(
- color: Colors.teal[300],
- height: MediaQuery.of(context).size.height/1.5,
- width: MediaQuery.of(context).size.width,
- ),
- ),
- builder: (BuildContext context, Widget child) {
- return Transform.translate(
- offset: Offset(0, animGreenContainer.value),
- child: child,
- );
- },
- ),
- ],
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement