fix for resend, cooldown and a few small fixes

This commit is contained in:
Arseni
2026-02-13 01:03:47 +03:00
parent 44a22ce962
commit b5db65ef78
24 changed files with 550 additions and 227 deletions

View File

@@ -0,0 +1,48 @@
import 'package:flutter/material.dart';
class ResendLink extends StatelessWidget {
final String label;
final VoidCallback onPressed;
final bool isDisabled;
final bool isLoading;
const ResendLink({
super.key,
required this.label,
required this.onPressed,
this.isDisabled = false,
this.isLoading = false,
});
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final color = theme.colorScheme.primary;
final isButtonDisabled = isDisabled || isLoading;
return TextButton(
onPressed: isButtonDisabled ? null : onPressed,
style: TextButton.styleFrom(
padding: EdgeInsets.zero,
minimumSize: const Size(0, 0),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
alignment: Alignment.centerLeft,
foregroundColor: color,
textStyle: theme.textTheme.bodyMedium?.copyWith(
decoration: TextDecoration.underline,
),
),
child: isLoading
? SizedBox(
width: 16,
height: 16,
child: CircularProgressIndicator(
strokeWidth: 2,
color: color,
),
)
: Text(label),
);
}
}