The NebuxTheme system provides a comprehensive design system for Flutter applications, integrating colors, typography, and spacing into a cohesive theme structure.Documentation Index
Fetch the complete documentation index at: https://synapsync.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
NebuxTheme extends Flutter’sThemeExtension to provide a complete Material 3 theme with custom design tokens. It includes:
- Colors: Comprehensive color palette with light and dark mode support
- Typography: Text styles for different UI elements
- Font sizes: Consistent font size scale
- Material components: Pre-configured themes for buttons, cards, inputs, and more
Basic setup
UseNebuxTheme.createThemeData() to create a complete ThemeData for your MaterialApp:
Light and dark themes
Set up both light and dark themes by providing separateThemeData configurations:
Accessing theme in widgets
Use the BuildContext extensions to access theme properties anywhere in your widget tree:The context extensions (
context.nebuxTheme, context.nebuxColors, context.nebuxTypography) provide convenient access to theme properties without verbose Theme.of(context).extension<NebuxTheme>() calls.Custom themes
Create custom themes using factory constructors:Custom colors only
From JSON configuration
From color themes
Theme properties
The font size scale for this theme. Includes sizes from 8px to 36px.
The typography styles for this theme. See Typography for details.
Material component themes
ThecreateThemeData() method automatically configures Material 3 components:
AppBar theme
- Background:
surfacecolor - Foreground:
textPrimarycolor - Elevation: 0 (1 when scrolled)
- Title style:
headingtypography
Card theme
- Background:
cardColor - Elevation: 2
- Border radius: 16px
- Margin: 8px
Button themes
ElevatedButton: Primary action color background with white text OutlinedButton: Border with primary action color TextButton: Primary action color text, no background FilledButton: Primary action color background with white textInput decoration theme
- Filled background with
surfacecolor - Border radius: 12px
- Focus border: 2px with
focuscolor - Error border:
errorcolor - Content padding: 16px horizontal, 12px vertical
Color scheme mapping
NebuxColors are mapped to Flutter’s ColorScheme:| ColorScheme | NebuxColors |
|---|---|
| primary | primary |
| onPrimary | white |
| secondary | secondary |
| onSecondary | white |
| surface | surface |
| onSurface | textPrimary |
| error | error |
| onError | white |
| background | background |
| outline | divider |
Theme interpolation
NebuxTheme supports smooth transitions between themes using thelerp method: