Error: RenderBox was not laid out, Failed assertion: line 1940 pos 12: ‘hasSize’

This happens when ListView has no constrained height which makes it gets an infinite height, you can solve this using two solutions add shrinkWrap: true as a parameter which will tell the ListView to use a little space as possible, Wrap your ListView with a constrained height widget, such as a SizedBox or a Container, … Read more

How to change speed of a hero animation in flutter

To modify the transition speed, you’ll have to adjust the PageRoute transition duration (as already pointed out by @diegoveloper). If you wanna keep the default transition, you can create a class implementing MaterialPageRoute. If you already have your own transition or want to create one you can use the PageRouteBuilder to easily build your own. … Read more

flutter: animate transition to named route

You need to use onGenerateRoute in your MaterialApp widget. onGenerateRoute: (settings) { if (settings.name == “/someRoute”) { return PageRouteBuilder( settings: settings, // Pass this to make popUntil(), pushNamedAndRemoveUntil(), works pageBuilder: (_, __, ___) => SomePage(), transitionsBuilder: (_, a, __, c) => FadeTransition(opacity: a, child: c) ); } // Unknown route return MaterialPageRoute(builder: (_) => UnknownPage()); … Read more

How to rotate an image using Flutter AnimationController and Transform?

Full example (null safe): Press “go” makes the star icon spin until you press “stop”. 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 { @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> with SingleTickerProviderStateMixin … Read more

Horizontally scrollable cards with Snap effect in flutter

Use PageView and ListView: import ‘package:flutter/material.dart’; main() => runApp(MaterialApp(home: MyHomePage())); class MyHomePage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text(‘Carousel in vertical scrollable’), ), body: ListView.builder( padding: EdgeInsets.symmetric(vertical: 16.0), itemBuilder: (BuildContext context, int index) { if(index % 2 == 0) { return _buildCarousel(context, index ~/ 2); } else { … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)