-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbasic_sliver_app_bar.dart
50 lines (48 loc) · 1.41 KB
/
basic_sliver_app_bar.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import 'package:flutter/material.dart';
import 'package:flutter_ui_source/sliver_grid.dart';
class BasicSliverAppBar extends StatelessWidget {
const BasicSliverAppBar({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: CustomScrollView(
slivers: [
SliverAppBar(
backgroundColor: Colors.amber,
leading: IconButton(
onPressed: () {},
icon: const Icon(
Icons.arrow_back,
color: Colors.white,
),
),
actions: [
IconButton(
onPressed: () {},
icon: const Icon(
Icons.settings,
color: Colors.white,
),
),
],
expandedHeight: 250,
floating: true,
pinned: true,
flexibleSpace: FlexibleSpaceBar(
title: const Text(
'Basic Sliver',
),
centerTitle: true,
background: Image.network(
'https://images.pexels.com/photos/4126318/pexels-photo-4126318.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',
fit: BoxFit.cover,
),
collapseMode: CollapseMode.pin,
),
),
const SliverGridWidget(),
],
),
);
}
}