87 lines
2.4 KiB
Dart
87 lines
2.4 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:intl/intl.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:fcs/model/chart_model.dart';
|
|
import 'package:fcs/fcs/common/helpers/theme.dart';
|
|
import 'package:fcs/vo/revenue.dart';
|
|
import 'package:fcs/widget/local_text.dart';
|
|
import 'package:fcs/widget/my_data_table.dart';
|
|
import 'package:fcs/widget/progress.dart';
|
|
|
|
class DeliveryDoSummaryDetail extends StatefulWidget {
|
|
const DeliveryDoSummaryDetail();
|
|
@override
|
|
_DeliveryDoSummaryDetailState createState() =>
|
|
_DeliveryDoSummaryDetailState();
|
|
}
|
|
|
|
class _DeliveryDoSummaryDetailState extends State<DeliveryDoSummaryDetail> {
|
|
final numberFormatter = new NumberFormat("#,###");
|
|
var dateFormatter = new DateFormat('dd MMM yyyy');
|
|
bool _isLoading = false;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var chartModel = Provider.of<ChartModel>(context);
|
|
|
|
return LocalProgress(
|
|
inAsyncCall: _isLoading,
|
|
child: Scaffold(
|
|
appBar: AppBar(
|
|
backgroundColor: primaryColor,
|
|
title: LocalText(
|
|
context,
|
|
'delivery.do.sum.counts',
|
|
color: Colors.white,
|
|
fontSize: 18,
|
|
),
|
|
),
|
|
body: Container(
|
|
padding: EdgeInsets.only(top: 10),
|
|
child: SingleChildScrollView(
|
|
scrollDirection: Axis.vertical,
|
|
child: SingleChildScrollView(
|
|
scrollDirection: Axis.horizontal,
|
|
padding: EdgeInsets.only(left: 20),
|
|
child: MyDataTable(
|
|
columnSpacing: 100,
|
|
columns: [
|
|
MyDataColumn(label: LocalText(context, "delivery.days")),
|
|
MyDataColumn(label: LocalText(context, "delivery.do.count")),
|
|
],
|
|
rows: getProductRow(chartModel.revenue.getDeliveryDoSummary()),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
List<MyDataRow> getProductRow(List<Data> doList) {
|
|
return doList.map((d) {
|
|
var r = MyDataRow(
|
|
cells: [
|
|
MyDataCell(
|
|
new Text(d.totalDay.toString(), style: textStyle),
|
|
),
|
|
MyDataCell(
|
|
new Text(
|
|
numberFormatter.format(d.totalCount),
|
|
style: textStyle,
|
|
),
|
|
),
|
|
],
|
|
);
|
|
|
|
return r;
|
|
}).toList();
|
|
}
|
|
}
|