style: change
This commit is contained in:
@@ -3,7 +3,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import '../../core/theme/app_theme.dart';
|
||||
import '../../core/widgets/game_ui.dart';
|
||||
import 'auth_cubit.dart';
|
||||
|
||||
/// صفحهی ورود شماره موبایل.
|
||||
@@ -28,7 +28,7 @@ class _MobileScreenState extends State<MobileScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: SafeArea(
|
||||
body: GameBackground(
|
||||
child: BlocConsumer<AuthCubit, AuthState>(
|
||||
listener: (context, state) {
|
||||
if (state.status == AuthStatus.otpSent) {
|
||||
@@ -41,47 +41,50 @@ class _MobileScreenState extends State<MobileScreen> {
|
||||
},
|
||||
builder: (context, state) {
|
||||
final loading = state.status == AuthStatus.loading;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text('سلطان حکم',
|
||||
style: TextStyle(
|
||||
fontSize: 36,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColors.gold)),
|
||||
const SizedBox(height: 8),
|
||||
const Text('برای ورود شماره موبایلت رو وارد کن',
|
||||
style: TextStyle(color: Colors.white70)),
|
||||
const SizedBox(height: 32),
|
||||
TextField(
|
||||
controller: _controller,
|
||||
keyboardType: TextInputType.phone,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 20, letterSpacing: 2),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
LengthLimitingTextInputFormatter(11),
|
||||
],
|
||||
decoration: const InputDecoration(hintText: '09xxxxxxxxx'),
|
||||
onChanged: (_) => setState(() {}),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
ElevatedButton(
|
||||
onPressed: (!_valid || loading)
|
||||
? null
|
||||
: () => context
|
||||
.read<AuthCubit>()
|
||||
.requestOtp(_controller.text.trim()),
|
||||
child: loading
|
||||
? const SizedBox(
|
||||
height: 22,
|
||||
width: 22,
|
||||
child: CircularProgressIndicator(strokeWidth: 2))
|
||||
: const Text('دریافت کد'),
|
||||
),
|
||||
],
|
||||
return Center(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const GlowText('سلطان حکم', size: 40),
|
||||
const SizedBox(height: 28),
|
||||
GamePanel(
|
||||
padding: const EdgeInsets.all(22),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
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),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
LengthLimitingTextInputFormatter(11),
|
||||
],
|
||||
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<AuthCubit>()
|
||||
.requestOtp(_controller.text.trim()),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user