Skip to content

BUG: Missing closing brace in main() breaks entire app build — 86 compile errors #220

@Muneerali199

Description

@Muneerali199

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 function

Evidence — 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 immediately

Expected 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions