Skip to main content

brix_ui 1.2.2 copy "brix_ui: ^1.2.2" to clipboard
brix_ui: ^1.2.2 copied to clipboard

Flutter widgets that follow your theme: buttons, text fields, select and search, cards, sheets, dialogs, toasts and a loader, in light and dark. Part of the brix family.

example/lib/main.dart

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

import 'brands.dart';
import 'gallery_screen.dart';

/// Every brix_ui widget on one screen. Switch light / dark and three brands
/// live, the widgets never change, only the theme.
void main() => runApp(const BrixUiExampleApp());

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

  @override
  State<BrixUiExampleApp> createState() => _BrixUiExampleAppState();
}

class _BrixUiExampleAppState extends State<BrixUiExampleApp> {
  Brand _brand = Brand.standard;
  bool _dark = false;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'brix_ui',
      debugShowCheckedModeBanner: false,
      // Lets dialogs and toasts open without a BuildContext.
      navigatorKey: BrixUi.navigatorKey ??= GlobalKey<NavigatorState>(),
      theme: _brand.theme(Brightness.light).toThemeData(),
      darkTheme: _brand.theme(Brightness.dark).toThemeData(),
      themeMode: _dark ? ThemeMode.dark : ThemeMode.light,
      home: GalleryScreen(
        brand: _brand,
        dark: _dark,
        onBrand: (brand) => setState(() => _brand = brand),
        onDark: (dark) => setState(() => _dark = dark),
      ),
    );
  }
}
1
likes
150
points
1.32k
downloads
screenshot

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter widgets that follow your theme: buttons, text fields, select and search, cards, sheets, dialogs, toasts and a loader, in light and dark. Part of the brix family.

Repository (GitHub)
View/report issues

Topics

#ui #widget #theme #dark-mode

License

MIT (license)

Dependencies

brix, flutter

More

Packages that depend on brix_ui