Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Text(
- 'Harga Jual',
- style: context.textTheme.titleSmall!
- .copyWith(color: AccurateColor.black50),
- ),
- const SpaceComponentWidth(),
- Flexible(
- flex: 3,
- child: OneFormComponentNumeric(
- formCtr: _sellingPriceCtr,
- focusNode: _sellingPriceNode,
- isUseOutlineBorder: true,
- maxLines: 1,
- textInputType:
- const TextInputType.numberWithOptions(),
- hintText: 'Rp.0',
- inputFormatter: [RupiahInputFormatter()],
- onChanged: (p0) {
- _hitCalculateDetail();
- return;
- },
- ),
- ),
- Flexible(
- child: GestureDetector(
- onTap: () {
- context
- .read<
- ProductStockSalePriceHistoryCubit>()
- .getSalePriceHistory(
- id: item.itemId!,
- customerId:
- _customerChoosenData.id!,
- );
- },
- child: Column(
- children: [
- const SpaceComponentHeight(),
- Icon(
- Icons.restore,
- color: AccurateColor.blueAccurate,
- size: 27.r,
- ),
- ],
- ),
- ),
- ),
- ],
- ),
- const SpaceComponentHeight(),
- IntrinsicHeight(
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment:
- MainAxisAlignment.spaceBetween,
- children: [
- Center(
- child: Text(
- 'Diskon',
- style: context.textTheme.titleSmall!,
- ),
- ),
- SpaceComponentWidth(width: 40.w),
- Flexible(
- flex: 1,
- child: OneFormComponentNumeric(
- formCtr: _discountPercentCtr,
- focusNode: _discountPercentNode,
- isUseOutlineBorder: true,
- maxLines: 1,
- textInputType:
- const TextInputType.numberWithOptions(
- decimal: true,
- signed: true,
- ),
- hintText: '0%',
- inputFormatter: [
- PercentageInputFormatter()
- ],
- onChanged: (_) => int.parse(
- _discountPercentCtr.text
- .replaceAll('%', ''),
- ) <=
- 100
- ? _hitCalculateDetail()
- : null,
- validator: (value) {
- if (value != null && value.isNotEmpty) {
- if (int.parse(
- value.replaceAll('%', '')) >
- 100) {
- return 'Maksimal diskon 100%';
- }
- }
- return null;
- },
- ),
- ),
- SpaceComponentWidth(width: 8.w),
- Flexible(
- flex: 2,
- child: OneFormComponentNumeric(
- formCtr: _discountRupiahCtr,
- focusNode: _discountRupiahNode,
- isUseOutlineBorder: true,
- maxLines: 1,
- textInputType: const TextInputType
- .numberWithOptions(),
- hintText: 'Rp.0',
- inputFormatter: [RupiahInputFormatter()],
- onChanged: (_) {
- _discountPercentCtr.clear();
- _hitCalculateDetail();
- return null;
- },
- validator: (value) {
- if (rupiahToDouble(value!) >
- rupiahToDouble(_totalPrice.value)) {
- return 'Diskon melebihi total';
- }
- return null;
- },
- ),
- ),
- ],
- ),
- ),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement