सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
Rive एक Flutter पैकेज है जो Rive संपादक के साथ बनाए गए इंटरैक्टिव एनीमेशन और ग्राफिक्स के रनटाइम रेंडरिंग की अनुमति देता है। यह विकासकर्ताओं को अपने ऐप्स में कई प्लेटफॉर्मों पर चिकने, हल्के वेक्टर एनीमेशन एम्बेड करने की अनुमति देता है। पैकेज रियल-टाइम एनीमेशन प्लेबैक, स्टेट मैनेजमेंट और रिस्पॉन्सिव डिज़ाइन का समर्थन करता है, जिससे यह डायनामिक UI और गेम एसेट्स के लिए आदर्श होता है। Android, iOS, Web, macOS, Windows और Linux के समर्थन के साथ, Rive सुनिश्चित करता है कि प्रदर्शन और दृश्य गुणवत्ता समान रहे। यह Flutter ऐप्स के साथ बिना किसी दिक्कत के एकीकरण के लिए डिज़ाइन किया गया है और सरल APIs का उपयोग करता है।
उपयोग
इंटरैक्टिव एप्लिकेशन इंटरफ़ेस
गेम कैरेक्टर एनिमेशन
लोडिंग संकेतक
ऑनबोर्डिंग अनुभव
एनिमेटेड बटन
Micro-interactions
मुख्य विशेषताएँ
वेक्टर-आधारित एनीमेशन
रियल-टाइम प्ले बैक
राज्य मशीन समर्थन
प्लेटफॉर्म के अनुकूलता
हल्का प्रदर्शन
फ्लटर एकीकरण आसान
इनके लिए उपयुक्त
UI/UX डिजाइनर्स
गेम डेवलपर्स
मोबाइल ऐप निर्माता
वेब विकासकर्मी
एनिमेशन-फोकस्ड प्रोजेक्ट्स
इंटरैक्टिव प्रोटोटाइप
विचार योग्य बातें
संपत्ति निर्माण के लिए Rive संपादक की आवश्यकता होती है
Rive फ़ाइल प्रारूप (.riv) में सीमित
Rive के एनिमेशन सिस्टम को सीखने की आवश्यकता हो सकती है
प्रदर्शन एनीमेशन की जटिलता पर निर्भर करता है
स्थिर छवियों के लिए उपयुक्त नहीं
Rive-संगत डिज़ाइन कार्यप्रवाह के साथ सबसे अच्छा उपयोग किया जाता है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
Rive Flutter
Rive Flutter is a runtime library for Rive, a real-time interactive design tool.
This library allows you to fully control Rive files in your Flutter apps and games.
Rive combines an interactive design tool, a new stateful graphics format, a lightweight multi-platform runtime, and a blazing-fast vector renderer. This end-to-end pipeline guarantees that what you build in the Rive Editor is exactly what ships in your apps, games, and websites.
For more information, check out the following resources:
The rive package depends on rive_native, and the code on GitHub may reference an unpublished version of rive_native. To run the example app, we recommend using the published version from Pub unless you intend to build the native libraries locally (see Building rive_native).
dart pub unpack rive # Unpack the package source code and example appcd rive/example # Navigate to the example folder
flutter create . # Create the platform folders
flutter pub get # Fetch dependencies
flutter run # Run the example app
For more information, see the Runtime sections of the Rive help documentation:
In Rive Flutter you have the option to choose either the Rive renderer, or the renderer that is used in Flutter (Skia or Impeller).
You choose a desired renderer when creating a Rive File object. All graphics that are then created from this File instance will use the selected renderer.
final riveFile = (awaitFile.asset(
'assets/rewards.riv',
// Choose which renderer to use
riveFactory: Factory.rive,
))!;
Starting in Flutter v3.10, Impeller has replaced Skia to become the default renderer for apps on the iOS platform and may continue to be the default on future platforms over time. As such, there is a possibility of rendering and performance discrepencies when using the Rive Flutter runtime with platforms that use the Impeller renderer that may not have surfaced before. If you encounter any visual or performance errors at runtime compared to expected behavior in the Rive editor, we recommend trying the following steps to triage:
Try running the Flutter app with the --no-enable-impeller flag to use the Skia renderer. If the visual discrepancy does not show when using Skia, it may be a rendering bug on Impeller. However, before raising a bug with the Flutter team, try the second point below👇
flutter run --no-enable-impeller
Try running the Flutter app on the latest master channel. It is possible that visual bugs may be resolved on the latest Flutter commits, but not yet released in the beta or stable channel.
If you are still seeing visual discrepancies with just the Impeller renderer on the latest master branch, we recommend raising a detailed issue to the Flutter Github repo with a reproducible example, and other relevant details that can help the team debug any possible issues that may be present.
For even more examples and resources on using Rive at runtime or in other tools, checkout the awesome-rive repo.
Troubleshooting
The required native libraries should be automatically downloaded during the build step (flutter run or flutter build). If you encounter issues, try the following:
Run flutter clean
Run flutter pub get
Run flutter run
Alternatively, you can manually run the rive_native setup script. In the root of your Flutter app, execute:
dart run rive_native:setup --verbose --clean --platform macos
This will clean the rive_native setup and download the platform-specific libraries specified with the --platform flag. Refer to the Platform Support section above for details.
Building rive_native
By default, prebuilt native libraries are downloaded and used. If you prefer to build the libraries yourself, use the --build flag with the setup script. In the root of your Flutter app:
flutter clean # Important
flutter pub get
dart run rive_native:setup --verbose --clean --build --platform macos
See Building rive_native in the official docs for the required tooling per platform, supported --platform values, web specifics, and how to return to the prebuilt libraries.
Testing
Shared libraries are included in the download/build process. If you've done flutter run on the native platform, the libraries should already be available.
Otherwise, manually download the prebuilt libraries by doing:
dart run rive_native:setup --verbose --clean --platform macos
Specify the desired --platform, options are macos, windows, and linux.
Now you can run flutter test.
Optionally build the libraries if desired:
dart run rive_native:setup --verbose --clean --build --platform macos
If you encounter issues using rive_native in your tests, please reach out to us for assistance.