You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
2.8 KiB
Dart
86 lines
2.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class MainWidget extends StatefulWidget {
|
|
@override
|
|
_MainWidgetState createState() => _MainWidgetState();
|
|
}
|
|
|
|
class _MainWidgetState extends State<MainWidget> {
|
|
List<Data> dataList = [];
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
dataList.add(Data(Colors.amber, 'Amelia Brown',
|
|
'Life would be a great deal easier if dead things had the decency to remain dead.'));
|
|
dataList.add(Data(Colors.orange, 'Olivia Smith',
|
|
'That proves you are unusual," returned the Scarecrow'));
|
|
dataList.add(Data(Colors.deepOrange, 'Sophia Jones',
|
|
'Her name badge read: Hello! My name is DIE, DEMIGOD SCUM!'));
|
|
dataList.add(Data(Colors.red, 'Isabella Johnson',
|
|
'I am about as intimidating as a butterfly.'));
|
|
dataList.add(Data(Colors.purple, 'Emily Taylor',
|
|
'Never ask an elf for help; they might decide your better off dead, eh?'));
|
|
dataList.add(Data(Colors.green, 'Maya Thomas', 'Act first, explain later'));
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ListView.separated(
|
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
|
itemBuilder: (buider, index) {
|
|
return LimitedBox(
|
|
maxHeight: 150,
|
|
child: Container(
|
|
decoration: new BoxDecoration(
|
|
color: dataList[index].color,
|
|
borderRadius: new BorderRadius.all(
|
|
const Radius.circular(10.0),
|
|
)),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Padding(
|
|
padding: const EdgeInsets.all(15),
|
|
child: Text(
|
|
dataList[index].name,
|
|
style: TextStyle(
|
|
fontFamily: 'BalsamiqSans_Blod',
|
|
fontSize: 30,
|
|
color: Colors.white),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.all(15),
|
|
child: Text(
|
|
dataList[index].detail,
|
|
style: TextStyle(
|
|
fontFamily: 'BalsamiqSans_Regular',
|
|
fontSize: 20,
|
|
color: Colors.white),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
);
|
|
},
|
|
separatorBuilder: (builder, index) {
|
|
return Divider(
|
|
height: 10,
|
|
thickness: 0,
|
|
);
|
|
},
|
|
itemCount: dataList.length);
|
|
}
|
|
}
|
|
|
|
class Data {
|
|
MaterialColor color;
|
|
String name;
|
|
String detail;
|
|
|
|
Data(this.color, this.name, this.detail);
|
|
}
|