File tree 1 file changed +58
-0
lines changed
1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change
1
+ import 'package:flutter/material.dart' ;
2
+
3
+ void main () {
4
+ runApp (new MyApp ());
5
+ }
6
+
7
+ class MyApp extends StatelessWidget {
8
+ @override
9
+ Widget build (BuildContext context) {
10
+ return new MaterialApp (home: new ButtonOptions ());
11
+ }
12
+ }
13
+
14
+ class ButtonOptions extends StatefulWidget {
15
+ @override
16
+ State <StatefulWidget > createState () {
17
+ return new ButtonOptionsState ();
18
+ }
19
+ }
20
+
21
+ class ButtonOptionsState extends State <ButtonOptions > {
22
+ @override
23
+ Widget build (BuildContext context) {
24
+ return new Scaffold (
25
+ appBar: new AppBar (
26
+ title: new Text ('First Screen' ),
27
+ ),
28
+ body: new Container (
29
+ height: 100.0 ,
30
+ child: new ListView .builder (
31
+ scrollDirection: Axis .horizontal,
32
+ shrinkWrap: true ,
33
+ physics: const ClampingScrollPhysics (),
34
+ itemCount: 10 ,
35
+ // itemExtent: 10.0,
36
+ // reverse: true, //makes the list appear in descending order
37
+ itemBuilder: (BuildContext context, int index) {
38
+ return _buildItems (index);
39
+ })));
40
+ }
41
+ }
42
+
43
+ Widget _buildItems (int index) {
44
+ return new Container (
45
+ // color: Colors.blue,
46
+ padding: const EdgeInsets .all (10.0 ),
47
+ child: new Row (
48
+ children: [
49
+ new Row (children: [
50
+ new RaisedButton (
51
+ child: new Text ("Hii" ),
52
+ onPressed: () {},
53
+ ),
54
+ ])
55
+ ],
56
+ ),
57
+ );
58
+ }
You can’t perform that action at this time.
0 commit comments