-
-
Notifications
You must be signed in to change notification settings - Fork 84
Open
Description
Is there an existing issue for this?
- I have searched the existing issues
What happened?
The main() function in lib/main.dart is missing its closing brace } after the runApp(...) call. This causes Dart to treat all class definitions below it (MyApp, WidgetsBindingObserverWidget, AppRouteObserver) as statements inside main() — which is illegal in Dart. The result is 86 compile errors and the app cannot be built at all.
Root Cause
The runApp(...) block ends at line 31 but the } to close main() is missing:
// lib/main.dart lines 24–34
runApp(
WidgetsBindingObserverWidget(
child: ChangeNotifierProvider<ThemeController>.value(
value: themeController,
child: const MyApp(),
),
),
);
← MISSING } here to close main()
class MyApp extends StatelessWidget { // ❌ ERROR: class inside functionEvidence — flutter analyze output
flutter analyze lib/main.dart
error - The function 'WidgetsBindingObserverWidget' isn't defined - lib/main.dart:25:3
error - The name 'MyApp' isn't a class - lib/main.dart:28:20
error - 'class' can't be used as an identifier - lib/main.dart:34:1
error - Expected a statement - lib/main.dart:34:1
error - 'class' can't be used as an identifier - lib/main.dart:80:1
error - 'class' can't be used as an identifier - lib/main.dart:123:1
...
86 issues found.
Steps to Reproduce
git clone https://github.com/AOSSIE-Org/Ell-ena.git
cd Ell-ena
flutter analyze lib/main.dart
# → 86 errors
flutter run
# → Build fails immediatelyExpected Behavior
App builds and runs successfully.
Fix
Add the missing } closing brace after the runApp(...) call on line 31:
runApp(
WidgetsBindingObserverWidget(
child: ChangeNotifierProvider<ThemeController>.value(
value: themeController,
child: const MyApp(),
),
),
);
} // ← add this closing brace
class MyApp extends StatelessWidget {Introduced by
Commit e94f81f — "Update main.dart" (Feb 20, 2026) wrapped runApp with WidgetsBindingObserverWidget but missed closing main().
Record
- I agree to follow this project's Code of Conduct
- I want to work on this issue
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels