Flutter - Floating Button inside a popup widget overlaying the scroll - flutter

Im working on my first flutter app so i am still learning possible widgets and how they react in certain structures.
So far I was doing well but cant figure out one thing I want to do.
I want to get a floating button inside of my cupertinopopusurface widget like this.
My structure is similar, on the home screen I have a listview builder that builds my cards and when you press on each one it opens a cupertinopopupsurface.
Inside I also built a Single child scroll view structure for all my contant and its scrollable but I would to get a button that overlays it all and is in a fixed placed.
My structure currently is
CupertinoPopupSurface/
Container/
SingleChildScrollView/
Column/
Children/
Row/ (all rows now with content)
I cant get the button fixed somewhere in the structure but then it follows the scrolling its now fixed overlaying the contant.

You can use stack widget inside cupertinopopupsurface like this:
CupertinoPopupSurface(
child: Stack(
children:[
your SingleChildScrollView,
Positioned(left: 16, right: 16, bottom: 16,child: yourbutton),
]
)
)

Related

how to make UnScrollable list with button in flutter

can some one tell me how to make a long list with multiple widgets , but not scrollable , instead , there will be a button (like the arrow on the right in the picture) when you click it, it will slide to the next widgets available with the simple animation (not poping the current widgets sliding it instead), do we have a widget specified for that ? here is example of what i want :
In your Scrollable widget, set physics to the NeverScrollableScrollPhysics() calss. For example:
SingleChildScrollView(physics: NeverScrollableScrollPhysics(),
...
)

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.

Combine multiple ListView scroll as one in flutter

I have a simple ListView with a scrollable child, which works as it should. But the issue is, when I scroll the items of ScrollableChild and it reaches its last child, it doesn't scroll the parent ListView. How can I achieve this behaviour?
ListView(children: [
...items(5),
ScrollableChild(),
...items(30),
])
I have tried to use the NestedScrollableWidget but unable to find any working solution.
Sample Code
I've tried to use the CustomScrollView, but unfortunately, the result is the same.
CustomScrollView(slivers: [
SliverList(delegate: SliverChildListDelegate(items(5))),
SliverToBoxAdapter(child: ScrollableChild()),
SliverList(delegate: SliverChildListDelegate(items(50))),
]),
Sample Code
The expected behavior can be viewed in this [Video].
the code I have shared works fine in a browser without any issue if you scroll it using the mouse wheel only.
When the blue child items scroll reaches at the end. it just scrolls the parent, that's what I am looking for.

What's the best way to create a vertical button menu in Flutter?

Total noob here.
I'm making an app menu in Android Studio, using Flutter/dart as my code base. I need to make a series of horizontal buttons laid out in a vertical column.
The button design is essentially an outline button. White button but with a grey outline.
Would it be best to put these buttons in a ListView and have OutLineButtons as the buttons OR have them in a column and the children of that column be rows with the buttons inside?
Appreciate the advice.
An image i pulled from google to illustrate the layout of what i'm looking for
welcome to the Flutter world.
You can use the Column class to do that. [Here is the doc]
Inside that Column You can add more widget as many as you want.
Example:
Column(
children: <Widget>[
//Your first menu widget
//Your second menu widget
//Your third menu widget
],
)
You can read the docs or look for tutorials for more information. Happy creating

How to create a custom back press button?

I am new to flutter and curious if we can create a custom back press button, not the one in appbar.
Just like a normal button that takes back to previous screen.
Here's how you so that:
Create a raw material button
Add the on press method to decide which screen it goes to.
In you main.dart, under the routes method, import the screen you want to push the current screen back to and then call it something.
Inside your onPress() method, you can call Navigator.pushNamed(context, routeName).
Now you can customise this raw material button as much as you want. Here are some of the main properties you can set:
textStyle
fillColor
elevation
padding
constraints
shape
child
Now give a name to this custom button you have created by extracting it into a widget.
Call the widget inside your code! If you want it to be aligned at the top left, which is usually where you find it:
Align(
alignment: Alignment.topLeft,
child: CustomButton()
),
Enjoy! PS: If you need any help, feel free to ask me and I will assist you to my best abilities!