Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
Vasthram
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ramesh Babu Puvvadi
Vasthram
Commits
9d51c707
Commit
9d51c707
authored
Jul 05, 2024
by
Ramesh Babu Puvvadi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added
parent
59f975ac
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
19 deletions
+27
-19
Identifystylecode.dart
lib/Identifystylecode.dart
+25
-15
Uploadstylecode.dart
lib/Uploadstylecode.dart
+2
-4
No files found.
lib/Identifystylecode.dart
View file @
9d51c707
...
@@ -82,7 +82,8 @@ class _Identifystylecode extends State<Identifystylecode> {
...
@@ -82,7 +82,8 @@ class _Identifystylecode extends State<Identifystylecode> {
Future
<
void
>
initializeCamera
()
async
{
Future
<
void
>
initializeCamera
()
async
{
final
cameras
=
await
availableCameras
();
final
cameras
=
await
availableCameras
();
final
frontCamera
=
cameras
.
firstWhere
((
camera
)
=>
camera
.
lensDirection
==
CameraLensDirection
.
back
);
final
frontCamera
=
cameras
.
firstWhere
(
(
camera
)
=>
camera
.
lensDirection
==
CameraLensDirection
.
back
);
if
(
frontCamera
==
null
)
{
if
(
frontCamera
==
null
)
{
if
(
kDebugMode
)
{
if
(
kDebugMode
)
{
print
(
'No front camera found'
);
print
(
'No front camera found'
);
...
@@ -95,7 +96,8 @@ class _Identifystylecode extends State<Identifystylecode> {
...
@@ -95,7 +96,8 @@ class _Identifystylecode extends State<Identifystylecode> {
Future
<
void
>
_navigateToCameraScreen
()
async
{
Future
<
void
>
_navigateToCameraScreen
()
async
{
try
{
try
{
final
imageFile1
=
await
Navigator
.
push
<
File
>(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
CameraScreen
()));
final
imageFile1
=
await
Navigator
.
push
<
File
>(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
CameraScreen
()));
if
(
imageFile1
!=
null
)
{
if
(
imageFile1
!=
null
)
{
imagefile
=
imageFile1
;
imagefile
=
imageFile1
;
final
bytes
=
await
imageFile1
.
readAsBytes
();
final
bytes
=
await
imageFile1
.
readAsBytes
();
...
@@ -406,7 +408,7 @@ class _Identifystylecode extends State<Identifystylecode> {
...
@@ -406,7 +408,7 @@ class _Identifystylecode extends State<Identifystylecode> {
height:
8
,
height:
8
,
),
),
Text
(
Text
(
'Similarity Percentage
\t
:
${closestStylecodes![index].
SimilarityPercentage ?? 'None'}${closestStylecodes![index].S
imilarityPercentage != 'None' ? '%' : ''}
'
,
'Similarity Percentage
\t
:
${closestStylecodes![index].
similarityPercentage ?? 'None'}${closestStylecodes![index].s
imilarityPercentage != 'None' ? '%' : ''}
'
,
style:
Constants
.
headerfontStyle
,
style:
Constants
.
headerfontStyle
,
),
),
],
],
...
@@ -418,10 +420,14 @@ class _Identifystylecode extends State<Identifystylecode> {
...
@@ -418,10 +420,14 @@ class _Identifystylecode extends State<Identifystylecode> {
children:
[
children:
[
ElevatedButton
(
ElevatedButton
(
onPressed:
()
{
onPressed:
()
{
Constants
.
Showindicator
(
context
,
'Loading Data ...'
);
Constants
.
Showindicator
(
context
,
'Loading Data ...'
);
getStock
(
closestStylecodes
![
index
].
styleCode
);
getStock
(
closestStylecodes
![
index
].
styleCode
);
},
},
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
const
Color
.
fromARGB
(
255
,
69
,
66
,
121
),),
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
const
Color
.
fromARGB
(
255
,
69
,
66
,
121
),
),
child:
const
Text
(
child:
const
Text
(
'Stock'
,
'Stock'
,
style:
TextStyle
(
color:
Colors
.
white
),
style:
TextStyle
(
color:
Colors
.
white
),
...
@@ -430,16 +436,21 @@ class _Identifystylecode extends State<Identifystylecode> {
...
@@ -430,16 +436,21 @@ class _Identifystylecode extends State<Identifystylecode> {
const
SizedBox
(
width:
16
),
const
SizedBox
(
width:
16
),
ElevatedButton
(
ElevatedButton
(
onPressed:
()
{
onPressed:
()
{
Constants
.
Showindicator
(
context
,
'Loading Data ...'
);
Constants
.
Showindicator
(
context
,
'Loading Data ...'
);
getSale
(
closestStylecodes
![
index
].
styleCode
);
getSale
(
closestStylecodes
![
index
].
styleCode
);
},
},
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
const
Color
.
fromARGB
(
255
,
69
,
66
,
121
)),
style:
ElevatedButton
.
styleFrom
(
child:
const
Text
(
'
\t
Sale
\t
'
,
style:
TextStyle
(
color:
Colors
.
white
)),
backgroundColor:
const
Color
.
fromARGB
(
255
,
69
,
66
,
121
)),
child:
const
Text
(
'
\t
Sale
\t
'
,
style:
TextStyle
(
color:
Colors
.
white
)),
),
),
const
SizedBox
(
width:
16
),
const
SizedBox
(
width:
16
),
ElevatedButton
(
ElevatedButton
(
onPressed:
()
{
onPressed:
()
{
if
(
closestStylecodes
![
index
].
similarImagePath
!=
if
(
closestStylecodes
![
index
]
.
similarImagePath
!=
'No Saree'
)
{
'No Saree'
)
{
showDialog
(
showDialog
(
context:
context
,
context:
context
,
...
@@ -456,7 +467,7 @@ class _Identifystylecode extends State<Identifystylecode> {
...
@@ -456,7 +467,7 @@ class _Identifystylecode extends State<Identifystylecode> {
style:
Constants
.
headerfontStyle
,
style:
Constants
.
headerfontStyle
,
),
),
Text
(
Text
(
'Similarity Percentage:
${closestStylecodes![index].
SimilarityPercentage ?? 'None'}${closestStylecodes![index].S
imilarityPercentage != 'None' ? '%' : ''}
'
,
'Similarity Percentage:
${closestStylecodes![index].
similarityPercentage ?? 'None'}${closestStylecodes![index].s
imilarityPercentage != 'None' ? '%' : ''}
'
,
style:
Constants
.
headerfontStyle
,
style:
Constants
.
headerfontStyle
,
),
),
Image
.
network
(
Image
.
network
(
...
@@ -781,7 +792,7 @@ class _Identifystylecode extends State<Identifystylecode> {
...
@@ -781,7 +792,7 @@ class _Identifystylecode extends State<Identifystylecode> {
}
}
void
getupdate
(
var
jsonResponse
)
{
void
getupdate
(
var
jsonResponse
)
{
print
(
'Hitting ot npt
$jsonResponse
'
);
//
print('Hitting ot npt $jsonResponse');
Navigator
.
of
(
context
).
pop
();
Navigator
.
of
(
context
).
pop
();
setState
(()
{
setState
(()
{
isloading
=
false
;
isloading
=
false
;
...
@@ -796,7 +807,6 @@ class _Identifystylecode extends State<Identifystylecode> {
...
@@ -796,7 +807,6 @@ class _Identifystylecode extends State<Identifystylecode> {
}).
toList
();
}).
toList
();
//closestStylecodes = [Stylecode.fromJson(json)];
//closestStylecodes = [Stylecode.fromJson(json)];
});
});
print
(
'Hitting ot npt
$jsonResponse
'
);
print
(
'Hitting ot npt
$jsonResponse
'
);
}
}
...
@@ -823,19 +833,19 @@ class _Identifystylecode extends State<Identifystylecode> {
...
@@ -823,19 +833,19 @@ class _Identifystylecode extends State<Identifystylecode> {
}
}
class
Stylecode
{
class
Stylecode
{
final
int
?
S
imilarityPercentage
;
final
int
?
s
imilarityPercentage
;
final
String
?
similarImagePath
;
final
String
?
similarImagePath
;
final
String
?
styleCode
;
final
String
?
styleCode
;
Stylecode
({
Stylecode
({
this
.
S
imilarityPercentage
,
this
.
s
imilarityPercentage
,
this
.
similarImagePath
,
this
.
similarImagePath
,
this
.
styleCode
,
this
.
styleCode
,
});
});
factory
Stylecode
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
factory
Stylecode
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
return
Stylecode
(
return
Stylecode
(
S
imilarityPercentage:
json
[
'Similarity Percentage'
]
??
''
,
s
imilarityPercentage:
json
[
'Similarity Percentage'
]
??
''
,
similarImagePath:
json
[
'imageURL'
]
??
''
,
similarImagePath:
json
[
'imageURL'
]
??
''
,
styleCode:
json
[
'Stylecode'
]
??
''
,
styleCode:
json
[
'Stylecode'
]
??
''
,
);
);
...
...
lib/Uploadstylecode.dart
View file @
9d51c707
...
@@ -21,7 +21,6 @@ class _Uploadstylecode extends State<Uploadstylecode> {
...
@@ -21,7 +21,6 @@ class _Uploadstylecode extends State<Uploadstylecode> {
final
ImagePicker
_picker
=
ImagePicker
();
final
ImagePicker
_picker
=
ImagePicker
();
late
List
<
File
>
arraylist
=
[];
late
List
<
File
>
arraylist
=
[];
final
TextEditingController
_stylecode
=
TextEditingController
();
final
TextEditingController
_stylecode
=
TextEditingController
();
XFile
?
image
;
XFile
?
image
;
bool
isloading
=
false
;
bool
isloading
=
false
;
bool
isVisible
=
true
;
bool
isVisible
=
true
;
...
@@ -109,9 +108,6 @@ class _Uploadstylecode extends State<Uploadstylecode> {
...
@@ -109,9 +108,6 @@ class _Uploadstylecode extends State<Uploadstylecode> {
});
});
if
(
imageFile1
!=
null
)
{
if
(
imageFile1
!=
null
)
{
print
(
'Camera Capture ==========>
$imageFile1
'
);
print
(
'Camera Capture ==========>
$imageFile1
'
);
//setState((){
// imagefile = imageFile1;
//});
setState
(()
{
setState
(()
{
isloading
=
true
;
// Set loading state to true
isloading
=
true
;
// Set loading state to true
});
});
...
@@ -219,9 +215,11 @@ class _Uploadstylecode extends State<Uploadstylecode> {
...
@@ -219,9 +215,11 @@ class _Uploadstylecode extends State<Uploadstylecode> {
});
});
}
}
}
catch
(
e
)
{
}
catch
(
e
)
{
if
(
kDebugMode
)
{
print
(
"Error while picking image from camera:
$e
"
);
print
(
"Error while picking image from camera:
$e
"
);
}
}
}
}
}
// 54639
// 54639
Future
<
void
>
_getImageFromGallery
(
BuildContext
context
)
async
{
Future
<
void
>
_getImageFromGallery
(
BuildContext
context
)
async
{
...
...
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