flutter-animation

Refresh Flutter Text widget content every 5 minutes or periodically

十年热恋 提交于 2020-07-17 12:22:31
问题 I have a Flutter Text widget and its content is populated from an external REST call.I would like to refresh the widget content periodically every 5 mins by calling the REST endpoint. So far I managed to call the endpoint every 5 mins but unable to update/refresh the widget content with new data from network. class PatientCount { int count; double amount; PatientCount({this.count, this.amount}); PatientCount.fromJson(Map<String, dynamic> map) : count = map['count'], amount = map['amount']; }

how to display animated gif in flutter?

旧巷老猫 提交于 2020-06-25 21:36:54
问题 I am trying to display gif in flutter. I am using the code Image(image : NetworkImage(message.image_url)) But it shows error: Another exception was thrown: Exception: HTTP request failed, statusCode: 403, https://media.giphy.com/media/13AXYJh2jDt2IE/giphy.gif%20 回答1: Place your gif in your images folder of your project and mention it in pubspec.yaml file,just like you do for images. Image.asset( "images/loading.gif", height: 125.0, width: 125.0, ) 回答2: This is what used in Flutter Gallery app

how to display animated gif in flutter?

杀马特。学长 韩版系。学妹 提交于 2020-06-25 21:35:47
问题 I am trying to display gif in flutter. I am using the code Image(image : NetworkImage(message.image_url)) But it shows error: Another exception was thrown: Exception: HTTP request failed, statusCode: 403, https://media.giphy.com/media/13AXYJh2jDt2IE/giphy.gif%20 回答1: Place your gif in your images folder of your project and mention it in pubspec.yaml file,just like you do for images. Image.asset( "images/loading.gif", height: 125.0, width: 125.0, ) 回答2: This is what used in Flutter Gallery app

how to display animated gif in flutter?

烈酒焚心 提交于 2020-06-25 21:35:46
问题 I am trying to display gif in flutter. I am using the code Image(image : NetworkImage(message.image_url)) But it shows error: Another exception was thrown: Exception: HTTP request failed, statusCode: 403, https://media.giphy.com/media/13AXYJh2jDt2IE/giphy.gif%20 回答1: Place your gif in your images folder of your project and mention it in pubspec.yaml file,just like you do for images. Image.asset( "images/loading.gif", height: 125.0, width: 125.0, ) 回答2: This is what used in Flutter Gallery app

Animated container : RenderFlex overflowed by 154 pixels on the bottom

有些话、适合烂在心里 提交于 2020-06-23 13:18:31
问题 I have a problem when resizing an animated container while setting different content height. It throws exception while resizing : ════════ Exception caught by rendering library ════════ The following assertion was thrown during layout: A RenderFlex overflowed by 154 pixels on the bottom. Here is a minimal example to reproduce the problem (much more complex in my real app but you get the point) : bool expanded; initState() { super.initState(); expanded = false; } void _toggleMode() { setState(

Load more data using Stream Builder in list view

岁酱吖の 提交于 2020-06-17 14:00:27
问题 I am trying to develop an app in flutter, that has topics that the user scroll the Listview end pull the data from api and reload into listview using StreamBuilder and onRefresh its not working.i tried i am not able do that. i implemented scroll view in _GetShaftsState class its not working where do implement? Any one can explain? Example loading more data when list view scroll end again call service api to load the data into listview when first time load record count 30 at end of list view

Flutter - Hero animation is not working with tab navigator

社会主义新天地 提交于 2020-05-28 04:57:42
问题 I am new to flutter and I am using hero widget to make animation for floating button. I have bottom navigation and I have to open page with tab navigator. But hero animation is not working. I use every possible solution but still hero animation not working for page route. Here is my code snippet. FloatingActionButton( onPressed: () { _selectTab(TabItem.Floating); }, child: Icon(Icons.add), heroTag: "tag", ), This is click for fab button to open new page void _selectTab(TabItem tabItem) { if

Flutter - Hero animation is not working with tab navigator

生来就可爱ヽ(ⅴ<●) 提交于 2020-05-28 04:55:33
问题 I am new to flutter and I am using hero widget to make animation for floating button. I have bottom navigation and I have to open page with tab navigator. But hero animation is not working. I use every possible solution but still hero animation not working for page route. Here is my code snippet. FloatingActionButton( onPressed: () { _selectTab(TabItem.Floating); }, child: Icon(Icons.add), heroTag: "tag", ), This is click for fab button to open new page void _selectTab(TabItem tabItem) { if

How to animate Alert dialog position in Flutter?

▼魔方 西西 提交于 2020-05-23 13:00:53
问题 By this simple code I can show dialog on bottom of screen like with this screenshot: But I have three simple issue: set margin on bottom of dialog such as 20.0 on showing dialog using controller.reverse() on dismiss dialog dismiss dialog on click on outside of dialog Full source code: import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return

How get moving text in widget with given width

若如初见. 提交于 2020-05-18 00:53:32
问题 I am building a radio app. Like in Spotify, there is a bar with the current title and artist, the text should be in one line and in a given width. How can I let the text move from right to left and back? When using a self-made animation, I want to have a fixed speed of the moving text, so I need the time and the width of the text widget. Is there a package/built-in option to do this? Or do I have to use a self-made animation? If so, how can I get the text widget width? Controller and