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:
|
builder:
|
||||||
(BuildContext context, core_localization.LocaleState state) {
|
(BuildContext context, core_localization.LocaleState state) {
|
||||||
return core_localization.TranslationProvider(
|
return KeyedSubtree(
|
||||||
child: MaterialApp.router(
|
key: ValueKey<Locale>(state.locale),
|
||||||
|
child: core_localization.TranslationProvider(
|
||||||
|
child: MaterialApp.router(
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
title: "KROW Client",
|
title: "KROW Client",
|
||||||
theme: UiTheme.light,
|
theme: UiTheme.light,
|
||||||
@@ -117,6 +119,7 @@ class AppWidget extends StatelessWidget {
|
|||||||
GlobalCupertinoLocalizations.delegate,
|
GlobalCupertinoLocalizations.delegate,
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -79,8 +79,10 @@ class AppWidget extends StatelessWidget {
|
|||||||
>(
|
>(
|
||||||
builder:
|
builder:
|
||||||
(BuildContext context, core_localization.LocaleState state) {
|
(BuildContext context, core_localization.LocaleState state) {
|
||||||
return core_localization.TranslationProvider(
|
return KeyedSubtree(
|
||||||
child: MaterialApp.router(
|
key: ValueKey<Locale>(state.locale),
|
||||||
|
child: core_localization.TranslationProvider(
|
||||||
|
child: MaterialApp.router(
|
||||||
title: "KROW Staff",
|
title: "KROW Staff",
|
||||||
theme: UiTheme.light,
|
theme: UiTheme.light,
|
||||||
routerConfig: Modular.routerConfig,
|
routerConfig: Modular.routerConfig,
|
||||||
@@ -93,6 +95,7 @@ class AppWidget extends StatelessWidget {
|
|||||||
GlobalCupertinoLocalizations.delegate,
|
GlobalCupertinoLocalizations.delegate,
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -288,4 +288,7 @@ class UiIcons {
|
|||||||
|
|
||||||
/// Microphone icon
|
/// Microphone icon
|
||||||
static const IconData microphone = _IconLib.mic;
|
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:design_system/design_system.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:flutter_modular/flutter_modular.dart';
|
import 'package:flutter_modular/flutter_modular.dart';
|
||||||
import 'package:krow_core/core.dart';
|
import 'package:krow_core/core.dart';
|
||||||
import 'package:staff_profile_info/src/presentation/widgets/personal_info_page/field_label.dart';
|
import 'package:staff_profile_info/src/presentation/widgets/personal_info_page/field_label.dart';
|
||||||
@@ -14,41 +16,49 @@ class LanguageSelector extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final String currentLocale = Localizations.localeOf(context).languageCode;
|
return BlocBuilder<LocaleBloc, LocaleState>(
|
||||||
final String languageName = currentLocale == 'es' ? 'Español' : 'English';
|
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(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
spacing: UiConstants.space3,
|
spacing: UiConstants.space3,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const FieldLabel(text: 'Language'),
|
const FieldLabel(text: 'Language'),
|
||||||
|
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: enabled ? () => Modular.to.toLanguageSelection() : null,
|
onTap: enabled ? () => Modular.to.toLanguageSelection() : null,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Icon(
|
const Icon(
|
||||||
UiIcons.settings,
|
UiIcons.language,
|
||||||
size: 18,
|
size: 18,
|
||||||
color: UiColors.iconSecondary,
|
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