Created
May 8, 2020 14:46
-
-
Save becek2n/14bf42d8b76617b5ec66c5f6f32b4e21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class StepTwoView extends StatefulWidget { | |
StepTwoView({Key key}) : super(key: key); | |
@override | |
_StepTwoViewState createState() => _StepTwoViewState(); | |
} | |
class _StepTwoViewState extends State<StepTwoView>{ | |
Widget _myListView(BuildContext context) { | |
// backing data | |
final listData = ['Data 1', 'Data 2', 'Data 3', 'Data 4', 'Data 5', 'Data 6']; | |
return ListView.separated( | |
separatorBuilder: (context, index) => Divider( | |
color: Colors.black, | |
), | |
shrinkWrap: true, | |
itemCount: listData.length, | |
itemBuilder: (context, index) { | |
return ListTile( | |
title: Text(listData[index]), | |
); | |
}, | |
); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return Padding( | |
padding: const EdgeInsets.all(10.0), | |
child: Card(child: Column( | |
children: <Widget>[ | |
_myListView(context) | |
] | |
),) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment