checkpoint prima del rename package
This commit is contained in:
@@ -15,12 +15,20 @@ class _SplashPageState extends State<SplashPage> {
|
||||
static const Color kRed = Color(0xFFB01E28);
|
||||
|
||||
Timer? _timer;
|
||||
int _seconds = 5; // countdown iniziale
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// dopo ~2.5s vai al login
|
||||
_timer = Timer(const Duration(milliseconds: 5000), _goToLogin);
|
||||
// countdown 5 → 0, poi vai al login
|
||||
_timer = Timer.periodic(const Duration(seconds: 1), (t) {
|
||||
if (!mounted) return;
|
||||
setState(() => _seconds--);
|
||||
if (_seconds <= 0) {
|
||||
t.cancel();
|
||||
_goToLogin();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -126,20 +134,39 @@ class _SplashPageState extends State<SplashPage> {
|
||||
),
|
||||
),
|
||||
|
||||
// ---- Indicatore caricamento in basso
|
||||
const Positioned(
|
||||
// ---- Logo YogiBook + countdown in basso
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 34,
|
||||
child: Center(
|
||||
child: SizedBox(
|
||||
width: 26,
|
||||
height: 26,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2.4,
|
||||
valueColor: AlwaysStoppedAnimation(Colors.white),
|
||||
bottom: 30,
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/yogibook_logo.png',
|
||||
height: 40,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
// Countdown numerico dentro un cerchio
|
||||
Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.white.withValues(alpha: 0.25),
|
||||
border: Border.all(color: Colors.white, width: 1.5),
|
||||
),
|
||||
child: Text(
|
||||
'$_seconds',
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w900,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user