-
Notifications
You must be signed in to change notification settings - Fork 6
/
fixed_extent_scroll_physics_example.dart
37 lines (35 loc) · 1.18 KB
/
fixed_extent_scroll_physics_example.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
import 'package:flutter/material.dart';
import 'package:flutter_tutorials/common/ui/widgets/bordered_container.dart';
class FixedExtentScrollPhysicsExample extends StatelessWidget {
static const String routeName = 'fixed-extent-scroll-physics-example';
final FixedExtentScrollController fixedExtentScrollController = FixedExtentScrollController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(
'FixedExtentScrollPhysics Example',
style: Theme.of(context).textTheme.subtitle1!.copyWith(color: Colors.white),
),
),
body: ListWheelScrollView(
controller: fixedExtentScrollController,
physics: const FixedExtentScrollPhysics(),
itemExtent: MediaQuery.of(context).size.height,
overAndUnderCenterOpacity: 0,
children: List.generate(
20,
(i) => BorderedContainer(
color: Colors.teal.withOpacity(0.3),
child: Center(
child: Text(
'List Item ${i + 1}',
style: Theme.of(context).textTheme.headline4,
),
),
),
),
),
);
}
}