======== Exception caught by widgets library ======================================================= The following assertion was thrown building DiaryPage(dirty, dependencies: [MediaQuery, _InheritedProviderScope, _InheritedProviderScope], state: _DiaryPageState#14a65): No instance of S was loaded. Try to initialize the S delegate before accessing S.current. ‘package:itwi/generated/l10n.dart’: Failed assertion: line 21 pos 12: ‘_current != null’  

Solution

child: MaterialApp(
  localizationsDelegates: const [
    S.delegate,
    GlobalMaterialLocalizations.delegate,
    GlobalCupertinoLocalizations.delegate,
    GlobalWidgetsLocalizations.delegate,
  ],
Add " S.delegate," to the list.