My problem with delegating S, but I wrote in code, like example in Getting Started Localizely
Adding in code
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
S.delegate
],
supportedLocales: S.delegate.supportedLocales,
onGenerateTitle: (BuildContext context) => "Zholdau",
title: S.of(context).title,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: S.of(context).title),
);
}
}
intl_en.arb
{
"title" : "Helo"
}
Error exeption
======== Exception caught by widgets library =======================================================
The following assertion was thrown building MyApp(dirty):
No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?
'package:zholdau/generated/l10n.dart':
Failed assertion: line 44 pos 12: 'instance != null'
My problem with delegating S, but I wrote in code, like example in Getting Started Localizely
Adding in code
intl_en.arb
Error exeption
pubspec