update data table
This commit is contained in:
@@ -22,25 +22,26 @@ class _CargoTableState extends State<CargoTable> {
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: MyDataTable(
|
||||
child: DataTable(
|
||||
headingRowHeight: 40,
|
||||
columnSpacing: 50,
|
||||
showCheckboxColumn: false,
|
||||
columns: [
|
||||
MyDataColumn(
|
||||
DataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"cargo.type",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
MyDataColumn(
|
||||
DataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"cargo.qty",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
MyDataColumn(
|
||||
DataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"cargo.weight",
|
||||
@@ -53,21 +54,21 @@ class _CargoTableState extends State<CargoTable> {
|
||||
);
|
||||
}
|
||||
|
||||
List<MyDataRow> getCargoRows(BuildContext context) {
|
||||
List<DataRow> getCargoRows(BuildContext context) {
|
||||
if (widget.cargoTypes == null) {
|
||||
return [];
|
||||
}
|
||||
double total = 0;
|
||||
var rows = widget.cargoTypes!.map((c) {
|
||||
total += c.weight;
|
||||
return MyDataRow(
|
||||
onSelectChanged: (bool selected) async {},
|
||||
return DataRow(
|
||||
onSelectChanged: (bool? selected) async {},
|
||||
cells: [
|
||||
MyDataCell(new Text(
|
||||
DataCell(new Text(
|
||||
c.name ?? "",
|
||||
style: textStyle,
|
||||
)),
|
||||
MyDataCell(c.qty == null || c.qty == 0
|
||||
DataCell(c.qty == null || c.qty == 0
|
||||
? Center(
|
||||
child: Text(
|
||||
"-",
|
||||
@@ -80,7 +81,7 @@ class _CargoTableState extends State<CargoTable> {
|
||||
style: textStyle,
|
||||
),
|
||||
)),
|
||||
MyDataCell(
|
||||
DataCell(
|
||||
Text(c.weight == null ? "0" : c.weight.toStringAsFixed(2),
|
||||
style: textStyle),
|
||||
),
|
||||
@@ -88,10 +89,10 @@ class _CargoTableState extends State<CargoTable> {
|
||||
);
|
||||
}).toList();
|
||||
|
||||
var totalRow = MyDataRow(
|
||||
onSelectChanged: (bool selected) {},
|
||||
var totalRow = DataRow(
|
||||
onSelectChanged: (bool? selected) {},
|
||||
cells: [
|
||||
MyDataCell(Align(
|
||||
DataCell(Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: LocalText(
|
||||
context,
|
||||
@@ -100,8 +101,8 @@ class _CargoTableState extends State<CargoTable> {
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
)),
|
||||
MyDataCell(Text("")),
|
||||
MyDataCell(
|
||||
DataCell(Text("")),
|
||||
DataCell(
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 48.0),
|
||||
child: Align(
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/dialog_input.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/my_data_table.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -45,25 +44,26 @@ class _CargoTableState extends State<CargoTable> {
|
||||
|
||||
return SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: MyDataTable(
|
||||
child: DataTable(
|
||||
showCheckboxColumn: false,
|
||||
headingRowHeight: 40,
|
||||
columnSpacing: 40,
|
||||
columns: [
|
||||
MyDataColumn(
|
||||
DataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"cargo.type",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
MyDataColumn(
|
||||
DataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"cargo.qty",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
MyDataColumn(
|
||||
DataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"cargo.weight",
|
||||
@@ -76,21 +76,21 @@ class _CargoTableState extends State<CargoTable> {
|
||||
);
|
||||
}
|
||||
|
||||
List<MyDataRow> getCargoRows(BuildContext context) {
|
||||
List<DataRow> getCargoRows(BuildContext context) {
|
||||
if (cargoTypes == null) {
|
||||
return [];
|
||||
}
|
||||
var rows = cargoTypes!.map((c) {
|
||||
return MyDataRow(
|
||||
onSelectChanged: (bool selected) async {},
|
||||
return DataRow(
|
||||
onSelectChanged: (bool? selected) async {},
|
||||
cells: [
|
||||
MyDataCell(
|
||||
DataCell(
|
||||
new Text(
|
||||
c.name ?? '',
|
||||
style: textStyle,
|
||||
),
|
||||
),
|
||||
MyDataCell(
|
||||
DataCell(
|
||||
c.isCutomDuty!
|
||||
? GestureDetector(
|
||||
onTap: () async {
|
||||
@@ -128,7 +128,7 @@ class _CargoTableState extends State<CargoTable> {
|
||||
),
|
||||
),
|
||||
),
|
||||
MyDataCell(
|
||||
DataCell(
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@@ -185,10 +185,10 @@ class _CargoTableState extends State<CargoTable> {
|
||||
);
|
||||
}).toList();
|
||||
|
||||
var totalRow = MyDataRow(
|
||||
onSelectChanged: (bool selected) {},
|
||||
var totalRow = DataRow(
|
||||
onSelectChanged: (bool? selected) {},
|
||||
cells: [
|
||||
MyDataCell(Align(
|
||||
DataCell(Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: LocalText(
|
||||
context,
|
||||
@@ -197,8 +197,8 @@ class _CargoTableState extends State<CargoTable> {
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
)),
|
||||
MyDataCell(Text("")),
|
||||
MyDataCell(
|
||||
DataCell(Text("")),
|
||||
DataCell(
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 48.0),
|
||||
child: Align(
|
||||
|
||||
@@ -28,17 +28,18 @@ class _CargoTableState extends State<CargoTable> {
|
||||
double remainingWeight = 0;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyDataTable(
|
||||
return DataTable(
|
||||
headingRowHeight: 40,
|
||||
showCheckboxColumn: false,
|
||||
columns: [
|
||||
MyDataColumn(
|
||||
DataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"cargo.type",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
MyDataColumn(
|
||||
DataColumn(
|
||||
label: Row(
|
||||
children: [
|
||||
Container(
|
||||
@@ -57,7 +58,7 @@ class _CargoTableState extends State<CargoTable> {
|
||||
);
|
||||
}
|
||||
|
||||
List<MyDataRow> getCargoRows(BuildContext context) {
|
||||
List<DataRow> getCargoRows(BuildContext context) {
|
||||
if (widget.cargoTypes == null) {
|
||||
return [];
|
||||
}
|
||||
@@ -67,10 +68,10 @@ class _CargoTableState extends State<CargoTable> {
|
||||
|
||||
var rows = widget.cargoTypes!.map((c) {
|
||||
_total += c.weight;
|
||||
return MyDataRow(
|
||||
onSelectChanged: (bool selected) async {},
|
||||
return DataRow(
|
||||
onSelectChanged: (bool? selected) async {},
|
||||
cells: [
|
||||
MyDataCell(Row(
|
||||
DataCell(Row(
|
||||
children: [
|
||||
new Text(
|
||||
c.name ?? "",
|
||||
@@ -82,7 +83,7 @@ class _CargoTableState extends State<CargoTable> {
|
||||
),
|
||||
],
|
||||
)),
|
||||
MyDataCell(
|
||||
DataCell(
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
@@ -106,10 +107,10 @@ class _CargoTableState extends State<CargoTable> {
|
||||
);
|
||||
}).toList();
|
||||
|
||||
var totalRow = MyDataRow(
|
||||
onSelectChanged: (bool selected) {},
|
||||
var totalRow = DataRow(
|
||||
onSelectChanged: (bool? selected) {},
|
||||
cells: [
|
||||
MyDataCell(Align(
|
||||
DataCell(Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: LocalText(
|
||||
context,
|
||||
@@ -118,7 +119,7 @@ class _CargoTableState extends State<CargoTable> {
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
)),
|
||||
MyDataCell(
|
||||
DataCell(
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 40.0),
|
||||
child: Align(
|
||||
@@ -144,7 +145,8 @@ class _CargoTableState extends State<CargoTable> {
|
||||
widget.cargoTypes!.forEach((c) {
|
||||
_types.add(c.name!);
|
||||
});
|
||||
if (this._cargos.length == widget.cargoTypes!.length - 1) {
|
||||
if (this._cargos.length ==
|
||||
widget.cargoTypes!.length - 1) {
|
||||
_types.forEach((t) {
|
||||
if (!_list.contains(t)) {
|
||||
widget.cargoTypes!.forEach((c) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:fcs/domain/entities/discount.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/my_data_table.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -37,17 +36,18 @@ class InvoiceDiscountList extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget table(BuildContext context) {
|
||||
return MyDataTable(
|
||||
return DataTable(
|
||||
headingRowHeight: 40,
|
||||
showCheckboxColumn: false,
|
||||
columns: [
|
||||
MyDataColumn(
|
||||
DataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"discount.code",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
MyDataColumn(
|
||||
DataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"discount.amount",
|
||||
@@ -59,19 +59,19 @@ class InvoiceDiscountList extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
List<MyDataRow> getRows(BuildContext context) {
|
||||
List<DataRow> getRows(BuildContext context) {
|
||||
if (discounts == null) {
|
||||
return [];
|
||||
}
|
||||
var rows = discounts!.map((c) {
|
||||
return MyDataRow(
|
||||
return DataRow(
|
||||
onSelectChanged: (value) => Navigator.pop(context, c),
|
||||
cells: [
|
||||
MyDataCell(new Text(
|
||||
DataCell(new Text(
|
||||
c?.code ?? '',
|
||||
style: textStyle,
|
||||
)),
|
||||
MyDataCell(
|
||||
DataCell(
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:fcs/domain/entities/shipment.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/my_data_table.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -41,17 +40,18 @@ class InvoiceHandlingFeeList extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget table(BuildContext context) {
|
||||
return MyDataTable(
|
||||
return DataTable(
|
||||
headingRowHeight: 40,
|
||||
showCheckboxColumn: false,
|
||||
columns: [
|
||||
MyDataColumn(
|
||||
DataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"invoice.shipment.number",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
MyDataColumn(
|
||||
DataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"invoice.add.handling.fee.menu",
|
||||
@@ -63,19 +63,19 @@ class InvoiceHandlingFeeList extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
List<MyDataRow> getRows(BuildContext context) {
|
||||
List<DataRow> getRows(BuildContext context) {
|
||||
if (shipments == null) {
|
||||
return [];
|
||||
}
|
||||
var rows = shipments!.map((c) {
|
||||
return MyDataRow(
|
||||
return DataRow(
|
||||
onSelectChanged: (value) => Navigator.pop(context, c),
|
||||
cells: [
|
||||
MyDataCell(new Text(
|
||||
DataCell(new Text(
|
||||
c!.shipmentNumber!,
|
||||
style: textStyle,
|
||||
)),
|
||||
MyDataCell(
|
||||
DataCell(
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
|
||||
@@ -13,7 +13,6 @@ import 'package:fcs/pages/widgets/length_picker.dart';
|
||||
import 'package:fcs/pages/widgets/local_button.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_title.dart';
|
||||
import 'package:fcs/pages/widgets/my_data_table.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -160,17 +159,18 @@ class _ShipmentBoxEditorState extends State<ShipmentBoxEditor> {
|
||||
_addCargo(cargo);
|
||||
}),
|
||||
),
|
||||
MyDataTable(
|
||||
DataTable(
|
||||
headingRowHeight: 40,
|
||||
showCheckboxColumn: false,
|
||||
columns: [
|
||||
MyDataColumn(
|
||||
DataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"cargo.type",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
MyDataColumn(
|
||||
DataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"cargo.weight",
|
||||
@@ -211,15 +211,15 @@ class _ShipmentBoxEditorState extends State<ShipmentBoxEditor> {
|
||||
);
|
||||
}
|
||||
|
||||
List<MyDataRow> getCargoRows(BuildContext context) {
|
||||
List<DataRow> getCargoRows(BuildContext context) {
|
||||
if (_box!.cargoTypes == null) {
|
||||
return [];
|
||||
}
|
||||
double total = 0;
|
||||
var rows = _box!.cargoTypes.map((c) {
|
||||
total += c.weight;
|
||||
return MyDataRow(
|
||||
onSelectChanged: (bool selected) async {
|
||||
return DataRow(
|
||||
onSelectChanged: (bool? selected) async {
|
||||
CargoType? cargo = await Navigator.push<CargoType>(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
@@ -230,11 +230,11 @@ class _ShipmentBoxEditorState extends State<ShipmentBoxEditor> {
|
||||
_addCargo(cargo);
|
||||
},
|
||||
cells: [
|
||||
MyDataCell(new Text(
|
||||
DataCell(new Text(
|
||||
c.name == null ? "" : c.name!,
|
||||
style: textStyle,
|
||||
)),
|
||||
MyDataCell(
|
||||
DataCell(
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
@@ -254,10 +254,10 @@ class _ShipmentBoxEditorState extends State<ShipmentBoxEditor> {
|
||||
);
|
||||
}).toList();
|
||||
|
||||
var totalRow = MyDataRow(
|
||||
onSelectChanged: (bool selected) {},
|
||||
var totalRow = DataRow(
|
||||
onSelectChanged: (bool? selected) {},
|
||||
cells: [
|
||||
MyDataCell(Align(
|
||||
DataCell(Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: LocalText(
|
||||
context,
|
||||
@@ -266,7 +266,7 @@ class _ShipmentBoxEditorState extends State<ShipmentBoxEditor> {
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
)),
|
||||
MyDataCell(
|
||||
DataCell(
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 48.0),
|
||||
child: Align(
|
||||
|
||||
Reference in New Issue
Block a user