modula_ui 1.0.3
modula_ui: ^1.0.3 copied to clipboard
A comprehensive Flutter UI component library with 100+ professionally designed widgets and full Material 3 theming support.
Modula UI #
A comprehensive Flutter UI component library with 100+ professionally designed widgets and full Material 3 theming support. Build beautiful, consistent, and accessible Flutter applications with ease.
β¨ Features #
- π¨ 100+ Components - Complete collection of UI widgets across 7 categories
- π Material 3 Design - Full compliance with latest Material Design guidelines
- π Dark Mode - Beautiful light and dark themes with smooth transitions
- π Highly Customizable - Extensive customization options for every component
- π Type-Safe - Strong typing with comprehensive enum support
- β Production Ready - Battle-tested components with example implementations
- π Easy to Use - Simple API with sensible defaults
- π± Cross-Platform - Works seamlessly on iOS, Android, Web, and Desktop
π¦ Component Categories #
π Buttons (13 components) #
Primary, Secondary, Tertiary, Icon, Text, Outlined, FAB, Toggle, Dropdown, Share, Hamburger, Expandable, Loading Button
πΌοΈ Display (16 components) #
Card, Avatar, Badge, Chip, Tooltip, Banner, Divider, Progress Indicators, Skeleton, Accordion, Rating, Carousel, Timeline, DataTable, ListTile, Error State
π Inputs (17 components) #
TextField, SearchField, TextArea, Dropdown, Checkbox, Radio, Switch, Slider, RangeSlider, Stepper, DateTimePicker, ColorPicker, PinCode, ChipsInput, TagInput, SliderButton, Calendar
π Layout (7 components) #
Responsive, Grid, CardContainer, AppBar, Scaffold, ExpansionPanel, FlexHelpers
π§ Navigation (5 components) #
TabBar, BottomNavigationBar, Drawer, Breadcrumbs, Pagination
π¬ Feedback (9 components) #
Snackbar, Dialog, BottomSheet, Popover, ValidationMessage, Toast, PullToRefresh, InfiniteScroll, Menu
β¨ Animations (24 components) #
FadeIn/Out, SlideIn/Out, ScaleIn/Out, FlipIn, RotateIn/Out, BounceIn, ElasticIn, ExpandIn, ShrinkAway, AttentionSeeker, Staggered animations, and more
π Getting Started #
Installation #
Add modula_ui to your pubspec.yaml:
dependencies:
modula_ui: ^1.0.0
Then install it:
flutter pub get
Basic Usage #
import 'package:modula_ui/exporter/exporter.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return ModulaApp(
title: 'My Awesome App',
themeMode: ThemeMode.system, // Supports light, dark, and system
home: const HomePage(),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: ModulaAppBar(
title: const Text('Welcome to Modula UI'),
elevation: 2,
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ModulaPrimaryButton(
text: 'Click Me',
onPressed: () {
ModulaSnackbar.showSuccess(
context: context,
message: 'Button pressed!',
);
},
),
],
),
),
);
}
}
π¨ Theming #
Modula UI provides comprehensive theming with full Material 3 support.
Default Theme #
ModulaApp(
themeMode: ThemeMode.system, // Auto-switches based on system
home: YourHomeScreen(),
)
Custom Theme #
ModulaApp(
theme: ModulaThemeData(
brightness: Brightness.light,
colors: ModulaColorScheme.fromBrightness(Brightness.light),
),
darkTheme: ModulaThemeData(
brightness: Brightness.dark,
colors: ModulaColorScheme.fromBrightness(Brightness.dark),
),
themeMode: ThemeMode.system,
home: YourHomeScreen(),
)
Accessing Theme #
// Access current theme
final theme = ModulaTheme.of(context);
// Use theme colors
Container(
color: theme.colors.light.primary,
child: Text(
'Hello',
style: theme.typography?.defaultTextStyele.h4,
),
)
π Component Examples #
Buttons #
// Primary Button
ModulaPrimaryButton(
text: 'Submit',
onPressed: () {},
icon: Icons.check,
isLoading: false,
)
// FAB Button
ModulaFabButton(
icon: Icons.add,
onPressed: () {},
size: FabSize.regular,
)
// Toggle Button
ModulaToggleButton(
options: ['Option 1', 'Option 2', 'Option 3'],
selectedIndex: 0,
onToggle: (index) {},
)
Display Components #
// Avatar
ModulaAvatar(
imageUrl: 'https://example.com/avatar.jpg',
size: AvatarSize.large,
shape: AvatarShape.circle,
)
// Badge
ModulaBadge(
count: 5,
position: BadgePosition.topRight,
child: Icon(Icons.notifications),
)
// Chip
ModulaChip(
label: 'Flutter',
onDeleted: () {},
avatar: CircleAvatar(child: Text('F')),
)
// Card Container
ModulaCardContainer(
elevation: 4,
padding: EdgeInsets.all(16),
child: Column(
children: [
Text('Card Title'),
Text('Card content goes here'),
],
),
)
// Progress Indicator
ModulaCircularProgressIndicator(
value: 0.7, // 70%
showPercentage: true,
size: 100,
)
Input Components #
// Text Field
ModulaTextField(
label: 'Email',
hint: 'Enter your email',
validator: (value) => value?.isEmpty ?? true ? 'Required' : null,
prefixIcon: Icons.email,
)
// Dropdown
ModulaDropdown<String>(
value: selectedValue,
items: ['Option 1', 'Option 2', 'Option 3']
.map((e) => DropdownMenuItem(value: e, child: Text(e)))
.toList(),
onChanged: (value) => setState(() => selectedValue = value),
hint: 'Select an option',
)
// Checkbox
ModulaCheckbox(
value: isChecked,
onChanged: (value) => setState(() => isChecked = value ?? false),
label: 'Accept terms and conditions',
)
// Date Picker
ModulaDateTimePicker(
initialDate: DateTime.now(),
onDateSelected: (date) {},
mode: DateTimeMode.date,
)
// Calendar
ModulaCalendar(
selectedDates: selectedDates,
onDateSelected: (date) {
setState(() => selectedDates.add(date));
},
viewMode: ModulaCalendarViewMode.month,
)
DataTable #
ModulaDataTable(
columns: [
ModulaDataColumn(label: 'Name', sortable: true),
ModulaDataColumn(label: 'Age'),
ModulaDataColumn(label: 'Email'),
],
rows: [
ModulaDataRow(
cells: [
ModulaDataCell(child: Text('John Doe')),
ModulaDataCell(child: Text('25')),
ModulaDataCell(child: Text('john@example.com')),
],
onSelectChanged: (selected) {},
),
],
showCheckboxColumn: true,
sortable: true,
)
Feedback Components #
// Snackbar
ModulaSnackbar.showSuccess(
context: context,
message: 'Operation completed successfully!',
);
// Dialog
ModulaDialog.show(
context: context,
title: 'Confirm Action',
content: 'Are you sure you want to proceed?',
actions: [
ModulaDialogAction(
text: 'Cancel',
onPressed: () => Navigator.pop(context),
),
ModulaDialogAction(
text: 'Confirm',
onPressed: () {
// Handle confirmation
Navigator.pop(context);
},
isPrimary: true,
),
],
);
// Bottom Sheet
ModulaBottomSheet.show(
context: context,
builder: (context) => Container(
padding: EdgeInsets.all(16),
child: Column(
children: [
Text('Bottom Sheet Content'),
ModulaPrimaryButton(
text: 'Close',
onPressed: () => Navigator.pop(context),
),
],
),
),
);
Animations #
// Fade In Animation
ModulaFadeIn(
duration: Duration(milliseconds: 500),
child: YourWidget(),
)
// Slide In Animation
ModulaSlideIn(
direction: SlideDirection.fromBottom,
child: YourWidget(),
)
// Scale In Animation
ModulaScaleIn(
delay: Duration(milliseconds: 200),
child: YourWidget(),
)
// Staggered Animation
ModulaStaggeredFade(
children: [
Widget1(),
Widget2(),
Widget3(),
],
staggerDelay: Duration(milliseconds: 100),
)
Layout Components #
// Responsive Grid
ModulaGrid(
crossAxisCount: 3,
spacing: 16,
children: [
Card(child: Text('Item 1')),
Card(child: Text('Item 2')),
Card(child: Text('Item 3')),
],
)
// Expansion Panel
ModulaExpansionPanel(
panels: [
ExpansionPanelItem(
headerBuilder: (context, isExpanded) =>
Text('Panel Header'),
body: Text('Panel content goes here'),
isExpanded: false,
),
],
style: ModulaExpansionPanelStyle.bordered,
)
π― Example App #
Check out the comprehensive example app in the example/ folder to see all components in action:
cd example
flutter run
The example app includes:
- π± Interactive component showcase
- π Live theme switching (Light/Dark/System)
- β All 100+ components with working examples
- π Source code for each example
- π Search functionality to find components
- π Organized by category
π Documentation #
Core Concepts #
- ModulaApp - Main wrapper that provides theming and configuration
- ModulaTheme - Access theme data anywhere in your widget tree
- ModulaThemeData - Theme configuration (colors, typography, spacing)
- ModulaPalette - Color schemes for light and dark modes
Best Practices #
- Always wrap your app with
ModulaAppinstead ofMaterialApp - Use
ModulaTheme.of(context)to access theme values - Prefer Modula components over standard Flutter widgets for consistency
- Test your UI in both light and dark modes
- Use the example app as a reference for implementation
Migration from Standard Flutter #
// Before
MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('Title')),
body: ElevatedButton(
onPressed: () {},
child: Text('Button'),
),
),
)
// After
ModulaApp(
home: Scaffold(
appBar: ModulaAppBar(title: Text('Title')),
body: ModulaPrimaryButton(
text: 'Button',
onPressed: () {},
),
),
)
π§ Advanced Usage #
Custom Colors #
final customPalette = ModulaPalette(
primary: Color(0xFF6750A4),
onPrimary: Colors.white,
secondary: Color(0xFF625B71),
// ... define all required colors
);
ModulaApp(
theme: ModulaThemeData(
brightness: Brightness.light,
colors: ModulaColorScheme(
light: customPalette,
dark: ModulaPalette.dark(),
),
),
)
Runtime Theme Switching #
class MyApp extends StatefulWidget {
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
ThemeMode themeMode = ThemeMode.system;
void toggleTheme() {
setState(() {
themeMode = themeMode == ThemeMode.light
? ThemeMode.dark
: ThemeMode.light;
});
}
@override
Widget build(BuildContext context) {
return ModulaApp(
themeMode: themeMode,
home: HomePage(onThemeToggle: toggleTheme),
);
}
}
π€ Contributing #
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Contribution Guidelines #
- Follow the existing code style and conventions
- Test your changes in both light and dark modes
- Update documentation as needed
- Add examples for new components in the example app
- Ensure all tests pass
- Follow Material 3 design guidelines
- Maintain accessibility standards (WCAG 2.1)
π Bug Reports & Feature Requests #
- Bug Reports: GitHub Issues
- Feature Requests: GitHub Discussions
When reporting bugs, please include:
- Flutter version
- Modula UI version
- Platform (iOS/Android/Web/Desktop)
- Steps to reproduce
- Expected vs actual behavior
- Screenshots if applicable
π License #
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments #
- Built with β€οΈ using Flutter
- Inspired by Material Design 3
- Icons from Material Icons
- Special thanks to all contributors
π Stats #
- 100+ Production-ready components
- 7 Major categories
- Material 3 Fully compliant
- Dark Mode Native support
- Type-Safe 100% Dart null-safety
πΊοΈ Roadmap #
Version 1.1.0 #
- β Additional animation effects
- β Enhanced accessibility features (screen reader support)
- β Performance optimizations
- β Additional form validators
Version 1.2.0 #
- β Web-specific optimizations
- β Desktop platform enhancements
- β RTL (Right-to-Left) support
- β Additional chart components
Version 2.0.0 #
- β Headless components (logic-only widgets)
- β Advanced gesture recognition
- β Plugin architecture
- β Figma design token integration
π‘ Why Modula UI? #
vs Standard Flutter Widgets #
- β Consistent design language across all components
- β Built-in dark mode support
- β Less boilerplate code
- β Material 3 compliant out of the box
vs Other UI Libraries #
- β 100+ components vs 50-60 in most libraries
- β Comprehensive theming system
- β Extensive documentation and examples
- β Active maintenance and updates
- β Production-ready components
π Links #
- Pub.dev: pub.dev/packages/modula_ui
- GitHub: github.com/codecrafters42/modula_ui
- Documentation: GitHub Wiki
π Support & Community #
- π¬ Discussions: Ask questions and share ideas
- π Issues: Report bugs and request features
- π§ Email: support@modula-ui.dev
- π¦ Twitter: @modula_ui
Made with β€οΈ by the Modula UI Team
Empowering developers to build beautiful Flutter apps