So I am using the Flutter Intl script on Android Studio IDE, through which the code is generated. And this is a Web App project so I'm on the flutter beta.
My .arb file is some-what like this:
{
"@@locale": "en",
"footer_about_us": "About Us"
//..
//.
}
All seems to be working fine on main.dart; The title is set properly.
return MaterialApp(
onGenerateTitle: (BuildContext context) => S.of(context).appTitle,
localizationsDelegates: [
S.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: S.delegate.supportedLocales,
//no need to specify supported delegates manually, use the Flutter Int tool (or commands in VS) to add locales etc.
theme: data,
debugShowCheckedModeBanner: false,
home: HomePage(),
and even on HomePage() it's working but a StatelessWidget called BottomBar inside HomePage()->WebScrollbar()->SingleChildScrollView()-> BottomBar() keeps giving me the error: "A non-null String must be provided to a Text widget."
[Bottom Bar Code]
...
..
.
Column(
children: [
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
BottomBarColumn(
heading: S.current.footer_about_us , //ERROR HERE!
.
..
...
Since I thought that it could be that context isn't been passed properly (while using S.of(context)), but a search lead me to the fact that the Devs have implemented S.current which would hold the context properly on Build widget on Main and we don't need to pass it or anything, but even trying and utilizing that it's still giving the same error.
I just started this basic project, and it's forked from a simple web tutorial. Here's my repo so you can examine the code in more detail if you like:
https://github.com/dan13th/zido_flutter
Aucun commentaire:
Enregistrer un commentaire