update carton and cargo type
This commit is contained in:
111
lib/pages/carton/package_detail_list.dart
Normal file
111
lib/pages/carton/package_detail_list.dart
Normal file
@@ -0,0 +1,111 @@
|
||||
import 'package:fcs/domain/entities/package.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/package/package_info.dart';
|
||||
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../widgets/local_text.dart';
|
||||
|
||||
class PackageDetailList extends StatelessWidget {
|
||||
final String cartonNumber;
|
||||
final List<Package> packages;
|
||||
PackageDetailList(
|
||||
{super.key, required this.cartonNumber, required this.packages});
|
||||
|
||||
final NumberFormat numberFormatter = NumberFormat("#,###");
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: LocalAppBar(
|
||||
backgroundColor: Colors.white,
|
||||
arrowColor: primaryColor,
|
||||
labelColor: primaryColor,
|
||||
titleWidget: Column(
|
||||
children: [
|
||||
LocalText(
|
||||
context,
|
||||
"box.package.count",
|
||||
fontSize: 20,
|
||||
color: primaryColor,
|
||||
translationVariables: [numberFormatter.format(packages.length)],
|
||||
),
|
||||
Text(cartonNumber,
|
||||
style: TextStyle(fontSize: 15, color: Colors.black))
|
||||
],
|
||||
),
|
||||
),
|
||||
body: ListView.separated(
|
||||
separatorBuilder: (context, index) =>
|
||||
Divider(height: 1, color: dividerColor),
|
||||
itemCount: packages.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var package = packages[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => PackageInfo(package: package)),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 15, right: 15),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Icon(Octicons.package, color: primaryColor),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 15),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
package.id == null
|
||||
? ''
|
||||
: package.trackingID!,
|
||||
style: TextStyle(
|
||||
fontSize: 15.0,
|
||||
color: Colors.black),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
package.market == null
|
||||
? ''
|
||||
: package.market!,
|
||||
style: TextStyle(
|
||||
fontSize: 15.0,
|
||||
color: Colors.grey),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user