Hi Guys I locking for create app bar Like this with SliverAppBar()
widget Like this :
And I Tried to make it With SliverAppBar()
But The output is like this :
Here is Code :
Scaffold(
drawer: const Drawer(),
body: CustomScrollView(
slivers: [
SliverAppBar(
pinned: true,
elevation: 0,
backgroundColor: Colors.grey.shade200,
title: Text(
"All notes",
style: AppStyle.normalTextStyle
.copyWith(fontWeight: FontWeight.w600),
),
actions: [
IconButton(
onPressed: () => Get.to(() => SearchBar(notes: notes)),
icon: const Icon(Icons.search)),
IconButton(
onPressed: () {},
icon: const Icon(Icons.more_vert_outlined))
],
expandedHeight: 200,
flexibleSpace: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(height: 80),
Text(
"All notes",
style: AppStyle.largeTextStyle
.copyWith(fontWeight: FontWeight.w600),
),
const SizedBox(height: 10),
Text(
"${notes.length} notes",
style: AppStyle.smallTextStyle
.copyWith(fontWeight: FontWeight.w400),
),
],
),
),
SliverToBoxAdapter(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 16),
child: GridView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
primary: false,
gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(
mainAxisExtent: 170,
crossAxisCount: 2,
),
itemCount: notes.length,
itemBuilder: (context, index) {
final note = notes[index];
return GestureDetector(
onTap: () =>
Get.to(() => DetailsScreen(id: note.id)),
child: BaseContainer(note: note));
},
)),
),
],
),
floatingActionButton: SizedBox(
height: 65,
width: 65,
child: FloatingActionButton(
tooltip: 'Add note',
child: const Icon(
Icons.add,
size: 30,
),
onPressed: () => Get.to(() => const AddScreen()),
),
),
);
So how can I reverse SliverAppBar()
when it's scrolling just like a first video ?
and second question is how can I remove that All notes
text when it's scrolling and replace it with Large one just like first Video ..
if it possible to create that appBar like the first video (Samsung notes appBar) except SliverAppBar()
please let me know .