|
|
|
|
@ -51,17 +51,19 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
ListView(
|
|
|
|
|
padding: const EdgeInsets.only(left: 21, right: 21, bottom: 21),
|
|
|
|
|
children: [
|
|
|
|
|
"Add details".toText20(isBold: true).paddingOnly(top: 24, left: 21, right: 21),
|
|
|
|
|
LocaleKeys.addDetails.tr().toText20(),
|
|
|
|
|
12.height,
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
DynamicTextFieldWidget(
|
|
|
|
|
"Title",
|
|
|
|
|
itemTitle.isEmpty ? "Item title" : itemTitle,
|
|
|
|
|
LocaleKeys.title.tr(),
|
|
|
|
|
itemTitle.isEmpty ? LocaleKeys.itemTitle.tr() : itemTitle,
|
|
|
|
|
isEnable: true,
|
|
|
|
|
suffixIconData: Icons.search,
|
|
|
|
|
isPopup: false,
|
|
|
|
|
@ -71,10 +73,10 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
|
|
|
|
|
onChange: (String value) {
|
|
|
|
|
itemTitle = value;
|
|
|
|
|
},
|
|
|
|
|
).paddingOnly(),
|
|
|
|
|
),
|
|
|
|
|
DynamicTextFieldWidget(
|
|
|
|
|
"Description",
|
|
|
|
|
itemDescription.isEmpty ? "Item description" : itemDescription,
|
|
|
|
|
LocaleKeys.description.tr(),
|
|
|
|
|
itemDescription.isEmpty ? LocaleKeys.itemDescription.tr() : itemDescription,
|
|
|
|
|
isEnable: true,
|
|
|
|
|
suffixIconData: Icons.search,
|
|
|
|
|
isPopup: false,
|
|
|
|
|
@ -85,15 +87,15 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
|
|
|
|
|
itemDescription = value;
|
|
|
|
|
},
|
|
|
|
|
).paddingOnly(top: 12),
|
|
|
|
|
"Item Condition".toText14(isBold: true).paddingOnly(top: 21),
|
|
|
|
|
LocaleKeys.itemCondition.tr().toText14().paddingOnly(top: 21),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
ShowRadio(title: "New", value: "new", groupValue: selectedItemCondition, selectedColor: MyColors.gradiantStartColor).onPress(() {
|
|
|
|
|
ShowRadio(title: LocaleKeys.newString.tr(), value: "new", groupValue: selectedItemCondition, selectedColor: MyColors.gradiantStartColor).onPress(() {
|
|
|
|
|
selectedItemCondition = "new";
|
|
|
|
|
setState(() {});
|
|
|
|
|
}),
|
|
|
|
|
12.width,
|
|
|
|
|
ShowRadio(title: "Used", value: "used", groupValue: selectedItemCondition, selectedColor: MyColors.gradiantStartColor).onPress(() {
|
|
|
|
|
ShowRadio(title: LocaleKeys.used.tr(), value: "used", groupValue: selectedItemCondition, selectedColor: MyColors.gradiantStartColor).onPress(() {
|
|
|
|
|
selectedItemCondition = "used";
|
|
|
|
|
setState(() {});
|
|
|
|
|
}),
|
|
|
|
|
@ -101,8 +103,8 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
|
|
|
|
|
).paddingOnly(top: 12),
|
|
|
|
|
PopupMenuButton(
|
|
|
|
|
child: DynamicTextFieldWidget(
|
|
|
|
|
"Region",
|
|
|
|
|
selectedRegion.regionName ?? "Select Region",
|
|
|
|
|
LocaleKeys.region.tr(),
|
|
|
|
|
selectedRegion.regionName ?? LocaleKeys.selectRegion.tr(),
|
|
|
|
|
isEnable: false,
|
|
|
|
|
isPopup: true,
|
|
|
|
|
isInputTypeNum: true,
|
|
|
|
|
@ -117,8 +119,8 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
|
|
|
|
|
},
|
|
|
|
|
).paddingOnly(top: 21),
|
|
|
|
|
DynamicTextFieldWidget(
|
|
|
|
|
"Item Price",
|
|
|
|
|
itemPrice == 0 ? "Price" : itemPrice.toString(),
|
|
|
|
|
LocaleKeys.itemPrice.tr(),
|
|
|
|
|
itemPrice == 0 ? LocaleKeys.price.tr() : itemPrice.toString(),
|
|
|
|
|
isEnable: true,
|
|
|
|
|
suffixIconData: Icons.search,
|
|
|
|
|
isPopup: false,
|
|
|
|
|
@ -129,8 +131,13 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
|
|
|
|
|
itemPrice = num.parse(value);
|
|
|
|
|
},
|
|
|
|
|
).paddingOnly(top: 12),
|
|
|
|
|
"Item Photos".toText14(isBold: true).paddingOnly(top: 16),
|
|
|
|
|
attachmentView("Attachments").paddingOnly(top: 12),
|
|
|
|
|
LocaleKeys.itemPhotos.tr().toText14().paddingOnly(top: 21),
|
|
|
|
|
attachmentView(LocaleKeys.attachments.tr()).paddingOnly(top: 12),
|
|
|
|
|
],
|
|
|
|
|
).objectContainerView(title: LocaleKeys.itemInfo.tr()),
|
|
|
|
|
],
|
|
|
|
|
).expanded,
|
|
|
|
|
1.divider,
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
DefaultButton(
|
|
|
|
|
@ -140,7 +147,7 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
|
|
|
|
|
},
|
|
|
|
|
colors: const [Color(0xffD02127), Color(0xffD02127)],
|
|
|
|
|
).expanded,
|
|
|
|
|
12.width,
|
|
|
|
|
8.width,
|
|
|
|
|
DefaultButton(
|
|
|
|
|
LocaleKeys.next.tr(),
|
|
|
|
|
isButtonDisabled()
|
|
|
|
|
@ -152,11 +159,8 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
|
|
|
|
|
disabledColor: MyColors.lightGrayColor,
|
|
|
|
|
).expanded
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(top: 21),
|
|
|
|
|
).insideContainer
|
|
|
|
|
],
|
|
|
|
|
).objectContainerView(title: "Item Info").paddingAll(21),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -174,20 +178,7 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget attachmentView(String title) {
|
|
|
|
|
return Container(
|
|
|
|
|
padding: const EdgeInsets.only(top: 15, bottom: 15, left: 14, right: 14),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(15),
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: const Color(0xff000000).withOpacity(.05),
|
|
|
|
|
blurRadius: 26,
|
|
|
|
|
offset: const Offset(0, -3),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
@ -237,7 +228,8 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.delete_sharp,
|
|
|
|
|
color: Colors.red[300],
|
|
|
|
|
))
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
@ -245,11 +237,11 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
|
|
|
|
|
separatorBuilder: (cxt, index) => 6.height,
|
|
|
|
|
itemCount: images.length),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
).objectContainerView();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void getAdDetails() async {
|
|
|
|
|
Future<void> getAdDetails() async {
|
|
|
|
|
// todo need to change this method later , its not a good approach to do it like this.
|
|
|
|
|
String details = await Utils.getStringFromPrefs(SharedPrefsConsts.editItemForSale);
|
|
|
|
|
var body = json.decode(details);
|
|
|
|
|
|
|
|
|
|
@ -274,17 +266,15 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
|
|
|
|
|
|
|
|
|
|
AddItemDetailsFragment.itemReviewModel = itemReviewModel;
|
|
|
|
|
SelectCategoryFragment.selectedSaleCategory = selectedSaleCategoryAd;
|
|
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void getRegions() async {
|
|
|
|
|
try {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
getRegionsList = await ItemsForSaleApiClient().getRegions();
|
|
|
|
|
await getAdDetails();
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
setState(() {});
|
|
|
|
|
getAdDetails();
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Utils.handleException(ex, context, null);
|
|
|
|
|
|