feat: Implement rapid order creation with voice and text input in client mobile app
This commit is contained in:
@@ -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