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

Flutter API Fetch and Sending Data from One screen to another screen

You should try to declare constructor the first page accept the id and push this id to second page or screen like this below code is first page Navigator.push( context, MaterialPageRoute( builder: (context) => ABC.withId( id, ), ), ) the create constructor inside second page screen class ABC extends StatefulWidget { @override _ABCState createState() => … Read more

Programmatically scrolling to the end of a ListView

Screenshot: Scrolling with animation: final ScrollController _controller = ScrollController(); // This is what you’re looking for! void _scrollDown() { _controller.animateTo( _controller.position.maxScrollExtent, duration: Duration(seconds: 2), curve: Curves.fastOutSlowIn, ); } @override Widget build(BuildContext context) { return Scaffold( floatingActionButton: FloatingActionButton.small( onPressed: _scrollDown, child: Icon(Icons.arrow_downward), ), body: ListView.builder( controller: _controller, itemCount: 21, itemBuilder: (_, i) => ListTile(title: Text(‘Item $i’)), … Read more