Closed EgHubs closed 9 months ago
I use these two classes for localization in flutter following this article setup.
import 'package:flutter/cupertino.dart'; abstract class Languages { final String? extra; Languages({this.extra}); static Languages? of(BuildContext context, {String? extra}) { return Localizations.of<Languages>(context, Languages); } String get text199; }
and this LanguageEn:
import 'languages.dart'; class LanguageEn extends Languages { LanguageEn({String? extra}) : super(extra: extra); @override String get text199 => "Update data($extra)"; }
when I pass this extra parameter I get null "Update data(null)" in whatever language I'm in
"Update data(null)"
Languages.of(context,extra: "$activeID")!.text199),
but when I directly select a language class and do this it works and I get the number and not null "Update data(4)"
"Update data(4)"
LanguageEn(extra: "$activeID").text199),
how to pass dynamic strings with this package?
Hello. I think you have reported the issue to the wrong package. This package is flutter_localization, the package you are using is the Flutter SDK flutter_localizations.
I use these two classes for localization in flutter following this article setup.
and this LanguageEn:
when I pass this extra parameter I get null
"Update data(null)"
in whatever language I'm inLanguages.of(context,extra: "$activeID")!.text199),
but when I directly select a language class and do this it works and I get the number and not null
"Update data(4)"
LanguageEn(extra: "$activeID").text199),
how to pass dynamic strings with this package?