-
Notifications
You must be signed in to change notification settings - Fork 0
/
Call.dart
56 lines (53 loc) · 1.82 KB
/
Call.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:works/Model/CallModel.dart';
class Call extends StatefulWidget {
const Call({super.key});
_CallState createState() => _CallState();
}
class _CallState extends State<Call> {
@override
Widget build(BuildContext context) {
return ListView.builder(
itemCount: callData != null ? callData.length : 0, // Add itemCount
itemBuilder: (context, i) {
if (callData == null || callData.isEmpty) {
return CircularProgressIndicator(); // Or any other widget to indicate loading or empty state
}
return Column(
children: <Widget>[
Divider(height: 0.1),
ListTile(
leading: CircleAvatar(
backgroundColor: Colors.grey,
backgroundImage: NetworkImage(callData[i].pic),
),
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
callData[i].name,
style:
TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold),
),
Icon(
(callData[i].name == 'kakashi Sensei' ||
callData[i].name == 'Shikamaru' ||
callData[i].name == 'Granny' ||
callData[i].name == 'Lee')
? Icons.call
: Icons.videocam,
)
],
),
subtitle: Text(
callData[i].time,
style: TextStyle(fontSize: 11.0, color: Colors.grey),
),
)
],
);
},
);
}
}