flutter_bootstrap5 1.1.1+1 copy "flutter_bootstrap5: ^1.1.1+1" to clipboard
flutter_bootstrap5: ^1.1.1+1 copied to clipboard

A Flutter implementation of many Bootstrap 5 functionalities.

example/lib/main.dart

import 'package:example/cubits/app_cubit.dart';
import 'package:example/cubits/app_state.dart';
import 'package:example/profil.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_bootstrap5/flutter_bootstrap5.dart';
import 'package:google_fonts/google_fonts.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  late final AppCubit appCubit;

  @override
  void initState() {
    appCubit = AppCubit();
    super.initState();
  }

  @override
  void dispose() {
    appCubit.close();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return BlocProvider<AppCubit>.value(
      value: appCubit,
      child: BlocBuilder<AppCubit, AppState>(
        bloc: appCubit,
        builder: (context, state) {
          return FlutterBootstrap5(
            fontSize: state.defaultFontSize,
            builder: (ctx) => MaterialApp(
              title: 'Flutter Bootstrap5 Demo',
              theme: BootstrapTheme.of(ctx).toTheme(
                theme: ThemeData(
                  scaffoldBackgroundColor: BootstrapTheme.of(ctx).colors.white,
                  appBarTheme: AppBarTheme(
                    backgroundColor: BootstrapTheme.of(ctx).colors.primary,
                    foregroundColor: BootstrapTheme.of(ctx).colors.white,
                    elevation: 0.0,
                  ),
                  fontFamily: GoogleFonts.roboto().fontFamily,
                ),
              ),
              home: const Profile(),
            ),
          );
        },
      ),
    );
  }
}
22
likes
130
pub points
85%
popularity

Publisher

verified publisherfelixjunghans.de

A Flutter implementation of many Bootstrap 5 functionalities.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

collection, flutter, intersperse

More

Packages that depend on flutter_bootstrap5