优化:积分不足的时候跳转到充值中心

This commit is contained in:
ivan 2026-03-12 14:58:54 +08:00
parent 5f688352a8
commit 5cfb4c74af

View File

@ -66,6 +66,14 @@ class _GenerateVideoScreenState extends State<GenerateVideoScreen> {
Future<void> _onGenerateButtonTap() async {
if (_isGenerating) return;
final userCredits = UserState.credits.value ?? 0;
if (userCredits < _currentCredits) {
if (mounted) {
Navigator.of(context).pushNamed('/recharge');
}
return;
}
final source = await showModalBottomSheet<ImageSource>(
context: context,
builder: (context) => SafeArea(