Display permanent Widget under AppBar in Flutter - flutter

I would like to implement small audio player controlls directly under the AppBar if an audio is playing. This can be seen in many apps like Telegram.
Example:
How to realize that in Flutter? The Player has to be displayed on all Screens! Like a permanent, sticky one widget.

You can use toolbarHeight on AppBar to get extra spaces, and place Column(any widget based on your need) on title.
appBar: AppBar(
toolbarHeight: 100,
title: Column(
children: [
Text("title"),
Row(
children: [Icon(Icons.ac_unit)],
)
],
),
),

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

Flutter - How to create a TabBar View with top bottom as the same levels as the tab

I have a TabBar that has form items in the view. that currently look like this.
as you can see the Cancel and Continue buttons are at the top. I used a Scalfold widget with an AppBar for those.
The problem is I want the continued bottom to align with the tabs. like this.
How can I get that desired result?
appBar: AppBar(
automaticallyImplyLeading: false,
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
YourFirstButton,
YourTabBar(),
YourSecondButton(),
],
),
),

FLUTTER: How to get widgets to flow on top while the keyboard appears?

I want to get widgets to flow on top while the keyboard appears, and here's the widget I have:
Scaffold(
resizeToAvoidBottomInset: false,
body: Stack(
children: [
Image.network('url'),
Column(
children: [
Text('Some text'),
SizedBox(height: 11),
Text('Some text'),
]
)
]
)
)
The result I want is to let the background image stays the same, so it stays under the keyboard, but while letting the column flow on top of the keyboard, so it will change its location as the keyboard showing and dismissing.
At rest:
After keyboard showed:
This is called a custom keyboard.
The plugin keyboard_actions can be customized for your needs: https://pub.dev/packages/keyboard_actions
Working way:
Surprisingly, by just wrapping the Column with a Padding widget and give it a padding of EdgeInsets.only(MediaQuery.of(context).viewInsets.bottom),
and also adding
mainAxisAlignment: MainAxisAlignment.end
to the Column did the trick! Easy solution~

Flutter Inherited Custom AppBar disappear on TextField tap

I'm using a custom appBar and a bottomNavigationBar in a Scaffold, per below code:
return Scaffold(
appBar: LogoAppBar(),
drawer: topDrawer(),
body: _pageOptions[_selectedTab],
bottomNavigationBar: BottomNavigationBar(...)
When I navigate via the BottomNavigationBar the custom AppBar sticks at the top of the new screen, just like I want it to.
However, when I navigate and thereafter tap on a TextField on the new screen to enter some text, the inherited AppBar automatically disappear (when the keyboard shows up).
The full code for this screen is rather long and therefore rather impractical to post here, but it basically boils down to the following:
return Scaffold(
backgroundColor: Colors.white,
body: Column(
children: [
Container(
Column(
children: [
DropDownButton(...),
TextField(...), // with a textSearchController
],
Expanded(
child: ListViewBuilder(...) // showing a list based on the search
Is there any way to make the AppBar from the inherited class stick without putting a new appBar in the Scaffold in the class I navigated to?
Try removing Scaffold as you are already calling it once in the main screen.
return Column(
children: [
Container(
Column(
children: [
DropDownButton(...),
TextField(...), // with a textSearchController
],
Expanded(
child: ListViewBuilder(...)
Ujjwal's suggestion was incredibly helpful. I removed the Scaffold and unfortunately the problem persisted, but it made me realize that I had also wrapped the LogoAppBar() code in a Scaffold. Once I removed the Scaffold from the LogoAppBar() it all worked!

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"),
),
),
);
}