velocity_bloc 1.2.1 copy "velocity_bloc: ^1.2.1" to clipboard
velocity_bloc: ^1.2.1 copied to clipboard

Minimalist and Easy State Management for Bloc Inspired from Dart Generics.

example/lib/main.dart

import 'package:device_preview/device_preview.dart';
import 'package:example/data/others_api.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:url_strategy/url_strategy.dart';
import 'repo/repository.dart';
import 'router/router_imports.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  setPathUrlStrategy();
  runApp(
    RepositoryProvider(
      create: (context) => Repository(
        othersApi: OthersApi(),
      ),
      child: MyApp(),
    ),
  );
}

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

  final _appRouter = AppRouter();

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return DevicePreview(
      enabled: false,
      builder: (context) => MaterialApp.router(
        title: 'Velocity Bloc',
        theme: ThemeData(
          colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
          fontFamily: GoogleFonts.poppins().fontFamily,
          useMaterial3: true,
        ),
        locale: DevicePreview.locale(context),
        builder: DevicePreview.appBuilder,
        debugShowCheckedModeBanner: false,
        routerConfig: _appRouter.config(),
      ),
    );
  }
}
copied to clipboard
21
likes
160
points
119
downloads
screenshot

Publisher

verified publishervelocitybloc.dev

Weekly Downloads

2024.09.19 - 2025.04.03

Minimalist and Easy State Management for Bloc Inspired from Dart Generics.

Homepage
Repository (GitHub)

Topics

#bloc #state-management #velocity-bloc

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

bloc, equatable, flutter, flutter_bloc

More

Packages that depend on velocity_bloc