feat: get cards from backend

This commit is contained in:
2026-06-24 08:35:31 +03:30
parent d837aca96e
commit 108a972761
83 changed files with 593 additions and 38 deletions
@@ -39,8 +39,9 @@ class _MobileScreenState extends State<MobileScreen> {
if (s is LoginSuccess) {
context.push('/otp');
} else if (s is LoginError) {
ScaffoldMessenger.of(context)
.showSnackBar(SnackBar(content: Text(s.message)));
ScaffoldMessenger.of(
context,
).showSnackBar(SnackBar(content: Text(s.message)));
}
},
builder: (context, state) {
@@ -58,33 +59,43 @@ class _MobileScreenState extends State<MobileScreen> {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Text('برای ورود شماره موبایلت رو وارد کن',
style: TextStyle(color: Colors.white70)),
const Text(
'برای ورود شماره موبایلت رو وارد کن',
style: TextStyle(color: Colors.white70),
),
const SizedBox(height: 20),
TextField(
controller: _controller,
keyboardType: TextInputType.phone,
textAlign: TextAlign.center,
style:
const TextStyle(fontSize: 20, letterSpacing: 2),
textDirection: TextDirection.ltr,
style: const TextStyle(
fontSize: 20,
letterSpacing: 2,
),
inputFormatters: [
FilteringTextInputFormatter.digitsOnly,
LengthLimitingTextInputFormatter(11),
],
decoration:
const InputDecoration(hintText: '09xxxxxxxxx'),
decoration: const InputDecoration(
hintText: '09xxxxxxxxx',
),
onChanged: (_) => setState(() {}),
),
const SizedBox(height: 20),
GameButton(
label: 'دریافت کد',
width: double.infinity,
colors: const [Color(0xFF3FA34D), Color(0xFF1B5E20)],
onTap: (!_valid || loading)
? null
: () => context
.read<AuthBloc>()
.add(LoginOtpEvent(_controller.text.trim())),
colors: const [
Color(0xFF3FA34D),
Color(0xFF1B5E20),
],
onTap:
(!_valid || loading)
? null
: () => context.read<AuthBloc>().add(
LoginOtpEvent(_controller.text.trim()),
),
),
],
),