Skip to main content

mono-kit-widgets

Use when utilizing mono_kit UI widgets, lifecycle observers, dialog helpers, or layout utilities in Flutter apps.

설치로 이동

소스 정보

저장소
mono0926/flutter_mono_kit
최근 소스 활동
2026년 9월 9일 03:07
감지된 SKILL.md 언어
영어
스타
66
포크
4

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
mono_kit-widgets
description
Use when utilizing mono_kit UI widgets, lifecycle observers, dialog helpers, or layout utilities in Flutter apps.
# mono_kit Flutter Utilities & Widgets Guide `mono_kit` is an opinionated collection of practical Flutter UI widgets, lifecycle listeners, and extension utilities created to streamline daily Flutter development. ## Guidelines - **BetterPlaceholder**: - Use `BetterPlaceholder` instead of Flutter's default `Placeholder` when wireframing or creating mock UI sections, providing customizable color schemes, labels, and borders. - **UnfocusOnTap**: - Wrap page roots or scroll views with `UnfocusOnTap` to dismiss the soft keyboard automatically whenever the user taps outside text fields. - **LifecycleObserver**: - Use `LifecycleObserver` to observe `AppLifecycleState` transitions (resumed, paused, detached) with clean callback functions rather than manually implementing `WidgetsBindingObserver`. - **Extension Helpers**: - Utilize context extensions (e.g. `context.theme`, `context.mediaQuery`, `context.colorScheme`) and collection/string extensions provided by `mono_kit`. ## Examples ### 1. Dismissing Keyboard with `UnfocusOnTap` ```dart import 'package:flutter/material.dart'; import 'package:mono_kit/mono_kit.dart'; class FormScreen extends StatelessWidget { const FormScreen({super.key}); @override Widget build(BuildContext context) { return UnfocusOnTap( child: Scaffold( appBar: AppBar(title: const Text('Input Form')), body: ListView( padding: const EdgeInsets.all(16), children: const [ TextField(decoration: InputDecoration(labelText: 'Name')), SizedBox(height: 16), TextField(decoration: InputDecoration(labelText: 'Email')), ], ), ), ); } } ``` ### 2. App Lifecycle Observation ```dart import 'package:flutter/material.dart'; import 'package:mono_kit/mono_kit.dart'; class TrackedScreen extends StatefulWidget { const TrackedScreen({super.key}); @override State<TrackedScreen> createState() => _TrackedScreenState(); } class _TrackedScreenState extends State<TrackedScreen> { late final LifecycleObserver _lifecycleObserver; @override void initState() { super.initState(); _lifecycleObserver = LifecycleObserver( onResume: () => debugPrint('App resumed: refreshing real-time feeds'), onPause: () => debugPrint('App paused: pausing background timers'), ); } @override void dispose() { _lifecycleObserver.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return const Scaffold( body: Center(child: Text('Lifecycle Monitored')), ); } } ``` ## Common Pitfalls & Anti-Patterns - ❌ **Anti-pattern**: Forgetting to call `_lifecycleObserver.dispose()`, leaking global `WidgetsBindingObserver` callbacks. - ✔️ **Correct**: Always dispose `LifecycleObserver` within `State.dispose()`.
GitHub에서 보기