पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv1.1.1

awesome_shake_widget

एक फ्लटर विजेट जो हिलाने के एनीमेशन और वैकल्पिक कंपन प्रभाव प्रदान करता है, अवैध फॉर्म, ध्यान आह्वान और उपयोगकर्ता इंटरैक्शन प्रतिक्रिया के लिए बहुत अच्छा है।

AndroidiOS
30-दिन डाउनलोड
1.1 हज़ार
लाइक
21
Pub अंक
160

पैकेज इंस्टॉल करें

flutter pub add awesome_shake_widget

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

एक फ्लटर विजेट जो UI तत्वों में काँपने वाली एनीमेशन और वैकल्पिक कंपन प्रतिक्रिया जोड़ता है। अमान्य फॉर्म इनपुट को ध्यान देने, उपयोगकर्ता के कार्य को प्रेरित करने या बातचीत प्रतिक्रिया प्रदान करने के लिए आदर्श है। विजेट को आसानी से एकीकृत किया जा सकता है और दोनों एंड्रॉइड और आईओएस प्लेटफॉर्म के लिए समर्थन करता है। न्यूनतम सेटअप के साथ दृश्य और हैप्टिक प्रतिक्रिया प्रदान करके उपयोगकर्ता अनुभव को बढ़ाता है। सामान्य इंटरैक्शन परिदृश्यों में सरलता और प्रभावशीलता के लिए डिज़ाइन किया गया है।

उपयोग

  • फॉर्म वैधता चेतावनी
  • उपयोगकर्ता इनपुट प्रॉम्प्ट्स
  • इंटरैक्टिव बटन प्रतिक्रिया
  • त्रुटि अवस्था सूचनाएँ
  • ऑनबोर्डिंग गाइडेंस

मुख्य विशेषताएँ

  • हिलाने वाला एनीमेशन प्रभाव
  • वैकल्पिक कंपन समर्थन
  • क्रॉस-प्लेटफॉर्म संगतता
  • सरल API एकीकरण
  • कस्टमाइज़ किए गए एनीमेशन अवधि
  • प्रतिक्रियाशील डिज़ाइन समर्थन

इनके लिए उपयुक्त

  • इंटरैक्टिव फॉर्म बनाने वाले डेवलपर्स
  • UX ࡆ ଡିजାଇନର୍ସ ପ୍ରତିକ୍ରିୟା ତନ୍ତ୍ରମାନଙ୍କୁ ଉନ୍ନତ କରୁଛନ୍ତି
  • ध्यान आकर्षित करने वाले संकेतों की आवश्यकता वाले ऐप्स
  • Android और iOS के लिए मोबाइल एप्लिकेशन
  • सुगम उपयोगकर्ता इंटरैक्शन पर केंद्रित परियोजनाएँ

विचार योग्य बातें

  • अत्यधिक उपयोग से विचलित होने की संभावना है
  • कुछ डिवाइस पर कंपन के लिए अनुमति की आवश्यकता होती है
  • एनिमेशन प्रदर्शन डिवाइस क्षमता पर निर्भर करता है
  • एक्सेसिबिलिटी-महत्वपूर्ण घटकों के लिए उपयुक्त नहीं
  • उपयोग को सीमित रखें ताकि UX स्पष्टता बनी रहे

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

🚀 awesome_shake_widget

A customizable Flutter widget that adds shake animations with haptic and vibration feedback. Perfect for invalid forms, error indicators, or drawing attention to UI components.

Pub Version Platform License


✨ Features

  • Shake any widget on demand
  • Built-in presets: light, medium, heavy
  • Optional vibration (custom or haptic)
  • Fully customizable offset, pattern & intensities
  • Easy to trigger using a GlobalKey

📦 Installation

dependencies:
  awesome_shake_widget: ^1.0.1

Run:

flutter pub get

🧪 Usage

1️⃣ Standard (Shake + Vibration)

By using the built-in presets — light, medium, heavy and custom — you can quickly apply different vibration intensities and patterns, perfectly paired with UI shake animations for a dynamic and responsive user experience.

final shakeKey = GlobalKey<ShakeWidgetState>();

ShakeWidget(
  key: shakeKey,
  preset: ShakePreset.medium,
  child: Text("Tap Me"),
);

// Somewhere else, e.g., on button press:
shakeKey.currentState?.shake();

2️⃣ Shake Only (No Vibration)

If you only want the visual shake effect without vibration, you can set vibrationType to VibrationType.none using the ShakeConfig. To customize the intensity of the shake, adjust the offset value — higher values will produce a stronger visual effect.

ShakeWidget(
  key: shakeKey,
  customConfig: ShakeConfig(
    offset: 20,
    vibrationType: VibrationType.none,
  ),
  child: Icon(Icons.info),
);

3️⃣ Advanced Configuration: Full Control Over Visual and Vibration Effects

You can also create custom vibration patterns by setting vibrationType to VibrationType.custom, and providing your own pattern and intensities. This gives you full control over the vibration behavior.

ShakeWidget(
key: shakeKey,
customConfig: ShakeConfig(
offset: 32,
pattern: [0, 50, 100, 50],
intensities: [255, 0, 255, 0],
vibrationType: VibrationType.custom,
),
child: Text("Custom Shake!"),
);

Trigger it via:

shakeKey.currentState?.shake();

🎥 Demo

This demo shows how you can apply shake animations to:

  • ✅ Buttons
  • 💬 Dialogs
  • 🖼️ Images
  • ✏️ Text fields
  • 📦 Any widget

🧩 API Reference

Enum: ShakePreset
Value Offset Vibration
light 8 Haptic
medium 16 Haptic
heavy 24 Patterned Vibe
custom User-defined Custom

Enum: VibrationType
  • none – no vibration
  • haptic – system haptic feedback
  • custom – vibration with pattern/intensity (Android only)

ShakeConfig
ShakeConfig({
  required double offset,
  List<int>? pattern,
  List<int>? intensities,
  VibrationType vibrationType = VibrationType.haptic,
});

💡 Example App

Clone and run the example:

cd example
flutter run

Example main.dart:

import 'package:flutter/material.dart';
import 'package:awesome_shake_widget/shake_widget.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: ShakeDemo(),
    );
  }
}

class ShakeDemo extends StatelessWidget {
  final shakeKey = GlobalKey<ShakeWidgetState>();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Shake Demo')),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ShakeWidget(
              key: shakeKey,
              preset: ShakePreset.heavy,
              child: const Icon(Icons.warning, size: 64),
            ),
            const SizedBox(height: 32),
            ElevatedButton(
              onPressed: () => shakeKey.currentState?.shake(),
              child: const Text("Shake it!"),
            ),
          ],
        ),
      ),
    );
  }
}

📄 License

MIT © Juanma Del Boca

श्रेणियाँ

निर्भरताएँ

निर्भरता सूची 1 आइटम

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट

अभी कोई डेटा उपलब्ध नहीं है।