forked from eatvio/eatvio_app
feat(order info): added order info screen
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:easy_debounce/easy_debounce.dart';
|
||||
import 'package:eatvio_app/core/const.dart';
|
||||
import 'package:eatvio_app/core/locator_service.dart';
|
||||
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
||||
@@ -22,7 +23,7 @@ import 'package:url_launcher/url_launcher.dart';
|
||||
import '../bloc/auth_state.dart';
|
||||
|
||||
class AuthScreen extends StatefulWidget {
|
||||
const AuthScreen();
|
||||
const AuthScreen({super.key});
|
||||
|
||||
@override
|
||||
State<AuthScreen> createState() => _AuthScreenState();
|
||||
@@ -36,7 +37,7 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
final authCubit = sl<AuthCubit>();
|
||||
late StreamSubscription<bool> keyboardSubscription;
|
||||
bool isFocused = false;
|
||||
|
||||
int tapsCount = 0;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -60,15 +61,27 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
toolbarHeight: isFocused ? 64 : MediaQuery.of(context).size.width - 64,
|
||||
title: SvgPicture.asset(
|
||||
ImageConstant.imgLogoEatvio,
|
||||
height: isFocused ? 64 : MediaQuery.of(context).size.width - 64,
|
||||
fit: BoxFit.contain,
|
||||
title: GestureDetector(
|
||||
onTap: () {
|
||||
tapsCount++;
|
||||
if (tapsCount == 6) {
|
||||
tapsCount = 0;
|
||||
// showModalBottomSheet(context: context, builder: (context) => );
|
||||
}
|
||||
EasyDebounce.debounce('change env', Durations.medium4, () {
|
||||
tapsCount = 0;
|
||||
});
|
||||
},
|
||||
child: SvgPicture.asset(
|
||||
ImageConstant.imgLogoEatvio,
|
||||
height: isFocused ? 64 : MediaQuery.of(context).size.width - 64,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -104,7 +117,7 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('Нет аккаунта? '),
|
||||
const Text('Нет аккаунта? '),
|
||||
GestureDetector(
|
||||
onTap: () => GoRouter.of(context).goNamed('webViewRegistrationScreen'),
|
||||
child: Text(
|
||||
@@ -118,18 +131,18 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
const Spacer(),
|
||||
Center(
|
||||
child: RichText(
|
||||
textAlign: TextAlign.center,
|
||||
text: TextSpan(
|
||||
text: 'Нажимая "Войти", Вы соглашаетесь \n',
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.black,
|
||||
),
|
||||
children: [
|
||||
TextSpan(text: 'c '),
|
||||
const TextSpan(text: 'c '),
|
||||
TextSpan(
|
||||
text: ' Публичной офертой',
|
||||
style: TextStyle(
|
||||
@@ -138,14 +151,14 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
decorationColor: appTheme.blueA400,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
recognizer: TapGestureRecognizer()..onTap = () async => await launchUrl(Uri.parse(baseUrl + '/oferta_bs.pdf')),
|
||||
recognizer: TapGestureRecognizer()..onTap = () async => await launchUrl(Uri.parse('$baseUrl/oferta_bs.pdf')),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Container(
|
||||
SizedBox(
|
||||
height: 48,
|
||||
width: MediaQuery.of(context).size.width - 32,
|
||||
child: FloatingActionButton.extended(
|
||||
@@ -165,12 +178,14 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
passwordController.text,
|
||||
);
|
||||
if (isAuthenticated) {
|
||||
context.read<ProfileAvatarCubit>().getMyProfile();
|
||||
context.read<ChatsCubit>().getChatRoomsWithLoading();
|
||||
if (context.mounted) {
|
||||
context.read<ProfileAvatarCubit>().getMyProfile();
|
||||
context.read<ChatsCubit>().getChatRoomsWithLoading();
|
||||
}
|
||||
}
|
||||
},
|
||||
label: state is AuthStateLoading
|
||||
? CupertinoActivityIndicator()
|
||||
? const CupertinoActivityIndicator()
|
||||
: Text(
|
||||
'Войти',
|
||||
style: theme.textTheme.titleSmall!.copyWith(color: Colors.white),
|
||||
|
||||
Reference in New Issue
Block a user