A comprehensive Flutter application demonstrating various widgets and architectural patterns including Riverpod state management, API integration, and Material Design components. Built with Dart.
- State Management: Riverpod for clean and scalable state management
- API Integration: Dio HTTP client for REST API communication
- Authentication Flow: Login screen with form validation
- Widget Demonstrations: Comprehensive examples of Flutter widgets organized by category
- Clean Architecture: Separation of concerns with repository pattern
- Responsive UI: Material Design components with custom theming
lib/
├── main.dart # Entry point with Riverpod setup
├── app_theme.dart # Custom theme and styling
├── providers.dart # Riverpod providers configuration
├── data/
│ └── api/
│ └── api_service.dart # API service layer
├── repository/
│ ├── post_repository.dart
│ └── post_repository_impl.dart
├── models/
│ └── post_model.dart # Data model for API responses
├── ui/
│ ├── login/
│ │ ├── login_screen.dart
│ │ └── login_notifier.dart
│ ├── home/
│ │ ├── home_screen.dart
│ │ └── home_notifier.dart
│ └── postview/
│ ├── post_screen.dart
│ └── post_notifier.dart
└── widgets/
├── layout_widgets_screen.dart
├── button_input_widgets_screen.dart
├── info_widgets_screen.dart
├── material_widgets_screen.dart
└── async_widgets_screen.dart
-
Layout Widgets
- Container, Row, Column, Stack, Wrap
- Alignment, Padding, and positioning techniques
-
Buttons & Inputs
- ElevatedButton, TextButton, IconButton
- TextFields with validation and custom styling
-
Information Display
- Cards, Badges, Chips
- Progress indicators and lists
-
Material Components
- Dialogs, Bottom sheets, SnackBars
- Expansion tiles and list tiles
-
Async & Network Widgets
- FutureBuilder and StreamBuilder
- API integration with loading states
This project follows a clean MVVM architecture pattern:
- UI Layer: Flutter widgets with Riverpod for state management
- Repository Layer: Abstracts data sources
- Data Layer: API service implementation with Dio
- Dependency Injection: Riverpod providers for service locator pattern
The app integrates with JSONPlaceholder to demonstrate:
- REST API calls using Dio
- Error handling and loading states
- Data modeling and serialization
Custom theme implementation with:
- Google Fonts (Poppins)
- Consistent color palette
- Centralized component styling
- Flutter and Dart SDK (Latest recommended)
- VS Code recommended (or any code editor/IDE of your choice)
- Android Studio Virtual Device Manager for running it on Android virtual machine (optional)
- Clone the repository
git clone https://github.com/atshayk/Flutter-Widget-Cookbook.git- Run
flutter pub get - Run
flutter pub run build_runner build(if using code generation) - Start the application with
flutter run
Note: This app works on Windows, macOS, Linux, iOS and Android.
- Login Screen: Authentication simulation with form validation
- Home Screen: Dashboard with navigation to widget categories
- Widget Screens: Dedicated screens for each widget category
- Post Screen: Live API data display
flutter_riverpod: State managementdio: HTTP clientgoogle_fonts: Custom font integration
Developed by @atshayk