animated_progress_button
क्या आप अपने बटन को पेशेवर बनाने के लिए समाधान तलाश रहे हैं? इस पैकेज की मदद से आपको Pinterest से सभी एनीमेशन प्रेरणा मिल सकती है।
nghiashiyi/animated_button open-source repository details.
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
Animated loading button to make you app button looks smoother. Take inspritation from Pinterest https://www.pinterest.com/pin/671177150707141229/
Create animatedButtonController for controlling the button.
import 'package:animated_progress_button/animated_progress_button.dart';
final AnimatedButtonController animatedButtonController = AnimatedButtonController();
Then customize the button like your own way
Noted that you must call animatedButtonController.completed() after getting response from server in order to complete the button animation
AnimatedButton(
controller: animatedButtonController,
color: Colors.greenAccent,
text: 'Log in',
loadingText: 'Loading',
loadedIcon: Icon(Icons.check, color: Colors.white),
onPressed: () async {
/// calling your API here and wait for the response.
await Future.delayed(Duration(seconds: 5)); // simulated your API requesting time.
animatedButtonController.completed(); // call when you get the response
await Future.delayed(Duration(seconds: 2));
animatedButtonController.reset(); // call to reset button animation
},
),
निर्भरता सूची 2 आइटम
{"sdk":"flutter"}{"sdk":"flutter"}उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗