Skip to content

Commit 0f3001e

Browse files
committed
shopping detail page type one and two completed
1 parent fe15aec commit 0f3001e

21 files changed

+923
-203
lines changed

assets/images/shopping/peep_both.svg

Lines changed: 27 additions & 0 deletions
Loading

assets/images/shopping/peep_lady.svg

Lines changed: 15 additions & 0 deletions
Loading

lib/custom_widgets/button_plain.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class ButtonPlain extends StatelessWidget {
1414
@override
1515
Widget build(BuildContext context) {
1616
return ButtonTheme(
17+
height: 48,
1718
minWidth: size != null ? size : MediaQuery.of(context).size.width,
1819
child: RaisedButton(
1920
padding: EdgeInsets.all(16),
@@ -24,7 +25,7 @@ class ButtonPlain extends StatelessWidget {
2425
textColor: textColor,
2526
child: Text(
2627
text,
27-
style: TextStyle(fontSize: 21.0, fontWeight: FontWeight.bold),
28+
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w800),
2829
),
2930
shape: RoundedRectangleBorder(
3031
borderRadius: new BorderRadius.circular(16.0)),

lib/custom_widgets/button_solid_with_icon.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class ButtonPlainWithIcon extends StatelessWidget {
1111
final bool isSuffix;
1212
final Color color;
1313
final Color textColor;
14+
final double size;
1415

1516
const ButtonPlainWithIcon(
1617
{this.text,
@@ -19,12 +20,13 @@ class ButtonPlainWithIcon extends StatelessWidget {
1920
this.isSuffix,
2021
this.iconPath,
2122
this.color,
23+
this.size,
2224
this.textColor});
2325

2426
@override
2527
Widget build(BuildContext context) {
2628
return ButtonTheme(
27-
minWidth: MediaQuery.of(context).size.width,
29+
minWidth: size != null ? size : MediaQuery.of(context).size.width,
2830
child: RaisedButton(
2931
padding: EdgeInsets.all(16),
3032
color: color,

lib/custom_widgets/chips_filter_widget.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class _ChipsFilterWidgetState extends State<ChipsFilterWidget> {
2525
@override
2626
Widget build(BuildContext context) {
2727
return Padding(
28-
padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 16.0),
28+
padding: const EdgeInsets.only(right: 16.0, top: 16.0),
2929
child: Wrap(
3030
spacing: 12,
3131
children: List<Widget>.generate(

lib/custom_widgets/color_widget.dart

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import 'package:contraflutterkit/utils/colors.dart';
2+
import 'package:flutter/cupertino.dart';
3+
4+
class ColorWidget extends StatelessWidget {
5+
final Color borderColor;
6+
final Color shadowColor;
7+
final bool selected;
8+
final VoidCallback onTap;
9+
10+
const ColorWidget(
11+
{this.borderColor, this.shadowColor, this.selected, this.onTap});
12+
13+
@override
14+
Widget build(BuildContext context) {
15+
return GestureDetector(
16+
onTap: onTap,
17+
child: Container(
18+
height: 34,
19+
width: 34,
20+
decoration: ShapeDecoration(
21+
shadows: [
22+
BoxShadow(
23+
color: shadowColor,
24+
offset: Offset(
25+
0.0, // Move to right 10 horizontally
26+
selected ? 4.0 : 0.0, // Move to bottom 5 Vertically
27+
),
28+
)
29+
],
30+
color: selected ? lightening_yellow : white,
31+
shape:
32+
CircleBorder(side: BorderSide(color: borderColor, width: 2))),
33+
),
34+
);
35+
}
36+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import 'package:contraflutterkit/utils/colors.dart';
2+
import 'package:flutter/cupertino.dart';
3+
import 'package:flutter/material.dart';
4+
5+
import 'color_widget.dart';
6+
7+
class ColorsSelectWidget extends StatefulWidget {
8+
final List<Color> colors;
9+
10+
const ColorsSelectWidget({this.colors});
11+
12+
@override
13+
_ColorsSelectWidgetState createState() => _ColorsSelectWidgetState();
14+
}
15+
16+
class _ColorsSelectWidgetState extends State<ColorsSelectWidget> {
17+
List<Color> options = List();
18+
List<int> selectedChoices = List();
19+
20+
@override
21+
void initState() {
22+
super.initState();
23+
options = widget.colors;
24+
selectedChoices.add(0);
25+
}
26+
27+
@override
28+
Widget build(BuildContext context) {
29+
return Padding(
30+
padding: const EdgeInsets.only( right: 16.0, top: 16.0),
31+
child: Wrap(
32+
spacing: 12,
33+
children: List<Widget>.generate(
34+
options.length,
35+
(int index) {
36+
return ColorWidget(
37+
borderColor: wood_smoke,
38+
shadowColor: wood_smoke,
39+
selected: selectedChoices.contains(index),
40+
onTap: () {
41+
setState(() {
42+
selectedChoices.contains(index)
43+
? selectedChoices.remove(index)
44+
: selectedChoices.add(index);
45+
});
46+
},
47+
);
48+
},
49+
).toList(),
50+
),
51+
);
52+
}
53+
}
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
import 'package:contraflutterkit/custom_widgets/circle_dot_widget.dart';
2+
import 'package:contraflutterkit/utils/colors.dart';
3+
import 'package:flutter/cupertino.dart';
4+
import 'package:flutter_svg/flutter_svg.dart';
5+
6+
class PagerImageView extends StatefulWidget {
7+
final List<String> images;
8+
9+
const PagerImageView({this.images});
10+
11+
@override
12+
_PagerImageViewState createState() => _PagerImageViewState();
13+
}
14+
15+
class _PagerImageViewState extends State<PagerImageView> {
16+
PageController _pageController;
17+
int currentPageValue = 0;
18+
int previousPageValue = 0;
19+
double _moveBar = 0.0;
20+
List<String> _images = [];
21+
final List<Widget> _cards = [];
22+
23+
@override
24+
void initState() {
25+
_images = widget.images;
26+
_cards.add(SvgPicture.asset(
27+
_images[0],
28+
height: 290,
29+
width: 300,
30+
));
31+
_cards.add(SvgPicture.asset(
32+
_images[1],
33+
height: 290,
34+
width: 300,
35+
));
36+
_cards.add(SvgPicture.asset(
37+
_images[2],
38+
height: 290,
39+
width: 300,
40+
));
41+
super.initState();
42+
_pageController = PageController(initialPage: currentPageValue);
43+
}
44+
45+
@override
46+
void dispose() {
47+
_pageController.dispose();
48+
super.dispose();
49+
}
50+
51+
@override
52+
Widget build(BuildContext context) {
53+
return Column(
54+
children: <Widget>[
55+
Container(
56+
height: 310,
57+
padding: EdgeInsets.symmetric(horizontal: 16),
58+
child: PageView.builder(
59+
physics: ClampingScrollPhysics(),
60+
itemBuilder: (context, index) {
61+
return _cards[index];
62+
},
63+
onPageChanged: (int page) {
64+
animatePage(page);
65+
},
66+
itemCount: _cards.length,
67+
controller: _pageController,
68+
),
69+
),
70+
Padding(
71+
padding: const EdgeInsets.all(24.0),
72+
child: Row(
73+
mainAxisAlignment: MainAxisAlignment.center,
74+
children: <Widget>[
75+
for (int i = 0; i < _cards.length; i++)
76+
if (i == currentPageValue) ...[
77+
CircleDotWidget(
78+
isActive: true,
79+
color: white,
80+
borderColor: white,
81+
)
82+
] else
83+
CircleDotWidget(
84+
isActive: false,
85+
color: flamingo,
86+
borderColor: wood_smoke,
87+
),
88+
],
89+
),
90+
),
91+
],
92+
);
93+
}
94+
95+
void animatePage(int page) {
96+
print('page is $page');
97+
currentPageValue = page;
98+
if (previousPageValue == 0) {
99+
previousPageValue = currentPageValue;
100+
_moveBar = _moveBar + 0.14;
101+
} else {
102+
if (previousPageValue < currentPageValue) {
103+
previousPageValue = currentPageValue;
104+
_moveBar = _moveBar + 0.14;
105+
} else {
106+
previousPageValue = currentPageValue;
107+
_moveBar = _moveBar - 0.14;
108+
}
109+
}
110+
111+
setState(() {});
112+
}
113+
}

lib/custom_widgets/size_widget.dart

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import 'package:contraflutterkit/utils/colors.dart';
2+
import 'package:flutter/cupertino.dart';
3+
4+
class SizeWidget extends StatelessWidget {
5+
final Color borderColor;
6+
final Color shadowColor;
7+
final bool selected;
8+
final String text;
9+
final VoidCallback onTap;
10+
11+
const SizeWidget(
12+
{this.borderColor,
13+
this.shadowColor,
14+
this.selected,
15+
this.text,
16+
this.onTap});
17+
18+
@override
19+
Widget build(BuildContext context) {
20+
return GestureDetector(
21+
onTap: onTap,
22+
child: Container(
23+
height: 48,
24+
width: 48,
25+
decoration: ShapeDecoration(
26+
shadows: [
27+
BoxShadow(
28+
color: shadowColor,
29+
offset: Offset(
30+
0.0, // Move to right 10 horizontally
31+
selected ? 4.0 : 0.0, // Move to bottom 5 Vertically
32+
),
33+
)
34+
],
35+
color: selected ? lightening_yellow : white,
36+
shape: RoundedRectangleBorder(
37+
borderRadius: BorderRadius.all(Radius.circular(16)),
38+
side: BorderSide(color: borderColor, width: 2))),
39+
child: Center(
40+
child: Text(
41+
text,
42+
textAlign: TextAlign.center,
43+
style: TextStyle(
44+
fontWeight: FontWeight.w800, fontSize: 24, color: wood_smoke),
45+
),
46+
),
47+
),
48+
);
49+
}
50+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import 'package:contraflutterkit/custom_widgets/size_widget.dart';
2+
import 'package:contraflutterkit/utils/colors.dart';
3+
import 'package:flutter/cupertino.dart';
4+
import 'package:flutter/material.dart';
5+
6+
class SizesSelectWidget extends StatefulWidget {
7+
final List<String> filters;
8+
9+
const SizesSelectWidget({this.filters});
10+
11+
@override
12+
_SizesSelectWidgetState createState() => _SizesSelectWidgetState();
13+
}
14+
15+
class _SizesSelectWidgetState extends State<SizesSelectWidget> {
16+
List<String> options = List();
17+
List<int> selectedChoices = List();
18+
19+
@override
20+
void initState() {
21+
super.initState();
22+
options = widget.filters;
23+
selectedChoices.add(0);
24+
}
25+
26+
@override
27+
Widget build(BuildContext context) {
28+
return Padding(
29+
padding: const EdgeInsets.only(top: 8.0),
30+
child: Wrap(
31+
spacing: 12,
32+
children: List<Widget>.generate(
33+
options.length,
34+
(int index) {
35+
return SizeWidget(
36+
borderColor: wood_smoke,
37+
shadowColor: wood_smoke,
38+
text: options[index],
39+
selected: selectedChoices.contains(index),
40+
onTap: () {
41+
setState(() {
42+
selectedChoices.contains(index)
43+
? selectedChoices.remove(index)
44+
: selectedChoices.add(index);
45+
});
46+
},
47+
);
48+
},
49+
).toList(),
50+
),
51+
);
52+
}
53+
}

0 commit comments

Comments
 (0)