搜尋套件、儲存庫與 APP 分類

套件詳情v1.2.7

flutter_helper_kit

flutter_helper_kit 幫助減少程式碼擴展和元件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
286
喜歡數
33
Pub 分數
160

安裝套件

flutter pub add flutter_helper_kit

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

flutter_helper_kit 是一個 Dart 扩展和 widget 增強套件,專為減少 Flutter 項目中的重複程式碼而設計。它提供常用資料類型的實用擴展以及可重複使用的 widgets,以簡化開發工作流程。透過提供簡潔、直覺的方法與元件,幫助開發者在多個平台撰寫更乾淨、更具維護性的程式碼。此套件支援 Android、iOS、Web、macOS、Windows 與 Linux,非常適合跨平台應用。其輕量級特性確保最小的效能影響,同時最大化生產力。

適用情境

  • 快速建立使用者介面元件
  • 減少重複程式碼
  • 跨平台開發
  • 簡化資料類型操作
  • 提升開發人員的生產力
  • 簡化狀態管理工具

主要特色

  • 預建的擴展方法
  • 可重複使用的 UI 小部件
  • 跨平台相容性
  • 最小性能開銷
  • 透過 pub 實現輕鬆整合
  • 乾淨、可讀的程式碼輸出

適合對象

  • Flutter 初學者尋求捷徑
  • 經驗豐富的開發人員優化工作流程
  • 致力於維持一致程式碼風格的團隊
  • 需要快速原型設計的專案
  • 針對多個平台的應用程式

使用建議

  • 可能會稍微增加套件大小
  • 某些區域的文件內容有限
  • 最佳搭配有條理的程式碼組織使用
  • 不適合高度專業化的使用案例
  • 需要了解 Dart 擴展

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

flutter_helper_kit

A production-ready Flutter utility kit — extensions, widgets, animations, responsive sizing, and utils in one package with zero external dependencies (Flutter SDK only).

Consolidates helpers previously spread across custom_helper folders (Paydrop, WhereToNow, etc.) into a single maintainable package.

pub package

Platforms: Android · iOS · Web · macOS · Windows · Linux


Installation

dependencies:
  flutter_helper_kit: ^1.0.6
flutter pub add flutter_helper_kit
import 'package:flutter_helper_kit/flutter_helper_kit.dart';
Modular imports (smaller compile surface)
import 'package:flutter_helper_kit/flutter_helper_kit_extensions.dart';
import 'package:flutter_helper_kit/flutter_helper_kit_widgets.dart';
import 'package:flutter_helper_kit/flutter_helper_kit_animation.dart';
import 'package:flutter_helper_kit/flutter_helper_kit_responsive.dart';
import 'package:flutter_helper_kit/flutter_helper_kit_utils.dart';

Package structure

Every feature maps to a lib/ path. Use this table to find the right file.

Module Source path Key APIs
Extensions lib/extensions/ String, Color, DateTime, List, Map, Widget, Context, Alignment, Type conversion
Widgets lib/widgets/ AppButton, SliderButton, ReadMore, FlutterTag, Sharp corners, Pagination, etc.
Animation lib/animation/ 75+ animateWidget*, list animations, AnimatedGestureDetector
App Responsive lib/app_responsive/ ScreenUtilInit, .w, .h, .sp, .r, RPadding, RSizedBox
Reactive lib/reactive/ RxDateTime, RxnDateTime (ValueNotifier-based)
Utils lib/utils/ timeAgoCalculated, RandomImage, SystemUiUtils, MapCustomInfoWindow
Formatters lib/text_field/ NoLeadingSpaceFormatter, NoSpaceFormatter
Custom Painter lib/custom_painter/ GoogleLogoWidget

Full single import via flutter_helper_kit.dart.


Example app

Runnable demos for every module — each screen shows source file + API names.

cd example
flutter run

See example/README.md for catalog structure and how to add new demos.


Quick start

Responsive sizing (app_responsive/)
ScreenUtilInit(
  designSize: const Size(360, 690),
  builder: (_, child) => MaterialApp(home: child),
  child: Builder(
    builder: (context) => Container(
      width: 200.w,
      height: 80.h,
      child: Text('Hello', style: TextStyle(fontSize: 16.sp)),
    ),
  ),
);
API File
.w, .h, .sp, .r, .sw, .sh app_responsive/size_extension.dart
ScreenUtilInit app_responsive/screenutil_init.dart
RPadding, RSizedBox app_responsive/r_padding.dart, r_sized_box.dart
Widget animations (animation/)
Text('Hello')
  .animateWidgetElasticEntry()
  .animateWidgetGlassReveal();

// List item stagger
ListTile(title: Text('Item'))
  .animateListEntry(index: 0);

// Tap feedback
AnimatedGestureDetector(
  effectPreset: TapEffect.bounce,
  onTap: () {},
  child: Icon(Icons.favorite),
);
API File
animateWidget* (75+ methods) animation/widget_animation_extensions.dart
animateList* animation/list_item_animations.dart
AnimatedGestureDetector animation/animated_gesture_detector.dart
animateSheetReveal animation/animations_bottom_sheet.dart
Extensions
'edit_item'.toSnakeCase();           // string_case.dart
'user@mail.com'.isValidateEmail();  // validation.dart
1.50.toStringAsSmartRounded();       // smart_round_to_string.dart
Colors.blue.withColorOpacity(0.5);   // color_extension.dart
DateTime.now().timeAgo();            // date_extension.dart
'42'.toInt();                        // type_conversion.dart (on Object?)
context.showSnackBar(title: Text('Hi')); // build_context_extension.dart
Widgets
// Slider with shimmer label
SliderButton(
  width: 300,
  label: Text('Slide to confirm'),
  action: () async => true,
);

// Password strength meter
PasswordStrengthIndicator(textController: controller);

// Enhanced read-more with regex annotations
ReadMoreTextEnhanced(longText, trimLines: 3, annotations: [...]);

// iOS-style sheets (pass BuildContext)
AppCupertinoActionSheet.showActionSheet(
  context: context,
  actions: [ActionSheetItem(value: 'a', label: 'Option A')],
);

// Animated digit counter
UniversalDigitCounter(value: 12345, type: DigitAnimationType.simple);

// Ticket shape clipper
TicketClipper(
  clipper: PointedEdgeClipper(),
  child: Container(color: Colors.orange),
);

// Infinite scroll list
ListViewPagination(
  itemCount: items.length,
  hasNext: hasMore,
  nextData: fetchMore,
  itemBuilder: (_, i) => ListTile(title: Text(items[i])),
);
Widget File
AppButton widgets/app_button.dart
SliderButton widgets/slider_button.dart
PasswordStrengthIndicator widgets/password_strength_indicator/
ReadMoreText / ReadMoreTextEnhanced widgets/read_more_text.dart, read_more_enhanced.dart
FlutterTag widgets/flutter_tag/
SharpBorderRadius, SharpClipRect widgets/sharp_corners/
ListViewPagination widgets/list_view_pagination.dart
CenterTextDivider, CustomBanner widgets/center_text_divider.dart, custom_banner.dart
AvatarGlow, OutlineGlow widgets/avatar_glow/
TicketClipper widgets/ticket_clippers/
UniversalDigitCounter widgets/rolling_digit/
Reactive datetime (reactive/)
final rx = RxDateTime.now();
rx.addDuration(const Duration(hours: 1));
print(rx.format('yyyy-MM-dd'));
print(rx.timeAgo());

No GetX required — built on ValueNotifier<DateTime>.

Utils
timeAgoCalculated(DateTime.now().subtract(Duration(minutes: 5)));
RandomImage.picsumImage(300, 200);
RandomPicsumImage.image(width: 400, height: 300);
SystemUiUtils.setStatusBarColor(Colors.deepPurple);
Util File
timeAgoCalculated utils/ago_time.dart
RandomImage utils/random_image.dart
RandomPicsumImage utils/random_picsum_image.dart
SystemUiUtils utils/system_ui_utils.dart
MapCustomInfoWindow utils/map_custom_info_window.dart
showDialogWithCloseIcon utils/close_icon_show_dialog.dart
Validator utils/password_validator.dart
Numeral utils/numberal_utils.dart
Map info window (callback adapter)

No google_maps_flutter dependency in this package. Use CallbackMapInfoWindowAdapter:

final adapter = CallbackMapInfoWindowAdapter(
  onGetScreenCoordinate: (latLng) async {
    final coord = await googleMapController.getScreenCoordinate(
      LatLng(latLng.latitude, latLng.longitude),
    );
    return MapScreenCoordinate(coord.x, coord.y);
  },
);
controller.mapAdapter = adapter;
Text field formatters
TextField(
  inputFormatters: [
    NoLeadingSpaceFormatter(),
    NoSpaceFormatter(),
  ],
);

Extensions reference

String — extensions/string/
  • string_extension.dart — isEmptyOrNull, capitalize, reversed, parsing helpers
  • string_case.dart — toSnakeCase, toCamelCase, toPascalCase, toKebabCase, toTitleCase
  • validation.dart — isValidateEmail, validatePhone, extractPhoneNumber, URL/password checks
Color — extensions/color/color_extension.dart
  • toHex, createMaterialColor, lighten, darken, withColorOpacity, isDark, isLight
DateTime — extensions/date/
  • date_extension.dart — timeAgo, isToday, isYesterday, timezone helpers
  • date_format.dart — format(pattern:), formatTime()
List / Map / Set / Iterable — extensions/list/, map/, set/
  • firstOrNull, lastWhereOrNull, separatorEvery, getOrDefault, validate
Number — extensions/number/
  • integer_extension.dart, double_extension.dart, number_extension.dart
  • smart_round_to_string.dart — toStringAsSmartRounded()
  • height(), width(), circularBorderRadius spacing helpers
Widget / Context — extensions/widget/, context/
  • paddingAll, withSize, visible, expanded, centered
  • width, height, showSnackBar, theme, platform checks
Other
  • alignment/alignment_extensions.dart — isTop, isBottom, isLeft, isRight
  • type_conversion.dart — toInt, toDouble, toBool, toStr on Object?
  • bool/bool_extensions.dart — validate, toggle, toInt
  • duration/duration_extensions.dart — .delay
  • function/scope_functions_extension.dart — let, also, run, takeIf
  • random/random_extension.dart — random helpers on math.Random

Widgets reference

UI & feedback
Widget File Description
FlutterToast flutter_toast.dart Toast messages
CustomIndicator custom_indicator.dart Loading overlay
UnFocusable hide_keyboard.dart Dismiss keyboard on outside tap
DoublePressBackWidget double_press_back_widget.dart Press back twice to exit
TapSafeGesture tap_safe_gesture.dart Debounced async tap
TextShimmer, ProfileShimmer, … simmer.dart Shimmer placeholders
Layout & display
Widget File
Space, SliverSpace space/space.dart, sliver_space.dart
SeparatedColumn separated_column.dart
FlutterListView flutter_list_view.dart
DashDivider dash_divider.dart
DottedBorderWidget dotted_border_widget.dart
GradientText gradient_text.dart
Marquee marquee_widget.dart
TextAvatar, TextIcon text_avatar.dart, text_icon_widget.dart
WidgetHelper widget_helper.dart
Forms & input
Widget File
RoundedCheckBox rounded_checkbox_widget.dart
RatingBarWidget rating_bar_widget.dart
TimerBuilder timer_builder.dart

Typedefs

Callback types in utils/type_def.dart:

FutureVoidCallback, StringCallback, IntArgVoidCallback, DoubleCallback, and more.


Migration from custom_helper

Before After
import '.../custom_helper.dart' import 'package:flutter_helper_kit/flutter_helper_kit.dart'
Get.context in Cupertino dialogs Pass context: parameter
Rx<DateTime> (GetX) RxDateTime / RxnDateTime
Google Maps LatLng in info window MapLatLng + MapInfoWindowAdapter

Screenshots

Flutter Toast
Flutter Toast
Tap Safe Gesture
Tap Safe Gesture
Avatar Glow
Avatar Glow
Outline Avatar Glow
Outline Avatar Glow
Avatar Glow MultiColor
Avatar Glow MultiColor
Outline Avatar Glow MultiColor
Outline Avatar Glow MultiColor
App Button
App Button
Marquee
Marquee
RatingBar
RatingBar
Read More Text
Read More Text
Rounded Check Box
Rounded Check Box
Text Icon
Text Icon
showDialogWithCloseIcon
showDialogWithCloseIcon
Sharp Borders
Sharp Borders
Flutter Tag
Flutter Tag

Contributing

  • Issues & features: GitHub Issues
  • New widget/API: add under lib/, export in flutter_helper_kit.dart, register demo in example/lib/catalog/example_catalog.dart
  • Contact: sachin4kmt@gmail.com

If this package helps your project, consider giving it a star on GitHub.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。