chaoperty_floating_loader
Global transparent overlay loader for Flutter — works from anywhere via a global navigatorKey
.
Supports once, ping‑pong, and loop‑wrap motions, with optional dim background, card, and blocking touch (dismissible).
ไทยอยู่ด้านล่าง ⬇️
✨ Features
- Global overlay loader (no
BuildContext
needed) - Motions: once, ping‑pong, loop‑wrap
- Start/end positions, ranges, edge bounce
- Optional dim backdrop and card
- Block or allow touch events with dismissible
- Bundle‑friendly GIF (or your own assets)
- Horizontal, vertical, and diagonal patterns (via
v*
params) - Custom TextStyle, maxLines, textAlign for message
📦 Installation
dependencies:
chaoperty_floating_loader: ^0.1.9
⚙️ Setup (required)
MaterialApp(
navigatorKey: ChaoAppLoader.navigatorKey, // ✅ required
home: const MyHome(),
);
🚀 Quick Usage
ChaoAppLoader.show(
message: 'กำลังโหลด...',
messageMaxLines: 2,
messageAlign: TextAlign.center,
messageStyle: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.deepPurple,
),
slideAcross: false,
vSlideAcross: false,
dimBackground: true,
useCard: true,
dismissible: false, // block all touches
);
Hide anytime:
ChaoAppLoader.hide();
⚙️ API (updated)
Param | Type | Default | Description |
---|---|---|---|
message |
String |
'กำลังโหลด...' |
Text under GIF |
messageMaxLines |
int? |
null |
Max lines for message |
messageAlign |
TextAlign |
TextAlign.center |
Message text align |
messageStyle |
TextStyle? |
null |
Custom style override |
dismissible |
bool |
false |
Block touches if false; tap to dismiss if true |
dimBackground |
bool |
false |
Dim backdrop |
useCard |
bool |
false |
White card behind GIF |
… other params … | Motion configs as before |
🇹🇭 ภาษาไทย (Thai)
ตอนนี้ chaoperty_floating_loader รองรับ:
dismissible: false
→ ห้ามกด (บล็อกจอทั้งหมด)dismissible: true
→ แตะพื้นหลังเพื่อปิดได้- ปรับแต่ง
TextStyle
,maxLines
,textAlign
ของข้อความใต้ GIF ได้
📄 License
MIT © Chaoperty