Reputation: 1889
By using a multilingual approach build is failing with a not fully clear error "Invalid constant value". As for the last screen, AppBar is taking a proper title where as body content is failing. Any thoughts? Thanks in advance!
Upvotes: 0
Views: 50
Reputation: 1019
Since applocalizations provide values that could change over time within the app, it's not a constant value. So, remove the const
keyword before Center
widget. Your updated code would look like so
@override
Widget build(BuildContext context) {
return Center(
child: Text(AppLocalizations.of(context)!.title),
);
}
Upvotes: 2
Reputation: 709
You need to remove "const" keyword on your Center widget as your localized text is not a const value.
Upvotes: 2