Merge branch 'IT18001808' into 'master'

chat bot

See merge request !13
parents 04d68d23 0b1f8502
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))
]),
),
],
),
],
),
),
);
}
}
...@@ -23,7 +23,23 @@ class _HomeApp extends State<Home> { ...@@ -23,7 +23,23 @@ 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(
...@@ -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
...@@ -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: 80.0, height: 90.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: 30.0, height: 50.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: 190, width: 230,
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: 135, width: 100,
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) => (ImgPicker())), MaterialPageRoute(builder: (context) => (SuggestColor())),
); );
}, },
), ),
......
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: 40.0, height: 60.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))),
......
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,
),
],
),
),
),
],
),
);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment