Categories
Mastering Development

Incorrect use of ParentDataWidget when adding horizontal listview inside vertical listview

I want to add a vertical listView inside horizontal listView but it always shows me incorrect use of parent data widget I have tried adding expanded widget around Column widget but it does not work I also tried shrink wrap with column and set it to true but it did not work either Main Page […]

Categories
Mastering Development

NoSuchMethodError: The getter ‘key’ was called on null : flutter

It only appears on my screen title on the App bar. What is the mistake or error? The error message is: "NoSuchMethodError: The getter ‘key’ was called on null" it is coming from object_patch.dart I have attached some screenshots and code below. Please look inside streambuilder. It return column in else if and if parts. […]

Categories
Mastering Development

Scroll to an off-screen widget? ListView Flutter

How do I scroll to an off-screen element? ListView.builder uses pagination, and hidden items are not embedded in the tree thanks example below…………………………………………………………………………………………………………………………………………….. import ‘package:flutter/material.dart’; class ScrollView1 extends StatefulWidget { @override _ScrollView1State createState() => _ScrollView1State(); } class _ScrollView1State extends State<ScrollView1> { final dataKey = new GlobalKey(); List<String> list1 = [ ‘button1’, ‘button2’, ‘button3’, ‘button4’, ‘button5’, […]

Categories
Mastering Development

How to add vertical and horizontal list in single list

I want to add vertical and horizontal list in single list but problem is when i want to put horizontal and vertical list in single list i have give height to container but for vertical list i want to scroll in full screen but it is not possible i have to put height to vertical […]

Categories
Mastering Development

Generating widgets in Pageview based on conditional logic

Currently facing a problem with conditional logic and PageView widget. Let’s say that the PageView will dynamically generate 3 pages. In those 3 pages different widgets will be generated. One of the widgets is a button (called “Next”), which is a PageController, but that widget has to be replaced by a button widget that is […]

Categories
Development

How can I dynamically shift the scroll position or shift the child of a SingleChildScrollView when the content changes in Flutter?

I have a Flutter medical app that shows waveforms. Customers want an infinite scroll in both directions horizontally. To save memory I’m using a SingleChildScrollView with a fixed size Container as a child (to maintain aspect ratio) coupled with a ScrollController and listener that causes data to be prefetched in both directions on scroll. This […]

Categories
Development

Flutter – Focusable ListView items

I am new in flutter lately I was working with ListView Builder and FocusNode in flutter, I want a list of widgets only one selectable at a time, initially it works fine but when there is a long list (take it of 7 items), when I click on 1st item and go the last item […]

Categories
Development

Is there a way to create category in flutter and firestore

I’m creating category section for my shop app in flutter with firestore, which I have been able to retrieve all category in a listview but I want to know how I can retrieve each category collection when I onTap it. Thanks This the code have written for changeNotifier and firestore query class CategoryNotifier with ChangeNotifier […]

Categories
Development

How to show the set middle child of ListView when scroll Direction is horizontal?

So, I am trying to show pricing cards. Where idea is to show them horizontally scrollable, so I used listView and set the scrollDirection: Axis.horizontal but, now as it gets render it show the first child in a weird position. So, I was trying if I can show the middle child on-screen rather than the […]

Categories
Development

scrollcontroller not attached to any scroll views (Swiper)

I’m using a Swiper package to achieve a carousel effect on my images. I’m trying to update the current index of my Swiper by passing a callback function to it’s child. but when I try to call the function, it returns this ” scrollcontroller not attached ” error. I’ve added a SwiperController but still the […]