Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisSize: MainAxisSize.min,
- children: [
- Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- SizedBox(
- width: 100.w,
- child: Text(
- 'Harga Jual',
- style: context.textTheme.titleSmall!
- .copyWith(
- color: AccurateColor.black50),
- ),
- ),
- Expanded(
- child: Row(
- children: [
- Expanded(
- flex: 7,
- child: OneFormComponentNumeric(
- formCtr: _sellingPriceCtr,
- focusNode: _sellingPriceNode,
- isUseOutlineBorder: true,
- maxLines: 1,
- textInputType: const TextInputType
- .numberWithOptions(),
- hintText: 'Rp.0',
- inputFormatter: [
- RupiahInputFormatter()
- ],
- onChanged: (p0) {
- _hitCalculateDetail();
- return;
- },
- ),
- ),
- SizedBox(width: 8.w),
- Container(
- alignment: Alignment.centerRight,
- child: GestureDetector(
- onTap: () {
- context
- .read<
- ProductStockSalePriceHistoryCubit>()
- .getSalePriceHistory(
- id: item.itemId!,
- customerId:
- _customerChoosenData
- .id!,
- );
- },
- child: Icon(
- Icons.restore,
- color:
- AccurateColor.blueAccurate,
- size: 27.r,
- ),
- ),
- ),
- ],
- ),
- ),
- ],
- ),
- SizedBox(height: 4.h),
- Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- SizedBox(
- width: 100.w,
- child: Text(
- 'Diskon',
- style: context.textTheme.titleSmall!,
- ),
- ),
- Expanded(
- child: Row(
- children: [
- Expanded(
- 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;
- },
- ),
- ),
- SizedBox(width: 8.w),
- Expanded(
- 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