Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-153
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-153
2021-153
Commits
5b175c5f
Commit
5b175c5f
authored
Sep 02, 2021
by
Weerasinghe S.W.P.N.M - IT18001808
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'IT18001808' into 'master'
chat bot See merge request
!13
parents
04d68d23
0b1f8502
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
285 additions
and
11 deletions
+285
-11
Mobile App/lib/component/colour_card.dart
Mobile App/lib/component/colour_card.dart
+63
-0
Mobile App/lib/screens/home/home.dart
Mobile App/lib/screens/home/home.dart
+108
-1
Mobile App/lib/screens/skinColourDetection/colourdetector.dart
...e App/lib/screens/skinColourDetection/colourdetector.dart
+7
-6
Mobile App/lib/screens/skinColourDetection/imagepicker.dart
Mobile App/lib/screens/skinColourDetection/imagepicker.dart
+10
-4
Mobile App/lib/screens/suggestColor/suggestColor.dart
Mobile App/lib/screens/suggestColor/suggestColor.dart
+97
-0
No files found.
Mobile App/lib/component/colour_card.dart
0 → 100644
View file @
5b175c5f
import
'package:flutter/material.dart'
;
class
ColourCard
extends
StatefulWidget
{
final
Color
col
;
final
String
colName
;
const
ColourCard
(
this
.
col
,
this
.
colName
);
@override
_ColourCardState
createState
()
=>
_ColourCardState
();
}
class
_ColourCardState
extends
State
<
ColourCard
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
InkWell
(
splashColor:
Colors
.
blue
.
withAlpha
(
30
),
onTap:
()
{
print
(
widget
.
colName
);
},
child:
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
20.0
),
child:
Row
(
children:
[
Column
(
children:
<
Widget
>[
Container
(
width:
180
,
height:
50
,
child:
Center
(
child:
Text
(
widget
.
colName
,
style:
TextStyle
(
color:
Colors
.
deepPurpleAccent
,
fontSize:
22
,),),
),
),
],
),
SizedBox
(
width:
30.0
,
),
Column
(
children:
<
Widget
>[
Container
(
width:
100
,
height:
50
,
decoration:
BoxDecoration
(
shape:
BoxShape
.
rectangle
,
borderRadius:
BorderRadius
.
circular
(
20.0
),
color:
widget
.
col
,
border:
Border
.
all
(
width:
1.0
,
color:
widget
.
col
,),
boxShadow:
[
BoxShadow
(
color:
Colors
.
black12
,
blurRadius:
4
,
offset:
Offset
(
0
,
2
))
]),
),
],
),
],
),
),
);
}
}
Mobile App/lib/screens/home/home.dart
View file @
5b175c5f
...
@@ -23,9 +23,25 @@ class _HomeApp extends State<Home> {
...
@@ -23,9 +23,25 @@ class _HomeApp extends State<Home> {
child:
Container
(
child:
Container
(
color:
Colors
.
deepPurpleAccent
,
color:
Colors
.
deepPurpleAccent
,
)
)
),
SingleChildScrollView
(
child:
Column
(
children:
<
Widget
>[
SizedBox
(
height:
750.0
,
),
FloatingActionButton
.
extended
(
onPressed:
()
{
chatBotModalBox
(
context
);
},
label:
const
Text
(
'Chat Bot'
),
backgroundColor:
Colors
.
deepPurpleAccent
,
)
)
],
],
),
),
),
],
),
floatingActionButton:
FloatingActionButton
.
extended
(
floatingActionButton:
FloatingActionButton
.
extended
(
onPressed:
()
{
onPressed:
()
{
Navigator
.
push
(
Navigator
.
push
(
...
@@ -40,4 +56,95 @@ class _HomeApp extends State<Home> {
...
@@ -40,4 +56,95 @@ class _HomeApp extends State<Home> {
),
),
);
);
}
}
//chat bot
void
chatBotModalBox
(
context
){
showModalBottomSheet
(
context:
context
,
builder:
(
BuildContext
bc
){
return
Container
(
height:
MediaQuery
.
of
(
context
).
size
.
height
*.
8
,
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
15.0
),
child:
SingleChildScrollView
(
child:
Column
(
children:
[
Center
(
child:
Text
(
"Fitton Assistant"
,
style:
TextStyle
(
color:
Colors
.
deepPurpleAccent
,
fontSize:
23
,
fontWeight:
FontWeight
.
bold
),),
),
SizedBox
(
height:
30.0
,
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
all
(
10
),
constraints:
BoxConstraints
(
maxWidth:
MediaQuery
.
of
(
context
).
size
.
width
*
0.6
),
decoration:
BoxDecoration
(
color:
Colors
.
deepPurpleAccent
,
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
16
),
topRight:
Radius
.
circular
(
16
),
bottomLeft:
Radius
.
circular
(
12
),
bottomRight:
Radius
.
circular
(
12
),
)),
child:
Text
(
" Hello Dulini"
,
style:
TextStyle
(
color:
Colors
.
white
),
),
),
],
),
SizedBox
(
height:
10.0
,
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
end
,
children:
[
Container
(
padding:
EdgeInsets
.
all
(
10
),
constraints:
BoxConstraints
(
maxWidth:
MediaQuery
.
of
(
context
).
size
.
width
*
0.6
),
decoration:
BoxDecoration
(
color:
Colors
.
grey
[
200
],
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
16
),
topRight:
Radius
.
circular
(
16
),
bottomLeft:
Radius
.
circular
(
12
),
bottomRight:
Radius
.
circular
(
12
),
)),
child:
Text
(
"I need to choose a saree."
,
),
),
],
),
Container
(
padding:
EdgeInsets
.
all
(
15.0
),
alignment:
Alignment
(
0.0
,
-
1.0
),
child:
TextField
(
enableSuggestions:
false
,
autocorrect:
false
,
obscureText:
true
,
decoration:
InputDecoration
(
hintText:
"Whats On Your Mind?"
,
hintStyle:
TextStyle
(
color:
Colors
.
grey
[
400
]),
suffixIcon:
IconButton
(
icon:
Icon
(
Icons
.
send
),
onPressed:
(
(){
print
(
"Hi"
);
}
),
)
),
),
),
],
),
),
),
);
});
}
}
}
\ No newline at end of file
Mobile App/lib/screens/skinColourDetection/colourdetector.dart
View file @
5b175c5f
...
@@ -7,6 +7,7 @@ import 'dart:io';
...
@@ -7,6 +7,7 @@ import 'dart:io';
import
'package:fitton/component/clipper.dart'
;
import
'package:fitton/component/clipper.dart'
;
import
'package:fitton/component/default_button.dart'
;
import
'package:fitton/component/default_button.dart'
;
import
'package:fitton/screens/skinColourDetection/imagepicker.dart'
;
import
'package:fitton/screens/skinColourDetection/imagepicker.dart'
;
import
'package:fitton/screens/suggestColor/suggestColor.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:image/image.dart'
as
img
;
import
'package:image/image.dart'
as
img
;
...
@@ -62,7 +63,7 @@ class _ColorPickerWidgetState extends State<ColorPickerWidget> {
...
@@ -62,7 +63,7 @@ class _ColorPickerWidgetState extends State<ColorPickerWidget> {
child:
Column
(
child:
Column
(
children:
<
Widget
>[
children:
<
Widget
>[
SizedBox
(
SizedBox
(
height:
8
0.0
,
height:
9
0.0
,
),
),
Center
(
Center
(
child:
Text
(
"Let's Find Your Skin Tone"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
30
,
fontWeight:
FontWeight
.
bold
),),
child:
Text
(
"Let's Find Your Skin Tone"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
30
,
fontWeight:
FontWeight
.
bold
),),
...
@@ -92,7 +93,7 @@ class _ColorPickerWidgetState extends State<ColorPickerWidget> {
...
@@ -92,7 +93,7 @@ class _ColorPickerWidgetState extends State<ColorPickerWidget> {
),
),
),
),
SizedBox
(
SizedBox
(
height:
3
0.0
,
height:
5
0.0
,
),
),
Padding
(
Padding
(
padding:
EdgeInsets
.
only
(
left:
30.0
,
right:
30.0
),
padding:
EdgeInsets
.
only
(
left:
30.0
,
right:
30.0
),
...
@@ -103,7 +104,7 @@ class _ColorPickerWidgetState extends State<ColorPickerWidget> {
...
@@ -103,7 +104,7 @@ class _ColorPickerWidgetState extends State<ColorPickerWidget> {
Column
(
Column
(
children:
<
Widget
>[
children:
<
Widget
>[
Container
(
Container
(
width:
19
0
,
width:
23
0
,
height:
50
,
height:
50
,
child:
Center
(
child:
Center
(
child:
Text
(
selectedColor
==
Colors
.
white
?
"Wait, Data is loading"
:
"Your Skin Tone"
,
style:
TextStyle
(
color:
Colors
.
deepPurpleAccent
,
fontSize:
22
,),),
child:
Text
(
selectedColor
==
Colors
.
white
?
"Wait, Data is loading"
:
"Your Skin Tone"
,
style:
TextStyle
(
color:
Colors
.
deepPurpleAccent
,
fontSize:
22
,),),
...
@@ -117,7 +118,7 @@ class _ColorPickerWidgetState extends State<ColorPickerWidget> {
...
@@ -117,7 +118,7 @@ class _ColorPickerWidgetState extends State<ColorPickerWidget> {
Column
(
Column
(
children:
<
Widget
>[
children:
<
Widget
>[
Container
(
Container
(
width:
1
35
,
width:
1
00
,
height:
50
,
height:
50
,
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
shape:
BoxShape
.
rectangle
,
shape:
BoxShape
.
rectangle
,
...
@@ -130,7 +131,7 @@ class _ColorPickerWidgetState extends State<ColorPickerWidget> {
...
@@ -130,7 +131,7 @@ class _ColorPickerWidgetState extends State<ColorPickerWidget> {
blurRadius:
4
,
blurRadius:
4
,
offset:
Offset
(
0
,
2
))
offset:
Offset
(
0
,
2
))
]),
]),
)
)
,
],
],
),
),
],
],
...
@@ -150,7 +151,7 @@ class _ColorPickerWidgetState extends State<ColorPickerWidget> {
...
@@ -150,7 +151,7 @@ class _ColorPickerWidgetState extends State<ColorPickerWidget> {
press:
selectedColor
==
Colors
.
white
?
null
:
()
{
press:
selectedColor
==
Colors
.
white
?
null
:
()
{
Navigator
.
push
(
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
(
ImgPicke
r
())),
MaterialPageRoute
(
builder:
(
context
)
=>
(
SuggestColo
r
())),
);
);
},
},
),
),
...
...
Mobile App/lib/screens/skinColourDetection/imagepicker.dart
View file @
5b175c5f
import
'package:fitton/component/clipper.dart'
;
import
'package:fitton/component/clipper.dart'
;
import
'package:fitton/screens/home/home.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'dart:io'
;
import
'dart:io'
;
...
@@ -38,7 +39,7 @@ class _ImgPickerState extends State<ImgPicker> {
...
@@ -38,7 +39,7 @@ class _ImgPickerState extends State<ImgPicker> {
final
imagePicker
=
ImagePicker
();
final
imagePicker
=
ImagePicker
();
Future
getImage
()
async
{
Future
getImage
()
async
{
final
imageFile
=
File
(
await
ImagePicker
().
getImage
(
source
:
ImageSource
.
camera
).
then
((
pickedFile
)
=>
pickedFile
.
path
));
final
imageFile
=
File
(
await
ImagePicker
().
getImage
(
source
:
ImageSource
.
gallery
).
then
((
pickedFile
)
=>
pickedFile
.
path
));
setState
(()
{
setState
(()
{
_image
=
File
(
imageFile
.
path
);
_image
=
File
(
imageFile
.
path
);
isLoad
=
true
;
isLoad
=
true
;
...
@@ -127,7 +128,7 @@ class _ImgPickerState extends State<ImgPicker> {
...
@@ -127,7 +128,7 @@ class _ImgPickerState extends State<ImgPicker> {
child:
Column
(
child:
Column
(
children:
<
Widget
>[
children:
<
Widget
>[
SizedBox
(
SizedBox
(
height:
4
0.0
,
height:
6
0.0
,
),
),
DefaultButton
(
DefaultButton
(
text:
_image
==
null
?
'Take a Selfie'
:
'Try Another'
,
text:
_image
==
null
?
'Take a Selfie'
:
'Try Another'
,
...
@@ -138,9 +139,14 @@ class _ImgPickerState extends State<ImgPicker> {
...
@@ -138,9 +139,14 @@ class _ImgPickerState extends State<ImgPicker> {
height:
30.0
,
height:
30.0
,
),
),
DefaultButton
(
DefaultButton
(
text:
"Continue the Magic ✨"
,
text:
faceCount
==
0
?
"Back"
:
"Continue the Magic ✨"
,
bg:
false
,
bg:
false
,
press:
faceCount
==
0
?
null
:()
{
press:
faceCount
==
0
?
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
(
Home
())),
);
}
:()
{
Navigator
.
push
(
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
(
ColorPickerWidget
(
_image
))),
MaterialPageRoute
(
builder:
(
context
)
=>
(
ColorPickerWidget
(
_image
))),
...
...
Mobile App/lib/screens/suggestColor/suggestColor.dart
0 → 100644
View file @
5b175c5f
import
'package:fitton/component/clipper.dart'
;
import
'package:fitton/component/colour_card.dart'
;
import
'package:fitton/component/default_button.dart'
;
import
'package:fitton/screens/skinColourDetection/imagepicker.dart'
;
import
'package:flutter/material.dart'
;
class
SuggestColor
extends
StatefulWidget
{
const
SuggestColor
({
Key
key
})
:
super
(
key:
key
);
@override
_SuggestColorState
createState
()
=>
_SuggestColorState
();
}
class
_SuggestColorState
extends
State
<
SuggestColor
>
{
List
<
String
>
cName
=
[
"Purple"
,
"Blue"
,
"Grey"
,
"Red"
];
List
<
MaterialColor
>
cList
=
[
Colors
.
purple
,
Colors
.
indigo
,
Colors
.
grey
,
Colors
.
red
];
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
body:
Stack
(
children:
[
ClipPath
(
clipper:
MyClipper
(),
child:
Container
(
color:
Colors
.
deepPurpleAccent
,
)
),
SingleChildScrollView
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
left:
30.0
,
right:
30.0
),
child:
Column
(
children:
<
Widget
>[
SizedBox
(
height:
80.0
,
),
Center
(
child:
Text
(
"Matching Dress Colours"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
30
,
fontWeight:
FontWeight
.
bold
),),
),
SizedBox
(
height:
20.0
,
),
Center
(
child:
Text
(
"Those are the results that match with your skin tone. Select desired colour or colours."
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
20
,),),
),
SizedBox
(
height:
100.0
,
),
ListView
.
builder
(
scrollDirection:
Axis
.
vertical
,
shrinkWrap:
true
,
itemCount:
cName
.
length
,
physics:
ClampingScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
return
ColourCard
(
cList
[
index
],
cName
[
index
]
);
}),
SizedBox
(
height:
50.0
,
),
DefaultButton
(
text:
"Search with All Colours"
,
bg:
false
,
press:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
(
SuggestColor
())),
);
},
),
SizedBox
(
height:
20.0
,
),
DefaultButton
(
text:
"Back"
,
bg:
true
,
press:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
(
ImgPicker
())),
);
},
),
SizedBox
(
height:
20.0
,
),
],
),
),
),
],
),
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment