Open blinddateapp1st opened 3 years ago
For the Checkbock Picker i'm using the same concept and there it works:
Future<List<T>?> showCheckboxPicker<T>(
BuildContext context,
List<T> items,
List<T> selected,
String transformString,
void Function(List<T>) onChange,
) {
return showMaterialCheckboxPicker(
context: context,
items: items,
selectedItems: selected,
onChanged: onChange,
transformer: (e) => "$transformString.values.${items.indexOf(e)}".tr(),
confirmText: LocaleKeys.standard_button_okay.tr(),
cancelText: LocaleKeys.standard_button_cancel.tr(),
title: "$transformString.title".tr(),
);
}
Can confirm this isn't working. I opened the pull request https://github.com/codegrue/flutter_material_pickers/pull/34 to fix it.
Please check if this is working since the PR was merged in.
flutter_material_pickers: ^3.1.0
I'm using a transform parameter in my
showMaterialScrollPicker
function. I expect to get a debug print message "transform" when building the picker dialog. but it looks like the transform function will not be called at all.As List items i transform an enum to an array by passing "EnumName.values" this will then generate a List.
For my translation i use something like:
Than i use an
enum Fruites { apple, banana, orange }
And than i try to get the translation according to the index in the enum.
Hint: I'm using easy_localization as translator plugin.