dock_flutter 0.1.0-dev.2 copy "dock_flutter: ^0.1.0-dev.2" to clipboard
dock_flutter: ^0.1.0-dev.2 copied to clipboard

A software kit for developing Flutter apps easy and fast.

example/lib/main.dart

import 'package:dock_flutter/dock.dart';
import 'package:dock_flutter_example/core/navigation/app_router/app_router.dart';
import 'package:dock_flutter_example/core/navigation/navigation_observer/navigation_observer.dart';
import 'package:dock_flutter_example/product/constants/app_constants.dart';
import 'package:flutter/material.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    final appRouter = Locator.isRegistered<AppRouter>()
        ? Locator.find<AppRouter>()
        : Locator.register<AppRouter>(
            AppRouter(),
          );

    return MaterialApp.router(
      routerConfig: appRouter.config(
        navigatorObservers: () => [
          if (Locator.isRegistered<CustomNavigationObserver>())
            Locator.find<CustomNavigationObserver>()
          else
            Locator.register<CustomNavigationObserver>(
              CustomNavigationObserver(),
            ),
        ],
      ),
      theme: AppConstants.themeConstants.material3,
    );
  }
}
1
likes
0
points
29
downloads

Publisher

verified publisherkorayliman.com

Weekly Downloads

A software kit for developing Flutter apps easy and fast.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface

More

Packages that depend on dock_flutter