Transparent overlapping appbar - flutter

I'm trying to find a way to have a transparent appbar that overlaps the page content. I know I can use a SliverAppBar to show the appbar initially, and then have it slide out of view when scrolling, which is good. I can even give it a transparent background color. However, when you scroll to the top of the page, it always makes room for the bar to sit above the page content.
What I want is for the page content to be flush with the top of the page, as if there is no appbar, and then have a transparent appbar slide into view like a SliverAppBar does, so that I just have some action buttons overlapping the top of the page.
How can I pull that off? Is there a way to stack the appbar or change margins so it doesn't take space?

You can just put a scaffold and your "page" in a stack(), make sure the scaffold is the last item in the stack. You can get creative an add animations for the app bars yourself or even use the sliver app bar, just make sure you use the same scroll controller for your app bar and content.
eg:
#override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
// Your content
Container(
color: Colors.pink,
),
Scaffold(
appBar: AppBar(
title: Text("heading"),
bottom: AppBar(
title: Text("footer"),
),
),
),
],
);
}

Related

i want to locate pageview in listview

#override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.purpleAccent.shade200,
title: Text_Button(),
actions: [IconButton(onPressed: () {}, icon: Icon(Icons.menu))],
),
body: ListView(
children:[ PageView(
children: [
Image.asset(
"asset/img/1.PNG",
),
Image.asset(
"asset/img/2.PNG",
),
],
)],
),
);
}
I don't know why it does no work.
I think maybe the problem from the relationship between ListView and Pageview
or my image.
i want to upload the error name but the code is too long to upload.
please help me
the ultimate my purpose is it.
it : locate my images on the top of my app under the appbar with pageview function.
The reason I want to use a list view is because my app is vertically long, so it doesn't fit on the screen all at once. at the same time
as a pageview under the app bar
I want to add slideable photos. How the hell can I do that? Because I am Korean, my English is poor. Please understand. handsome friends.
few days ago
in the column
with pageview
put textbutton
I have a memory.
So I know that a Pageview can be put inside a Colmn.
therefore
Put Pageview in Colmn,
I tried to align upwards with mainaxis but this also
error pops up
So I thought about it, a few days ago
I used a long photo vertically, but this time I used a long photo horizontally.
Perhaps this is the problem.
You can use carousel_slider: ^4.2.1 package to set slidable photos under appbar

How i can hide and show app bar with animation flutter

Here is my code
return Scaffold(
body: SafeArea(
appBar:getIsShowAppBar(layoutProvider.currentIndex,
realEstatesProvider) ? AppBar (),
child: IndexedStack(
children: layoutProvider.screens,
index: layoutProvider.currentIndex),
),
bottomNavigationBar: BottomNavigationBar(), );
If you want to show an app bar and hide it when you want you would want to use the SliverAppBar widget witch allows you to make an app bar of your choice and allows to dissapear it when scrolling and other options with animations. https://api.flutter.dev/flutter/material/SliverAppBar-class.html

how to create draggable scrolling bottom sheet inside google maps scaffold in flutter?

I want to create a draggable scrolling bottom sheet like this!
here is the design
there will be a button on the top left to go back, there will be a button on the top left to go back, and there is a draggable bottom sheet should I use the stack?
please give me a hint if you have the best way to approach this problem, thank you!
Please refer to below plugin.
Snapping sheet
Snapping sheet provides a highly customizable sheet widget that snaps to different vertical & horizontal positions
This is exact what you need, sliding_up_panel:
#override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("SlidingUpPanelExample"),
),
body: SlidingUpPanel(
panel: Center(
child: Text("This is the sliding Widget"),
),
body: /* place your google map here */
),
);
}

How do I make bottomsheet swipe up from anywhere in scaffold flutter

I am trying to make a launcher in flutter, however I cannot figure out how to make a drawer that can be swiped up from the home screen, like in other launchers like nova or poco or many others. I understand that the app drawer closely matches a bottom sheet, but bottom sheets in flutter need to be first tapped on them and then dragged. How do I drag a widget up from anywhere on the scaffold?
To obtain the functionality you're looking for use this package: flutter slider
Example:
with code as simple as this you can obtain the slideup bottom sheet like functionality:
#override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("SlidingUpPanelExample"),
),
body: SlidingUpPanel(
panel: Center(
child: Text("This is the sliding Widget"),
),
body: Center(
child: Text("This is the Widget behind the sliding panel"),
),
),
);
}

How do I align these widgets?

I am making a practice app in flutter and stuck on this:
How can i align widgets such that;
1. An icon stays at extreme left of appbar
2. Text widget stays in middle.
3. button stays at extreme right of appbar.
here is the image for what i am talking about
use actions property in appbar and then as a child use a row. in that row you can use MainAxisAlignment.spaceBetween or MainAxisAlignment.spaceAround for arranging items.
You can do it using AppBar widget.
Note: If you want to implement drawer then use drawer property.
#override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Title"),
centerTitle: true,
leading: Icon(Icons.menu),
actions: [Icon(Icons.comment)],
),
body: Container(),
);
}
AppBar(title:Text("Your Text),leading:Icon(Icons.menu),actions:[Icon(Icons.favourite)])
Try this code