promocode
This commit is contained in:
parent
39b91a5fb3
commit
819bdd1134
3 changed files with 187 additions and 192 deletions
|
|
@ -163,10 +163,7 @@ class AddPromocodeCampaign {
|
|||
}).toList(),
|
||||
),
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
return Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
|
|
@ -179,8 +176,7 @@ class AddPromocodeCampaign {
|
|||
'Name',
|
||||
campaignDto.name,
|
||||
(v) {
|
||||
campaignDto =
|
||||
campaignDto.copyWith(
|
||||
campaignDto = campaignDto.copyWith(
|
||||
name: v,
|
||||
);
|
||||
},
|
||||
|
|
@ -189,8 +185,7 @@ class AddPromocodeCampaign {
|
|||
'Template',
|
||||
campaignDto.template,
|
||||
(v) {
|
||||
campaignDto =
|
||||
campaignDto.copyWith(
|
||||
campaignDto = campaignDto.copyWith(
|
||||
template: v,
|
||||
);
|
||||
},
|
||||
|
|
@ -201,8 +196,7 @@ class AddPromocodeCampaign {
|
|||
'Generation size',
|
||||
campaignDto.generationSize,
|
||||
(v) {
|
||||
campaignDto =
|
||||
campaignDto.copyWith(
|
||||
campaignDto = campaignDto.copyWith(
|
||||
generationSize: v);
|
||||
},
|
||||
),
|
||||
|
|
@ -210,8 +204,7 @@ class AddPromocodeCampaign {
|
|||
'Activations per code',
|
||||
campaignDto.activationsPerCode,
|
||||
(v) {
|
||||
campaignDto =
|
||||
campaignDto.copyWith(
|
||||
campaignDto = campaignDto.copyWith(
|
||||
activationsPerCode: v,
|
||||
);
|
||||
},
|
||||
|
|
@ -251,8 +244,8 @@ class AddPromocodeCampaign {
|
|||
PromoCodeCampaignStatus.values,
|
||||
campaignDto.status, (v) {
|
||||
setState(() {
|
||||
campaignDto = campaignDto
|
||||
.copyWith(status: v);
|
||||
campaignDto =
|
||||
campaignDto.copyWith(status: v);
|
||||
});
|
||||
}),
|
||||
Text(
|
||||
|
|
@ -265,12 +258,10 @@ class AddPromocodeCampaign {
|
|||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount:
|
||||
campaignDto.products.length +
|
||||
1,
|
||||
campaignDto.products.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index ==
|
||||
campaignDto
|
||||
.products.length) {
|
||||
campaignDto.products.length) {
|
||||
return ListTile(
|
||||
title: Text('Add'),
|
||||
onTap: () async {
|
||||
|
|
@ -299,8 +290,7 @@ class AddPromocodeCampaign {
|
|||
);
|
||||
if (p != null) {
|
||||
setState(() {
|
||||
campaignDto.products
|
||||
.add(p);
|
||||
campaignDto.products.add(p);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
@ -320,8 +310,6 @@ class AddPromocodeCampaign {
|
|||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -12,14 +12,21 @@ class DateParam extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(title),
|
||||
SizedBox(
|
||||
width: 2,
|
||||
width: 8,
|
||||
),
|
||||
GestureDetector(
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () async {
|
||||
final date = await showDatePicker(
|
||||
|
|
@ -53,7 +60,6 @@ class DateParam extends StatelessWidget {
|
|||
});
|
||||
onChanged(date);
|
||||
},
|
||||
child: Expanded(
|
||||
child: Text(
|
||||
initial?.let(
|
||||
(d) =>
|
||||
|
|
@ -63,6 +69,7 @@ class DateParam extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class EnumParam<T extends Enum> extends StatelessWidget {
|
|||
.toList(),
|
||||
onChanged: (v) => setState(() {
|
||||
value = v!;
|
||||
onChanged(v!);
|
||||
onChanged(v);
|
||||
}),
|
||||
);
|
||||
}),
|
||||
|
|
|
|||
Loading…
Reference in a new issue