Files
fcs/lib/pages/rates/custom_row.dart

64 lines
1.9 KiB
Dart
Raw Normal View History

2020-10-15 03:06:13 +06:30
import 'package:fcs/domain/entities/custom_duty.dart';
2020-10-14 20:56:46 +06:30
import 'package:fcs/domain/vo/delivery_address.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
2020-10-15 03:06:13 +06:30
typedef SelectionCallback(CustomDuty custom);
2020-10-14 20:56:46 +06:30
class CustomRow extends StatelessWidget {
2020-10-15 03:06:13 +06:30
final CustomDuty custom;
2021-09-10 12:02:08 +06:30
final SelectionCallback? selectionCallback;
const CustomRow({Key? key, required this.custom, this.selectionCallback})
2020-10-14 20:56:46 +06:30
: super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
onTap: selectionCallback == null
? null
2021-09-10 12:02:08 +06:30
: () => this.selectionCallback!(custom),
2020-10-14 20:56:46 +06:30
child: Row(
children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
line(context, custom.productType,
iconData: MaterialCommunityIcons.account,
color: primaryColor,
fontSize: 16),
line(context, custom.fee.toString(),
iconData: Icons.phone, color: primaryColor, fontSize: 16),
],
),
),
],
),
);
}
2021-09-10 12:02:08 +06:30
Widget line(BuildContext context, String? text,
{IconData? iconData, Color? color, double? fontSize}) {
2020-10-14 20:56:46 +06:30
return Row(
children: [
iconData == null
? SizedBox(width: 40)
: Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8),
child: Icon(iconData, color: Colors.black38),
),
Flexible(
child: TextLocalStyle(
context,
text ?? "",
fontSize: fontSize ?? 14,
2021-09-10 12:02:08 +06:30
color: color ?? Colors.grey,
2020-10-14 20:56:46 +06:30
),
),
],
);
}
}