Flutter Not able to achieve PageView like Swipeable Tabs inside Parent ListView - flutter

This is a Flutter Specific Query.
I Want to achieve the Layout Referenced in the Image above. Two Tabs
Below a Container.
The Tabs can be switched using Swipe Animation like that in a
Page View.
The Tabs Contain Dynamically Generated Widgets from Provider.
The Entire Page along with the Fixed Container must be
Scroll-able.
When Switching between the Tabs the fixed container should stay
in place and only tab Content(Column of Widgets) should swipe
left and right.
What I've Tried :
Using a Parent List View and Nesting the Fixed Container Child
and Using Tab Bar to switch the Widget using Animated Switcher and
Slide Animation. Here the Problem is i cannot swipe left and right
and create the Page View like Effect. I also tried Nesting Page-View
inside List-View but since the Page-View does not have a fixed height
( because the tab contents are dynamically generated ).
A few many more concepts i tried to tackle but the issue every time was
that the tab contents are not having a fixed height.
I really want to achieve this Layout and i want to know if there's any way.

Related

Flutter: SingleChildScrollView is not able to scroll to bottom within Expanded

I have programmed a modal buttom sheet which with this package (using a showCupertinoModalBottomSheet). This modal has a "header" which shows the heading and a close button on the left so the user knows what the modal is about and has a "footer" with two buttons to either apply the filter or reset it.
Between the header and the footer is a a Expanded component with a SingleChildScrollView inside in order to scroll inside the modal. This is needed because there are more filter options available than space! I am very happy that I found a solution without a SizedBox component which has a given height because the height of smartphones vary.
However, now I am facing one last problem: Sadly I am not able to scroll to the bottom of my SingleChildScrollView. This problem also occurs when removing the "footer" with the two buttons. Means, the SingleChildScrollView goes beyond the screen height (which is fine) but which is useless when I am not able to scroll to the bottom of my list. At the end of this post I have added an image so you can see the problem.
Here you can find my dartpad without the modal buttom sheet which is not supported yet on dartpart. However, because dartpad presents the web view instead of the mobile view I am not able to recreate the problem 100%. When using the mouse wheel to scrol you can scroll to the end of the list. But as you can see in the image below in the mobile version is does not work!
Does anyone has an idea how I can solve this?
I already have tried adding Containers with padding and margin to the bottom but this sadly doesn't work or leads to rendering issues.
There is also a stackoverflow post which seems to solve this problem but that leads to an rendering issue for me: https://stackoverflow.com/a/63613723/9445999
Image:
Kind regards and thank you!

Dart/Flutter: change content of container on tab in ListView

I am currently trying to create something like a TabBar. I created a horizontal ListView which should work as the TabBar and I my goal is, that one row fills itself with a list that contains the cards for the Tab I clicked on and refreshes when I click on another one. Is there a way to do that? It should look like this:
Reference Picture
Did you look at Work with tabs, an introduction to TabBar, TabBarView and DefaultTabController?
You could also create it from scratch using a ListView with a Card wrapped in a GestureDetector or a ListTile, and detect taps on onTap, which would set the selected data and update state using setState.

Disable PageView scrolling in Card widget

Imagine, that you have two pages - pages A and B.
Of course, you can switch between pages by clicking on the tab bar or swipe (left to right or right to left).
On page A, there are multiple Card widgets, one of them contains charts.TimeSeriesChart.
Chart contains behaviour: charts.SlidingViewport(), charts.PanAndZoomBehavior(), nevertheless it doesn't work.
When I put physics:NeverScrollableScrollPhysics(), into PageView, charts getting scrollable feature.
Question:
I would like to allow swipe between tabs, but how to disable swipe between tabs only in this Card widget (with chart), and make sliding working in Chart?
I'm using this package: https://pub.dev/packages/charts_flutter

How to keep the scrolling position when adding a new elements in the top using ListView or CustomScrollView in Flutter

Is it possible to add new elements into the top of the ListVeiw or CustomScrollView and keep the scroll position as it's with Flutter
I've tried the following
extentAfter = _scrollController.position.extentAfter;
_scrollController.jumpTo(_scrollController.position.maxScrollExtent - extentAfter);
but this won't work well with SliverAppBar - floating and its actually not optimal solution.
Actually the cleanest way would be to add those items only when user scrolls back to the top of the ListView. You can cache them in memory for the moment user is far enough from the top (in your case) of the list.

Flutter Widget Overflow Parent (Tabbar Oversized item)

I would like to have a tab bar that looks like this:
Note the center "My ID" button.
So here is my main problem:
Obviously I need a SafeArea to deal with irregular shaped screens, which itself need to be embedded in a Container so I can give the bar its background color. But, by doing this, how can I create the "oversized" button at the center?
After spending several hours banging my head against the wall, found a not so elegant solution. (Hey, but it works)
Here's a picture of the result.
So the way I made it work is actually by having two layers.
On the base of the widget tree is a Stack which contains everything that is currently seen on this page.
The actual bar widget has the text and icons, (the My ID part has only text no icon, but a placeholder SizedBox is used in place of the icon otherwise would be there)
By using the stack, I am able lay the round icon on top of the entire bar much like a FloatingActionButton