Skip to main content

flutter_robust_starter 1.1.0 copy "flutter_robust_starter: ^1.1.0" to clipboard
flutter_robust_starter: ^1.1.0 copied to clipboard

A robust, production-ready Flutter starter architecture with Dio, Clean Architecture, and essential core services.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_robust_starter/flutter_robust_starter.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  // 1. Setup the core architecture
  await setup(env: Environment.dev);

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    final themeService = sl<ThemeService>();

    return ListenableBuilder(
      listenable: themeService,
      builder: (context, _) {
        return MaterialApp(
          title: 'Flutter Robust Starter Example',
          theme: AppTheme.lightTheme,
          darkTheme: AppTheme.darkTheme,
          themeMode: themeService.themeMode,
          // Use the built-in navigator key from the service locator
          navigatorKey: sl<GlobalKey<NavigatorState>>(),
          onGenerateRoute: AppRouter.onGenerateRoute,
        );
      },
    );
  }
}

class ExampleHomeScreen extends StatelessWidget {
  const ExampleHomeScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return AppScaffold(
      appBar: AppBar(title: const Text('Example App')),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            const AppCard(
              child: Text('This is a card from the starter!'),
            ),
            const SizedBox(height: 20),
            AppButton(
              text: 'Toggle Theme',
              onPressed: () => sl<ThemeService>().toggleTheme(),
            ),
          ],
        ),
      ),
    );
  }
}
1
likes
140
points
24
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A robust, production-ready Flutter starter architecture with Dio, Clean Architecture, and essential core services.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

connectivity_plus, cupertino_icons, dio, flutter, get_it, shared_preferences

More

Packages that depend on flutter_robust_starter