fabrik_theme
The Fabrik Theme package provides a consistent design system with typography, spacing, colors, and theming configuration to help you maintain visual consistency across your Flutter apps.
Installation
Section titled “Installation”Add the package to your pubspec.yaml
:
dependencies: fabrik_theme: ^0.0.1
Then run:
flutter pub get
Import fabrik_theme
in your Dart files:
import 'package:fabrik_theme/fabrik_theme.dart';
Getting Started
Section titled “Getting Started”Apply the theme in MaterialApp
:
MaterialApp( themeMode: ThemeMode.system, theme: FabrikThemeBuilder.light(), darkTheme: FabrikThemeBuilder.dark(), home: HomePage(),);
Customize the FabrikTheme
:
final colors = FabrikColors.custom( lightPrimary: Colors.green, darkPrimary: Colors.greenAccent,);
return MaterialApp( themeMode: ThemeMode.system, theme: FabrikThemeBuilder.light(fontFamily: 'Roboto', colors: colors), darkTheme: FabrikThemeBuilder.dark(fontFamily: 'Roboto', colors: colors), home: const HomePage(),);
Access Theme in Widgets
Section titled “Access Theme in Widgets”You can access the theme anywhere in the widget tree:
final theme = FabrikTheme.of(context);
Text( 'Fabrik Typography.', theme.typography.bodyLarge.copyWith( color: theme.colors.primary, ),),
Use Tokens
Section titled “Use Tokens”Access token values anywhere in your app:
FabrikSpacing.x4FabrikRadius.r4