2020-10-07 02:33:06 +06:30
|
|
|
import 'package:fcs/domain/vo/shipping_address.dart';
|
|
|
|
|
import 'package:fcs/pages/shipment_address/model/shipment_address_model.dart';
|
2020-09-15 07:13:41 +06:30
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
class ShippingAddressRow extends StatelessWidget {
|
|
|
|
|
final ShippingAddress shippingAddress;
|
|
|
|
|
final int index;
|
|
|
|
|
|
|
|
|
|
const ShippingAddressRow({Key key, this.shippingAddress, this.index})
|
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2020-10-07 02:33:06 +06:30
|
|
|
var shipmentAddressModel = Provider.of<ShipmentAddressModel>(context);
|
2020-09-15 07:13:41 +06:30
|
|
|
return Container(
|
|
|
|
|
padding: EdgeInsets.only(left: 10, right: 10),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: new Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
// Padding(
|
|
|
|
|
// padding: EdgeInsets.all(5.0),
|
|
|
|
|
// child: Icon(
|
|
|
|
|
// SimpleLineIcons.location_pin,
|
|
|
|
|
// color: primaryColor,
|
|
|
|
|
// )),
|
|
|
|
|
new Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0),
|
|
|
|
|
child: new Text(
|
|
|
|
|
shippingAddress.fullName == null
|
|
|
|
|
? ''
|
|
|
|
|
: shippingAddress.fullName,
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0),
|
|
|
|
|
child: new Text(
|
|
|
|
|
shippingAddress.addressLine1 == null
|
|
|
|
|
? ''
|
|
|
|
|
: shippingAddress.addressLine1,
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 14.0, color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0),
|
|
|
|
|
child: new Text(
|
|
|
|
|
shippingAddress.addressLine2 == null
|
|
|
|
|
? ''
|
|
|
|
|
: shippingAddress.addressLine2,
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 14.0, color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0),
|
|
|
|
|
child: new Text(
|
|
|
|
|
shippingAddress.city == null
|
|
|
|
|
? ''
|
|
|
|
|
: shippingAddress.city,
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 14.0, color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0),
|
|
|
|
|
child: new Text(
|
|
|
|
|
shippingAddress.state == null
|
|
|
|
|
? ''
|
|
|
|
|
: shippingAddress.state,
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 14.0, color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0),
|
|
|
|
|
child: new Text(
|
|
|
|
|
shippingAddress.phoneNumber == null
|
|
|
|
|
? ''
|
|
|
|
|
: "Phone:${shippingAddress.phoneNumber}",
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 14.0, color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// IconButton(
|
|
|
|
|
// padding: EdgeInsets.only(right: 30),
|
|
|
|
|
// icon: Icon(Icons.delete, color: Colors.black45),
|
|
|
|
|
// onPressed: null)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
index == null
|
|
|
|
|
? Container()
|
2020-10-07 02:33:06 +06:30
|
|
|
: index == shipmentAddressModel.shippingAddresses.length - 1
|
2020-09-15 07:13:41 +06:30
|
|
|
? Container()
|
|
|
|
|
: Divider(color: Colors.black)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|