Skip to content

πŸ“± Flutter Responsive UI & State Management | Riverpod + ScreenUtil | Multi-language (EN/KO/JA)

Notifications You must be signed in to change notification settings

kaywalker91/Flutter_Practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Flutter Practice - Responsive UI & State Management

A comprehensive Flutter practice project showcasing modern responsive UI patterns, multi-language support, and state management using Riverpod.

Flutter Dart Riverpod License

Features

🎨 Responsive Design

  • Adaptive Layouts: Automatically adjusts for phones, tablets, and desktops
  • Orientation Support: Seamless portrait/landscape transitions
  • Device Detection: Smart device type detection with custom breakpoints
  • Responsive Widgets: Custom grid layouts with auto-column calculation
  • Screen Scaling: flutter_screenutil for consistent UI across devices

🌍 Multi-Language Support

  • 3 Languages: English (default), Korean, Japanese
  • Hot Switching: Instant language change without app restart
  • Type-Safe: Code generation for compile-time safety
  • Persistent: Language preference saved locally

🎭 Theme Management

  • Light/Dark Mode: Full theme support with Material 3
  • System Following: Auto-detect system theme preference
  • Custom Colors: Carefully crafted color schemes for both themes
  • Persistent: Theme preference saved across sessions

⚑ State Management

  • Riverpod: Type-safe, compile-time state management
  • Auto Updates: Reactive UI updates on state changes
  • Clean Architecture: Separation of business logic and UI
  • Provider Pattern: Scalable and testable architecture

Project Structure

lib/
β”œβ”€β”€ main.dart                           # App entry point
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ constants/
β”‚   β”‚   β”œβ”€β”€ app_colors.dart            # Color palette (light/dark)
β”‚   β”‚   β”œβ”€β”€ app_sizes.dart             # Spacing & breakpoints
β”‚   β”‚   └── app_text_styles.dart       # Typography system
β”‚   β”œβ”€β”€ providers/
β”‚   β”‚   β”œβ”€β”€ locale_provider.dart       # Language state
β”‚   β”‚   └── theme_provider.dart        # Theme state
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ locale_service.dart        # Locale persistence
β”‚   β”‚   └── theme_service.dart         # Theme persistence
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   └── responsive_helper.dart     # Device detection utilities
β”‚   └── widgets/
β”‚       β”œβ”€β”€ responsive_layout.dart     # Adaptive layout widgets
β”‚       β”œβ”€β”€ responsive_grid.dart       # Responsive grids
β”‚       └── responsive_builder.dart    # Builder utilities
β”œβ”€β”€ presentation/
β”‚   β”œβ”€β”€ screens/
β”‚   β”‚   β”œβ”€β”€ home_page.dart             # Main screen
β”‚   β”‚   β”œβ”€β”€ settings_page.dart         # Language & theme settings
β”‚   β”‚   └── responsive_demo_page.dart  # Responsive showcase
β”‚   └── widgets/
β”‚       └── responsive_builder.dart    # Custom widgets
└── l10n/                              # Localization files
    β”œβ”€β”€ app_en.arb                     # English
    β”œβ”€β”€ app_ko.arb                     # Korean
    └── app_ja.arb                     # Japanese

Getting Started

Prerequisites

  • Flutter SDK: 3.3.4 or higher
  • Dart SDK: 3.3.4 or higher

Installation

  1. Clone the repository
git clone https://github.com/kaywalker91/Flutter_Practice.git
cd Flutter_Practice
  1. Install dependencies
flutter pub get
  1. Run the app
flutter run

Key Technologies

Package Version Purpose
flutter_riverpod ^2.5.1 State management
flutter_screenutil ^5.9.3 Responsive UI scaling
shared_preferences ^2.2.3 Local storage
flutter_localizations SDK Internationalization
intl ^0.18.1 Formatting & localization

Usage Examples

Responsive Sizing

// Responsive sizing with ScreenUtil
Container(
  width: 300.w,      // 300 design units
  height: 200.h,     // 200 design units
  padding: EdgeInsets.all(16.w),
  child: Text(
    'Responsive Text',
    style: TextStyle(fontSize: 16.sp),
  ),
)

Device-Specific Layouts

// Different layouts for different devices
ResponsiveLayout(
  mobile: MobileLayout(),
  tablet: TabletLayout(),
  desktop: DesktopLayout(),
)

State Management

// Watch and update state with Riverpod
class MyWidget extends ConsumerWidget {
  @override
  Widget build(BuildContext context, WidgetRef ref) {
    // Watch state (rebuilds on change)
    final locale = ref.watch(localeProvider);

    // Update state
    ref.read(localeProvider.notifier).setLocale(Locale('ko'));

    return Text('Language: ${locale.languageCode}');
  }
}

Localization

// Access localized strings
final l10n = AppLocalizations.of(context)!;
Text(l10n.appTitle)

Responsive Design System

Device Breakpoints

  • Phone: < 600dp (2 grid columns)
  • Tablet: 600-1023dp (3-4 grid columns)
  • Desktop: β‰₯ 1024dp (4-6 grid columns)

Design Baselines

  • Phone Portrait: 375Γ—812 (iPhone X)
  • Phone Landscape: 812Γ—375
  • Tablet Portrait: 768Γ—1024 (iPad mini)
  • Tablet Landscape: 1024Γ—768

Adaptive Features

  • Auto-switching design size based on device type
  • Orientation-aware layout changes
  • Dynamic grid column calculation
  • Responsive spacing and typography

Building

Android

# Debug APK
flutter build apk

# Release APK
flutter build apk --release

# App Bundle
flutter build appbundle --release

iOS

flutter build ios --release

Web

flutter build web

Testing

# Run all tests
flutter test

# Run with coverage
flutter test --coverage

# Analyze code
flutter analyze

# Format code
dart format .

Documentation

For detailed implementation guides, see:

  • RIVERPOD_IMPLEMENTATION.md - State management setup
  • RESPONSIVE_UI_IMPLEMENTATION.md - Responsive system details
  • QUICK_REFERENCE.md - Quick reference guide
  • CLAUDE.md - Claude Code integration guide

Learning Resources

This project demonstrates:

  • Clean Architecture principles
  • SOLID design patterns
  • Responsive UI best practices
  • Type-safe state management
  • Internationalization workflows
  • Theme customization
  • Local data persistence

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Contact

Created by @kaywalker91


Made with ❀️ using Flutter

About

πŸ“± Flutter Responsive UI & State Management | Riverpod + ScreenUtil | Multi-language (EN/KO/JA)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published