Fittor는 반응형 사용자 인터페이스 및 상태 관리를 간소화하기 위해 설계된 Flutter 패키지입니다. 다양한 화면 크기와 방향에 자동으로 레이아웃을 적응시켜 장치 간 일관된 UI를 보장합니다. 내장된 반응형 유틸리티를 활용하여 반복 코드를 줄이고 다중 플랫폼 앱 개발을 간편하게 만듭니다. 복잡한 설정 없이 효율적이고 확장 가능한 솔루션을 원하는 개발자에게 이상적입니다. 이 패키지는 모바일, 웹, 데스크톱을 포함한 모든 주요 플랫폼을 지원하여 현대 앱 개발에 유연하게 대응할 수 있습니다.
사용 사례
다중 장치 앱을 위한 반응형 레이아웃 구축
Flutter 프로젝트에서 상태 관리 간소화
다양한 화면 크기에 맞는 적응형 UI 만들기
일관된 디자인으로 크로스플랫폼 애플리케이션 개발하기
방향에 따라 레이아웃 조정 자동화
수동 미디어 쿼리 처리 감소
주요 기능
화면 크기에 따른 자동 반응성
내장된 상태 관리 유틸리티
모든 플러터 플랫폼 지원
방향 인식 레이아웃 적응
최소한의 보일러플레이트 코드
pub add를 통한 간편한 통합
적합한 대상
다중 플랫폼을 대상으로 하는 Flutter 개발자
반응형 UI 디자인을 우선시하는 팀
적은 설정으로 적응형 레이아웃을 사용하는 프로젝트
경량 상태 관리가 필요한 개발자
기기 간에 일관된 UX가 필요한 앱
반응형 컴포넌트를 활용한 빠른 프로토타이핑
고려 사항
새로운 반응형 패턴을 배워야 할 수 있습니다
완전한 사용자 지정 솔루션에 비해 커스터마이제이션이 제한적
Flutter의 렌더링 파이프라인에 의존합니다
매우 복잡한 상태 흐름에 적합하지 않음
중간에서 대규모의 반응형 앱에 가장 적합
Flutter 위젯 트리에 대한 이해가 필요합니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
A comprehensive Flutter package for responsive UI design and network connectivity management.
A lightweight, intuitive state management solution for Flutter applications.
// Width SizedBox20.w // SizedBox with width 20// Height SizedBox16.h // SizedBox with height 16// Square SizedBox24.s // SizedBox with width and height both 24
Internet Connectivity
Fittor includes built-in internet connectivity monitoring without any external packages.
When ignoreOfflineState is set to true, the ConnectivityWrapper will not automatically show the no-internet screen when connectivity is lost. Instead, it will continue showing your child widget and notify you of connectivity changes through the onConnectivityChanged callback. This is useful when you want to handle connectivity UI yourself, such as showing snackbars or banners instead of full-screen notifications.
Using ConnectivityMixin
For more fine-grained control, use the ConnectivityMixin in your StatefulWidget:
// Convert and format with currency symbolString formattedAmount = await context.convertAndFormat(
from: 'INR',
to: 'USD',
amount: 100.0,
);
print('100 INR = $formattedAmount'); // Outputs: 100 INR = $1.17
Format with Custom Symbols
// Format a currency amount with proper symbolString formatted = context.formatCurrency(1234.56, 'USD');
print(formatted); // Outputs: $1,234.56
Live Exchange Rates
// Get the current exchange rate between two currenciesdouble rate = await context.getExchangeRate('INR', 'USD');
print('1 INR = $rate USD');
Advanced Usage
Direct Access to CurrencyConverter
final converter = CurrencyConverter();
// Manually get latest rates for a base currencyMap<String, dynamic> rates = await converter.getLatestRates('EUR');
// Check cache statusMap<String, dynamic> cacheInfo = converter.getCacheInfo();
print('Last updated: ${cacheInfo['lastUpdated']}');
FittorCurrency Utilities
final currencyUtils = FittorCurrency();
// Create a currency text widgetWidget priceText = currencyUtils.currencyText(
'\$1,234.56',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
);
State Management
Overview
Fittor is a pragmatic state management library designed to make Flutter development more efficient with minimal boilerplate. It offers a controller-based approach, more focused API.
Features
Controller-based state management: Create reactive UIs with minimal code
Dependency injection: Easily register and find controllers throughout your app
Reactive value wrappers: Optimized UI updates with fine-grained reactivity
Bindings system: Organize dependencies by route or feature
Extension methods: Access controllers directly from BuildContext
Auto-disposal: Controllers are automatically managed in the widget lifecycle
Getting Started
1. Initialize Fittor
Initialize Fittor at the root of your application: