add structure
This commit is contained in:
85
lib/charts/delivery_do_line_detail.dart
Normal file
85
lib/charts/delivery_do_line_detail.dart
Normal file
@@ -0,0 +1,85 @@
|
||||
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/theme/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 DODeliveryLineDetail extends StatefulWidget {
|
||||
const DODeliveryLineDetail();
|
||||
@override
|
||||
_DODeliveryLineDetailState createState() => _DODeliveryLineDetailState();
|
||||
}
|
||||
|
||||
class _DODeliveryLineDetailState extends State<DODeliveryLineDetail> {
|
||||
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.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.date")),
|
||||
MyDataColumn(label: LocalText(context, "delivery.do.count")),
|
||||
],
|
||||
rows: getProductRow(chartModel.revenue.getDeliveryDo()),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<MyDataRow> getProductRow(List<Data> doList) {
|
||||
return doList.map((d) {
|
||||
var r = MyDataRow(
|
||||
cells: [
|
||||
MyDataCell(
|
||||
new Text(dateFormatter.format(d.date), style: textStyle),
|
||||
),
|
||||
MyDataCell(
|
||||
new Text(
|
||||
numberFormatter.format(d.count),
|
||||
style: textStyle,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
return r;
|
||||
}).toList();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user