-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy_sliverappbar_screen.dart
73 lines (67 loc) · 2.33 KB
/
my_sliverappbar_screen.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import 'package:flutter/material.dart';
class MySliverAppBarScreen extends StatefulWidget {
@override
_MySliverAppBarScreenState createState() => _MySliverAppBarScreenState();
}
class _MySliverAppBarScreenState extends State<MySliverAppBarScreen> {
List<String> listSoccerPlayers;
@override
Widget build(BuildContext context) {
listSoccerPlayers = [];
listSoccerPlayers.add("Cristiano Ronaldo");
listSoccerPlayers.add("Lionel Messi");
listSoccerPlayers.add("Robert Lewandowski");
listSoccerPlayers.add("Neymar Jr.");
listSoccerPlayers.add("Kylian Mbappé");
listSoccerPlayers.add("Mohamed Salah");
listSoccerPlayers.add("Sadio Mane");
listSoccerPlayers.add("Kevin de Brune");
listSoccerPlayers.add("Antoine Griezmann");
listSoccerPlayers.add("Sergio Ramos");
listSoccerPlayers.add("Luis Surez");
return Scaffold(
body: CustomScrollView(
slivers: [
SliverAppBar(
expandedHeight: 200.0,
floating: false,
pinned: true,
elevation: 50,
flexibleSpace: FlexibleSpaceBar(
centerTitle: true,
title: Text("Soccer Players",
style: TextStyle(
color: Colors.white,
fontSize: 30,
)),
background: Image.network(
"https://wallpapercave.com/wp/wp139791.jpg",
fit: BoxFit.cover,
)),
),
SliverList(
delegate: SliverChildBuilderDelegate(
(context, index) => Column(
children: [
ListTile(
tileColor: Colors.white,
title: Center(
child: Text(listSoccerPlayers[index],
style: TextStyle(
fontWeight: FontWeight.normal,
fontSize: 40,
color: Colors.green) //TextStyle
), //Text
), //Center
),
Divider(height: 3,)
],
), //ListTile
childCount: 11,
), //SliverChildBuildDelegate
),
],
),
);
}
}