basf_flutter_components 2.12.1 copy "basf_flutter_components: ^2.12.1" to clipboard
basf_flutter_components: ^2.12.1 copied to clipboard

A collection of BASF Style components such as Buttons, Theming, etc...

example/lib/main.dart

import 'package:basf_flutter_components/basf_flutter_components.dart';
import 'package:basf_flutter_components_example/screens/overview.dart';
import 'package:flutter/foundation.dart' hide Factory;
import 'package:flutter/material.dart';

final RouteObserver<ModalRoute<void>> routeObserver = RouteObserver();

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await BasfRive.init(defaultFactory: kIsWeb ? Factory.rive : Factory.flutter);
  HydratedBloc.storage = await HydratedStorage.build(
    storageDirectory: kIsWeb
        ? HydratedStorageDirectory.web
        : HydratedStorageDirectory((await getTemporaryDirectory()).path),
  );

  runApp(const ExampleApp());
}

class ExampleApp extends StatefulWidget {
  const ExampleApp({super.key});

  @override
  State<ExampleApp> createState() => _ExampleAppState();
}

class _ExampleAppState extends State<ExampleApp> {
  BasfThemeType _theme = BasfThemeType.darkBlue;

  void _setTheme(BasfThemeType theme) {
    setState(() => _theme = theme);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'BASF Components',
      theme: BasfThemes.lightMainTheme(basfThemeType: _theme),
      home: OverviewScreen(currentTheme: _theme, onThemeChanged: _setTheme),
      navigatorObservers: [routeObserver],
      localizationsDelegates:
          BasfComponentsLocalizations.localizationsDelegates,
      supportedLocales: BasfComponentsLocalizations.supportedLocales,
    );
  }
}
12
likes
150
points
536
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A collection of BASF Style components such as Buttons, Theming, etc...

Repository (GitHub)
View/report issues
Contributing

License

BSD-3-Clause (license)

Dependencies

collection, flutter, flutter_bloc, flutter_localizations, hydrated_bloc, intl, mobile_scanner, path_provider, permission_handler, rive, transparent_image, url_launcher

More

Packages that depend on basf_flutter_components