Nova tela de login | Adaptaçao nova da AppBar | Animções novas
This commit is contained in:
@@ -12,10 +12,19 @@ class HelloSplashScreen extends StatefulWidget {
|
||||
State<HelloSplashScreen> createState() => _HelloSplashScreenState();
|
||||
}
|
||||
|
||||
class _HelloSplashScreenState extends State<HelloSplashScreen> with SingleTickerProviderStateMixin {
|
||||
class _HelloSplashScreenState extends State<HelloSplashScreen> with TickerProviderStateMixin {
|
||||
late final AnimationController _controller;
|
||||
late final Animation<double> _opacity;
|
||||
|
||||
late final AnimationController _popController = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 700),
|
||||
);
|
||||
late final Animation<double> _pop = CurvedAnimation(
|
||||
parent: _popController,
|
||||
curve: Curves.elasticOut,
|
||||
);
|
||||
|
||||
Timer? _fadeTimer;
|
||||
Timer? _doneTimer;
|
||||
|
||||
@@ -34,6 +43,7 @@ class _HelloSplashScreenState extends State<HelloSplashScreen> with SingleTicker
|
||||
);
|
||||
|
||||
_controller.value = 1.0;
|
||||
_popController.forward();
|
||||
|
||||
final int fadeMs = (widget.duration.inMilliseconds - 500).clamp(0, widget.duration.inMilliseconds);
|
||||
_fadeTimer = Timer(Duration(milliseconds: fadeMs), () {
|
||||
@@ -52,6 +62,7 @@ class _HelloSplashScreenState extends State<HelloSplashScreen> with SingleTicker
|
||||
_fadeTimer?.cancel();
|
||||
_doneTimer?.cancel();
|
||||
_controller.dispose();
|
||||
_popController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -70,15 +81,18 @@ class _HelloSplashScreenState extends State<HelloSplashScreen> with SingleTicker
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: const [
|
||||
Text(
|
||||
'Olá',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 64,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: Colors.white,
|
||||
height: 1.0,
|
||||
children: [
|
||||
ScaleTransition(
|
||||
scale: _pop,
|
||||
child: const Text(
|
||||
'Olá',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 64,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: Colors.white,
|
||||
height: 1.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user