CLI Setup: If you create a new Neo project using the Neo CLI, NeoApp will be fully configured for you inside
main.dart
with proper initialization, theming, and routing setup.Placement Note: While currently categorized under utilities, NeoApp may be reorganized into a more appropriate category in future releases as we refine our documentation structure and terminology.
Example
Properties
Required
The title of the application. Used by the operating system to identify your app (e.g., in the task switcher) and as the browser tab title on web platforms.
The router configuration for navigation. Typically an
AutoRouter
configuration from the auto_route
package that defines your app’s routes and navigation structure.Theming
The initial theme mode to use when the app starts.
Custom light theme to use instead of the default Neo theme.
Custom dark theme to use instead of the default Neo theme.
Enums
NeoThemeMode
Controls how the app determines which theme to use.system
: Automatically switches between light and dark themes based on the device’s system setting. Responds to system-level theme changes in real-time.light
: Always uses the light theme regardless of system settings.dark
: Always uses the dark theme regardless of system settings.
Best Practices
- Riverpod Required: NeoApp requires
ProviderScope
as an ancestor widget for state management. Wrap your app withProviderScope
in yourmain()
function.
Integration Notes
- Initialization: NeoApp works with
NeoInitializer.initialize()
to properly set up the Neo framework before the app starts.