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

flutter_sliding_toast कवर
पैकेज विवरणv1.8.0

flutter_sliding_toast

कस्टम स्टाइलिंग और एनीमेशन व्यवहार के साथ संदेश प्रदर्शित करने के लिए एक फ्लटर पैकेज।

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
1 हज़ार
लाइक
51
Pub अंक
160

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

flutter pub add flutter_sliding_toast

पैकेज अवलोकन

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

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

उपयोग

  • कार्रवाई के बाद उपयोगकर्ता प्रतिक्रिया दिखाएं
  • सफलता या त्रुटि संदेश दिखाएं
  • एप्लिकेशन में अस्थायी चेतावनियाँ प्रदान करना
  • एनिमेटेड नोटिफिकेशन के साथ UI में सुधार करना
  • संदेश के दिखावट और व्यवहार को कस्टमाइज़ करना

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

  • स्लाइडिंग एनीमेशन प्रभाव
  • कस्टमाइज़ किए गए स्टाइल विकल्प
  • क्रॉस-प्लेटफ़ॉर्म सुविधा
  • Flutter के साथ आसान एकीकरण
  • विभिन्न संदेश प्रकारों के लिए समर्थन
  • नियत एनीमेशन अवधि और दिशा

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

  • मोबाइल और वेब एप्लिकेशन
  • हल्की नोटिफिकेशन की आवश्यकता वाले ऐप्स
  • प्रतिक्रिया के लिए एनिमेटेड फीडबैक चाहने वाले विकासकर्ता
  • उपयोगकर्ता इंटरफेस-केंद्रित Flutter परियोजनाएँ
  • हल्के टोस्ट समाधान चाहने वाली टीमें

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

  • मूल टोस्ट कार्यक्षमता तक सीमित
  • जटिल लेआउट के लिए कोई निर्मित समर्थन नहीं है
  • एनीमेशन कस्टमाइजेशन कोड ज्ञान की आवश्यकता होती है
  • डार्क मोड के लिए अतिरिक्त स्टाइलिंग की आवश्यकता हो सकती है
  • स्थायी नोटिफिकेशन के लिए उपयुक्त नहीं

मूल README

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

Flutter Sliding Toast

pub license: MIT

Enhance your app's UI with customizable, interactive toasts! This package offers both sliding & popup styles, with features like animation control, tap actions, and multiple dismiss options.

🎨 Screenshots

🎯 Features

  • Show sliding toasts, modify sliding behaviors
  • Show popup toasts, disable or modify fading and scaling behaviors
  • Change toast's alignment positions and sliding toast's sliding directions
  • Define animation and display duration, max height and width, padding
  • Set title, leading, trailing widgets and make title width dynamic or expanded
  • Disable the progressbar in sliding toast if needed
  • Use glassmorphism/gradient/decorated background or default success and error toast
  • Slide any direction to dismiss sliding toast and vertically for popup toast
  • Dismiss an individual or all toasts programmatically
  • Pause the animation with long press and release it to continue
  • Execute a function after the toast is tapped or disposed
  • Disable Multiple tapping to execute 'onTap' callback only one time
  • Initialize context or overlay state early for persistent toast availability

⚙️ Getting Started

Requires Flutter 3.47.0 or newer.

Add the following line to pubspec.yaml:

dependencies:
  flutter_sliding_toast: ^1.6.0

🚀 Usage

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        iconTheme: const IconThemeData(color: Colors.white),
        title: const Text('Sliding & Popup Toast'),
        centerTitle: true,
      ),
      body: SafeArea(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            const SizedBox(width: double.maxFinite),
            ElevatedButton(
              onPressed: () {
                InteractiveToast.slide(
                  context: context,
                  leading: _leadingWidget(),
                  title: const Text(
                    "Hi there! I'm a sliding toast 😎. "
                    'Dismiss me by sliding upward.',
                  ),
                  trailing: _trailingWidget(),
                  toastStyle: const ToastStyle(titleLeadingGap: 10),
                  toastSetting: const SlidingToastSetting(
                    displayDuration: Duration(seconds: 2),
                    toastStartPosition: ToastPosition.top,
                    toastAlignment: Alignment.topCenter,
                  ),
                );
              },
              child: _textWidget('Sliding toast from top center'),
            ),
            const SizedBox(height: 30),
            ElevatedButton(
              onPressed: () {
                final overlayState = Overlay.of(context);
                InteractiveToast.pop(
                  overlayState: overlayState,
                  title: const Text(
                    "Hi! I'm a popup toast 🐺. "
                    'I have fading and scaling effect.',
                  ),
                  trailing: _trailingWidget(),
                  toastSetting: const PopupToastSetting(
                    animationDuration: Duration(seconds: 1),
                    displayDuration: Duration(seconds: 3),
                  ),
                );
              },
              child: _textWidget('Popup toast at bottom center'),
            ),
          ],
        ),
      ),
    );
  }

  Text _textWidget(String text) =>
      Text(text, style: const TextStyle(fontSize: 16));

  Icon _trailingWidget() => const Icon(Icons.person, color: Colors.deepPurple);

  Container _leadingWidget() {
    return Container(
      width: 40,
      height: 40,
      decoration: BoxDecoration(
        shape: BoxShape.circle,
        color: Colors.purple,
        boxShadow: [
          BoxShadow(
            color: Colors.black.withAlpha(25),
            spreadRadius: 3,
            blurRadius: 4,
          ),
        ],
      ),
      alignment: Alignment.center,
      child: const Text('🦄', style: TextStyle(fontSize: 20)),
    );
  }
}

❤️ Additional information

Pull requests are welcomed!

If you encounter any problems or you have any ideas, feel free to open an issue:

श्रेणियाँ

निर्भरताएँ

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

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

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

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