flutter-animation

How to swipe/drag 2 or more buttons in a grid of buttons using flutter

杀马特。学长 韩版系。学妹 提交于 2019-12-21 04:16:08
问题 I have made a grid of buttons using flutter but now I want to swipe through 2 or more buttons in a single drag such that all the buttons through which I am dragging gets selected. I have checked out some questions on the same and I was redirected to use gesture detector but that's not enough. I need certain properties or better a sample code such that I am able to work through it. an example of the dragable app is http://a5.mzstatic.com/us/r30/Purple60/v4/6f/00/35/6f0035d3-1bab-fcbb-cb13

What is the alternative to RecyclerView in Flutter?

南楼画角 提交于 2019-12-19 07:26:05
问题 What is the alternative to Recycle view in flutter I have tried using this code but how to do Animination with listview widget in flutter Is this valid? ListView( children: <Widget>[ ListTile( leading: Icon(Icons.map), title: Text('Map'), ), ListTile( leading: Icon(Icons.photo_album), title: Text('Album'), ), ListTile( leading: Icon(Icons.phone), title: Text('Phone'), ), ], ); 回答1: You can also use animatedlist widget for animations. code example are given in the following link. AnimatedList

Horizontally scrollable cards with Snap effect in flutter

不问归期 提交于 2019-12-17 17:41:03
问题 I want to create a list of cards scrolling horizontally with snap to fit effect when swiped either from left or right. Each card has some spacing between them and fit to screen similar to below image Apart from that these horizontally scrollable list elements should be contained inside a vertically scrollable list. I all I am able to achieve is only displaying a list of horizontal scrolling cards after following example in flutter docs. class SnapCarousel extends StatelessWidget { @override

Changing speed of InkWell

狂风中的少年 提交于 2019-12-14 04:16:22
问题 I am having trouble replicating a normal settings menu in Flutter. I am using an InkWell to try to create the splash effect that normally occurs when you tap on a settings option. The problem is that the splash effect appears way too fast compared to how it normally is. Basically, I just want to slow down the InkWell. 回答1: It's possible to create what you wanted but it requires a custom splashFactory under InkWell class. As you see in the variables below, these are meant to be private values

How to animate the items rendered initially using Animated List in flutter

北城以北 提交于 2019-12-13 17:45:51
问题 I am using Animated List in flutter to load a list class, while adding or removing the items, the animation works but when the list is initially loaded, the animation does not work. Is there a way to animate items when initially loading the list. class AnimationTest extends StatefulWidget { @override _AnimationTestState createState() => _AnimationTestState(); } class _AnimationTestState extends State<AnimationTest> with SingleTickerProviderStateMixin { AnimationController _controller;

Flutter, passing parameters to PageRoutebuilder

风流意气都作罢 提交于 2019-12-13 04:03:56
问题 In Method gotoThirdScreen(), I am tryiing to pass parameters to a class. I believe the issue starts at: //========================================================= //=== please put PageRouteBuilderCode here. The Class SecondPage has... widget.title. But not sure how to pass titel from _gotoThirdPage(). This code works //=============================== import 'package:flutter/material.dart'; void main() => runApp(new MyApp()); class MyApp extends StatelessWidget { // This widget is the root of

Does anyone know how to implement a search bar with tabs like that similar to instagram using flutter?

有些话、适合烂在心里 提交于 2019-12-11 14:35:36
问题 I want to know how to build a search bar where it filters the users search input into groups or tabs such as people, tags, places just like what instagram has but I don't know how to do this! 回答1: It could look like this: import 'package:flutter/material.dart'; main() => runApp( MaterialApp( // home: Scaffold( // body: Container(child: SearchButton()), home: Body()), ); class Body extends StatefulWidget { @override _BodyState createState() => _BodyState(); } class _BodyState extends State

How do you add a Curves class animation to AnimationController in Flutter?

自作多情 提交于 2019-12-11 06:17:08
问题 I'm trying to add the curves class animation 'Curves.bounceOut' to my code that uses an AnimationController. Here is my code: import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: MyHomePage(), ); } } class MyHomePage extends StatefulWidget { _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> with

Animation Of Container using Offset - Flutter

纵饮孤独 提交于 2019-12-10 14:55:49
问题 I am trying to move the container on the screen by giving begin and end offset like from Offset(0.0,0.0) to Offset(400.0,300.0) . I am using Slide Transition to animate the container I am using Tween<Offset>(begin: const Offset(3.0, 4.0), end: Offset(0.0, 0.0)) to move it on the screen I want to pass these Offset(400.0,300.0) and animate it. Here is my code class MoveContainer extends StatefulWidget { MoveContainer({Key key, }) : super(key: key); @override State<StatefulWidget> createState()

Alert Dialog with Rounded corners in flutter

不羁岁月 提交于 2019-12-08 23:16:35
问题 I am trying to create an alert dialog with rounded corners in Flutter same as below screenshot. also add my code here, but my output is exactly different from the expected one. anyone, please help me. Expected Alert Dialog my code is here. void _showAlert() { AlertDialog dialog = new AlertDialog( content: new Container( width: 260.0, height: 230.0, decoration: new BoxDecoration( shape: BoxShape.rectangle, color: const Color(0xFFFFFF), borderRadius: new BorderRadius.all(new Radius.circular(32