-
Notifications
You must be signed in to change notification settings - Fork 74
/
syncfusion_flutter_charts.dart
129 lines (125 loc) · 3.92 KB
/
syncfusion_flutter_charts.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import 'package:flutter/material.dart';
// ignore: depend_on_referenced_packages
import 'package:intl/intl.dart';
import 'model.dart';
class MySyncfusionFlutterCharts extends StatefulWidget {
const MySyncfusionFlutterCharts({Key? key}) : super(key: key);
@override
// ignore: library_private_types_in_public_api
_MySyncfusionFlutterChartsState createState() =>
_MySyncfusionFlutterChartsState();
}
class _MySyncfusionFlutterChartsState extends State<MySyncfusionFlutterCharts> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.deepPurple[100],
appBar: AppBar(title: const Text('Syncfusion Flutter Charts')),
body: ListView(
children: [
Padding(
padding: const EdgeInsets.all(20.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
buildContainer(5, "running\nbids", Colors.blue),
buildContainer(54, "completed\nbids", Colors.pink),
buildContainer(50230, "total amount\n(in BDT)", Colors.green),
],
),
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Container(
padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
),
],
),
child: const RunningBidsChart(),
),
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Container(
padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
),
],
),
child: const CompletedBidsChart(),
),
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Container(
padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
),
],
),
child: const TotalAmountChart(),
),
),
],
),
);
}
Container buildContainer(int num, String type, Color color) {
final oCcy = NumberFormat("#,##0", "en_US");
return Container(
padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
color: color,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 4,
blurRadius: 7,
),
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
oCcy.format(num),
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20.0,
color: Colors.white,
),
),
const SizedBox(height: 5.0),
Text(
type.toUpperCase(),
style: const TextStyle(color: Colors.white),
textAlign: TextAlign.center,
),
],
),
);
}
}