feat: Implement rapid order creation with voice and text input in client mobile app
This commit is contained in:
@@ -102,8 +102,10 @@ class AppWidget extends StatelessWidget {
|
||||
>(
|
||||
builder:
|
||||
(BuildContext context, core_localization.LocaleState state) {
|
||||
return core_localization.TranslationProvider(
|
||||
child: MaterialApp.router(
|
||||
return KeyedSubtree(
|
||||
key: ValueKey<Locale>(state.locale),
|
||||
child: core_localization.TranslationProvider(
|
||||
child: MaterialApp.router(
|
||||
debugShowCheckedModeBanner: false,
|
||||
title: "KROW Client",
|
||||
theme: UiTheme.light,
|
||||
@@ -117,6 +119,7 @@ class AppWidget extends StatelessWidget {
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -79,8 +79,10 @@ class AppWidget extends StatelessWidget {
|
||||
>(
|
||||
builder:
|
||||
(BuildContext context, core_localization.LocaleState state) {
|
||||
return core_localization.TranslationProvider(
|
||||
child: MaterialApp.router(
|
||||
return KeyedSubtree(
|
||||
key: ValueKey<Locale>(state.locale),
|
||||
child: core_localization.TranslationProvider(
|
||||
child: MaterialApp.router(
|
||||
title: "KROW Staff",
|
||||
theme: UiTheme.light,
|
||||
routerConfig: Modular.routerConfig,
|
||||
@@ -93,6 +95,7 @@ class AppWidget extends StatelessWidget {
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -288,4 +288,7 @@ class UiIcons {
|
||||
|
||||
/// Microphone icon
|
||||
static const IconData microphone = _IconLib.mic;
|
||||
|
||||
/// Language icon
|
||||
static const IconData language = _IconLib.languages;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'package:core_localization/core_localization.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:krow_core/core.dart';
|
||||
import 'package:staff_profile_info/src/presentation/widgets/personal_info_page/field_label.dart';
|
||||
@@ -14,41 +16,49 @@ class LanguageSelector extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final String currentLocale = Localizations.localeOf(context).languageCode;
|
||||
final String languageName = currentLocale == 'es' ? 'Español' : 'English';
|
||||
return BlocBuilder<LocaleBloc, LocaleState>(
|
||||
bloc: Modular.get<LocaleBloc>(),
|
||||
buildWhen: (LocaleState previous, LocaleState current) =>
|
||||
previous.locale != current.locale,
|
||||
builder: (BuildContext context, LocaleState state) {
|
||||
final String currentLocale = state.locale.languageCode;
|
||||
final String languageName =
|
||||
currentLocale == 'es' ? 'Español' : 'English';
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: UiConstants.space3,
|
||||
children: <Widget>[
|
||||
const FieldLabel(text: 'Language'),
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: UiConstants.space3,
|
||||
children: <Widget>[
|
||||
const FieldLabel(text: 'Language'),
|
||||
|
||||
GestureDetector(
|
||||
onTap: enabled ? () => Modular.to.toLanguageSelection() : null,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
const Icon(
|
||||
UiIcons.settings,
|
||||
size: 18,
|
||||
color: UiColors.iconSecondary,
|
||||
GestureDetector(
|
||||
onTap: enabled ? () => Modular.to.toLanguageSelection() : null,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
const Icon(
|
||||
UiIcons.language,
|
||||
size: 18,
|
||||
color: UiColors.iconSecondary,
|
||||
),
|
||||
const SizedBox(width: UiConstants.space3),
|
||||
Expanded(
|
||||
child: Text(
|
||||
languageName,
|
||||
style: UiTypography.body2r.textPrimary,
|
||||
),
|
||||
),
|
||||
if (enabled)
|
||||
const Icon(
|
||||
UiIcons.chevronRight,
|
||||
size: 16,
|
||||
color: UiColors.iconSecondary,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(width: UiConstants.space3),
|
||||
Expanded(
|
||||
child: Text(
|
||||
languageName,
|
||||
style: UiTypography.body2r.textPrimary,
|
||||
),
|
||||
),
|
||||
if (enabled)
|
||||
const Icon(
|
||||
UiIcons.chevronRight,
|
||||
size: 16,
|
||||
color: UiColors.iconSecondary,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user