|
|
|
|
|
|
|
|
|
|
List<List<string>> randomizedContacts; |
|
|
|
|
|
|
|
public override void initState() { |
|
|
|
public override void initState() |
|
|
|
{ |
|
|
|
|
|
|
|
void repopulateList() { |
|
|
|
void repopulateList() |
|
|
|
{ |
|
|
|
//List<string> nullStr = new List<string>();//{" "};
|
|
|
|
randomizedContacts = new List<List<string>>(); |
|
|
|
|
|
|
|
for (int index = 0; index < 100; index++ ){ |
|
|
|
contacts[random.Next()].Add(random.Next()%2 == 0 ? true.ToString() : false.ToString()); |
|
|
|
randomizedContacts.Add(contacts[random.Next()]); |
|
|
|
|
|
|
|
for (int index = 0; index < 100; index++ ) |
|
|
|
{ |
|
|
|
var id = random.Next(contacts.Count); |
|
|
|
if (id < contacts.Count) |
|
|
|
{ |
|
|
|
contacts[id].Add(id % 2 == 0 ? true.ToString() : false.ToString()); |
|
|
|
randomizedContacts.Add(new List<string>()); |
|
|
|
for (int i = 0; i < 4; i++) |
|
|
|
{ |
|
|
|
randomizedContacts[index].Add(contacts[id][i]); |
|
|
|
} |
|
|
|
} |
|
|
|
_ListItem getListItem(int index) |
|
|
|
{ |
|
|
|
if (index < randomizedContacts.Count && index > 0 ) |
|
|
|
{ |
|
|
|
return new _ListItem( |
|
|
|
name: randomizedContacts[index][0], |
|
|
|
place: randomizedContacts[index][1], |
|
|
|
date: randomizedContacts[index][2], |
|
|
|
called: randomizedContacts[index][3] == "true" |
|
|
|
); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
return new _ListItem(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
previousPageTitle: "Cupertino" |
|
|
|
//trailing: CupertinoDemoDocumentationButton(CupertinoRefreshControlDemo.routeName),
|
|
|
|
), |
|
|
|
|
|
|
top: false, // Top safe area is consumed by the navigation bar.
|
|
|
|
sliver: new SliverList( |
|
|
|
del: new SliverChildBuilderDelegate( |
|
|
|
(BuildContext context1, int index)=> { |
|
|
|
return new _ListItem( |
|
|
|
name: randomizedContacts[index][0], |
|
|
|
place: randomizedContacts[index][1], |
|
|
|
date: randomizedContacts[index][2], |
|
|
|
called: randomizedContacts[index][3] == "true" |
|
|
|
); |
|
|
|
(BuildContext context1, int index)=> |
|
|
|
{ |
|
|
|
return getListItem(index); |
|
|
|
}, |
|
|
|
childCount: 20 |
|
|
|
) |
|
|
|
|
|
|
string name = null, |
|
|
|
string place = null, |
|
|
|
string date = null, |
|
|
|
bool? called = null |
|
|
|
bool called = false |
|
|
|
) |
|
|
|
{ |
|
|
|
this.name = name; |
|
|
|
|
|
|
public readonly string name; |
|
|
|
public readonly string place; |
|
|
|
public readonly string date; |
|
|
|
public readonly bool? called; |
|
|
|
public readonly bool called; |
|
|
|
|
|
|
|
public override Widget build(BuildContext context) { |
|
|
|
return new Container( |
|
|
|
|
|
|
children: new List<Widget>{ |
|
|
|
new Container( |
|
|
|
width: 38.0f, |
|
|
|
child: (bool)called |
|
|
|
child: called |
|
|
|
? new Align( |
|
|
|
alignment: Alignment.topCenter, |
|
|
|
child: new Icon( |
|
|
|
|
|
|
) |
|
|
|
: null |
|
|
|
), |
|
|
|
new Expanded( |
|
|
|
child: new Container( |
|
|
|
new Expanded( |
|
|
|
child: new Container( |
|
|
|
decoration: new BoxDecoration( |
|
|
|
border: new Border( |
|
|
|
bottom: new BorderSide(color: new Color(0xFFBCBBC1), width: 0.0f) |
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
children: new List<Widget>{ |
|
|
|
new Text( |
|
|
|
name, |
|
|
|
name ?? "", |
|
|
|
maxLines: 1, |
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
style: new TextStyle( |
|
|
|
|
|
|
), |
|
|
|
new Text( |
|
|
|
place, |
|
|
|
place ?? "", |
|
|
|
maxLines: 1, |
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
style: new TextStyle( |
|
|
|
|
|
|
) |
|
|
|
), |
|
|
|
new Text( |
|
|
|
date, |
|
|
|
date ?? "", |
|
|
|
style: new TextStyle( |
|
|
|
color: CupertinoColors.inactiveGray.resolveFrom(context), |
|
|
|
fontSize: 15.0f, |
|
|
|