completed velocity integration
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gif_view/gif_view.dart';
|
||||
import 'package:qpay/main.dart';
|
||||
|
||||
class SplashScreen extends StatefulWidget {
|
||||
final VoidCallback onSplashComplete;
|
||||
|
||||
const SplashScreen({super.key, required this.onSplashComplete});
|
||||
const SplashScreen({super.key});
|
||||
|
||||
@override
|
||||
State<SplashScreen> createState() => _SplashScreenState();
|
||||
@@ -57,14 +56,15 @@ class _SplashScreenState extends State<SplashScreen>
|
||||
// Start fade out animation
|
||||
await _fadeController.reverse();
|
||||
|
||||
// Call the completion callback
|
||||
// Mark splash complete so GoRouter redirect releases navigation
|
||||
// to the originally intended route (e.g. /poll/:id).
|
||||
if (mounted) {
|
||||
widget.onSplashComplete();
|
||||
splashState.finish();
|
||||
}
|
||||
} catch (e) {
|
||||
// If there's an error, still complete the splash screen
|
||||
if (mounted) {
|
||||
widget.onSplashComplete();
|
||||
splashState.finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,4 +108,4 @@ class _SplashScreenState extends State<SplashScreen>
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user