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

circular_reveal_animation कवर
पैकेज विवरणv2.0.2

circular_reveal_animation

सर्कुलर रिवील एनिमेशन को फ्लटर विजेट के रूप में! एंड्रॉइड के ViewAnimationUtils.createCircularReveal(...) से प्रेरित।

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

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

flutter pub add circular_reveal_animation

पैकेज अवलोकन

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

एक फ्लटर विजेट जो सर्कुलर रिवील एनिमेशन को संभव बनाता है, जिसका प्रेरणा एंड्रॉइड के ViewAnimationUtils.createCircularReveal से लिया गया है। यह लक्षित विजेट पर चिकनी विस्तार या सिकुड़ने वाले गोलाकार प्रभाव बनाता है, जो सामग्री को प्राकृतिक, द्रव गति के साथ खोलने या छिपाने के लिए आदर्श है। एनिमेशन प्लेटफॉर्म-अनाधारित है और एंड्रॉइड, iOS, वेब, macOS, Windows और Linux में काम करता है। यह मौजूदा फ्लटर ऐप्स में बिना किसी असुविधा के एकीकृत होता है ताकि UI ट्रांज़िशन और उपयोगकर्ता भागीदारी को बढ़ावा दिया जा सके।

उपयोग

  • रिपल प्रभाव के साथ छुपी हुई सामग्री का खुलासा
  • बंद होने वाले गोलाकार एनीमेशन के साथ विजेट्स को छिपाना
  • डायनामिक रिवील इफेक्ट के साथ इंटरैक्टिव बटन बनाना
  • एनिमेटेड एंट्री के साथ स्प्लैश स्क्रीन को बढ़ावा देना
  • सुचारू दिखावट के साथ मोडल डायलॉग डिज़ाइन करना
  • नेविगेशन ट्रांज़िशन में विजुअल फीडबैक जोड़ना

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

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

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

  • आकर्षक ट्रांजिशन की तलाश में UI डिजाइनर
  • इंटरैक्टिव फ्लटर ऐप्स बनाने वाले डेवलपर्स
  • मैटेरियल डिज़ाइन के आधार पर एनीमेशन वाले ऐप्स
  • डायनामिक कंटेंट वाले प्रोजेक्ट्स आवश्यकताओं को उजागर करते हैं
  • एक समान व्यवहार के साथ कई प्लेटफॉर्म का लक्ष्य बनाने वाली टीमें

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

  • जटिल बच्चा विजेट के साथ प्रदर्शन में भिन्नता हो सकती है
  • अपने दृश्य परिणामों के लिए सावधानीपूर्वक स्थिति की आवश्यकता होती है
  • त्रिज्या और केंद्र के बाहर सीमित कस्टमाइजेशन
  • उच्च आवृत्ति एनीमेशन के लिए उपयुक्त नहीं
  • पूर्ण-स्क्रीन प्रभाव के लिए अतिरिक्त लेआउट लपेटने की आवश्यकता हो सकती है

मूल README

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

Circular Reveal Animation

pub package

Circular Reveal Animation as Flutter widget!

Inspired by Android's ViewAnimationUtils.createCircularReveal(...).

Статья с описанием (русский).

Article with description (english).

Demo web-site

Usage

CircularRevealAnimation(
  // @required
  child: Container(color: Colors.red),
  // @required [Animation<double>]
  animation: animation,
  // child's center if not specified
  centerAlignment: Alignment.centerRight,
  // 0 if not specified
  minRadius: 12,
  // distance from center to further child's corner if not specified
  maxRadius: 200,
);

Example

import 'package:circular_reveal_animation/circular_reveal_animation.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'CRA Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage>
    with SingleTickerProviderStateMixin {
  AnimationController animationController;
  Animation<double> animation;

  @override
  void initState() {
    super.initState();
    animationController = AnimationController(
      vsync: this,
      duration: Duration(milliseconds: 1000),
    );
    animation = CurvedAnimation(
      parent: animationController,
      curve: Curves.easeIn,
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("CRA Demo"),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              MaterialButton(
                child: Text("show reveal dialog"),
                onPressed: () => showRevealDialog(context),
                color: Colors.amber,
              ),
              SizedBox(height: 16),
              CircularRevealAnimation(
                child: Image.asset('assets/ocv.jpg'),
                animation: animation,
//                centerAlignment: Alignment.centerRight,
                centerOffset: Offset(130, 100),
//                minRadius: 12,
//                maxRadius: 200,
              ),
            ],
          ),
        ),
      ),
      floatingActionButton: FloatingActionButton(onPressed: () {
        if (animationController.status == AnimationStatus.forward ||
            animationController.status == AnimationStatus.completed) {
          animationController.reverse();
        } else {
          animationController.forward();
        }
      }),
    );
  }

  Future<void> showRevealDialog(BuildContext context) async {
    showGeneralDialog(
      barrierLabel: "Label",
      barrierDismissible: true,
      barrierColor: Colors.black.withOpacity(0.5),
      transitionDuration: Duration(milliseconds: 700),
      context: context,
      pageBuilder: (context, anim1, anim2) {
        return Align(
          alignment: Alignment.bottomCenter,
          child: Container(
            child: Padding(
              padding: const EdgeInsets.all(12.0),
              child: Image.asset('assets/klimt.png'),
            ),
            margin: EdgeInsets.only(top: 50, left: 12, right: 12, bottom: 0),
            decoration: BoxDecoration(
              color: Colors.white,
              borderRadius: BorderRadius.circular(5),
            ),
          ),
        );
      },
      transitionBuilder: (context, anim1, anim2, child) {
        return CircularRevealAnimation(
          child: child,
          animation: anim1,
          centerAlignment: Alignment.bottomCenter,
        );
      },
    );
  }
}

श्रेणियाँ

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

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