Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2023-156
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
2023-156
2023-156
Commits
33e2ed8a
Commit
33e2ed8a
authored
Jul 24, 2023
by
AvishkaRavishan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated model prediction
parent
e36336a8
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
437 additions
and
0 deletions
+437
-0
lib/disease/test.dart
lib/disease/test.dart
+0
-0
lib/forecast/Forecast.dart
lib/forecast/Forecast.dart
+280
-0
lib/forecast/USD_Filtered.csv
lib/forecast/USD_Filtered.csv
+157
-0
lib/forecast/model.h5
lib/forecast/model.h5
+0
-0
No files found.
lib/disease/test.dart
0 → 100644
View file @
33e2ed8a
lib/forecast/Forecast.dart
View file @
33e2ed8a
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/src/widgets/framework.dart'
;
import
'package:flutter/src/widgets/placeholder.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
import
'package:datetime_picker_formfield_new/datetime_picker_formfield.dart'
;
import
'package:intl/intl.dart'
;
import
'package:cool_dropdown/models/cool_dropdown_item.dart'
;
import
'package:cool_dropdown/cool_dropdown.dart'
;
class
Forecast
extends
StatefulWidget
{
const
Forecast
({
super
.
key
});
@override
State
<
Forecast
>
createState
()
=>
_ForecastState
();
}
class
_ForecastState
extends
State
<
Forecast
>
{
bool
showPrediction
=
true
;
String
usd
=
"--"
;
String
lkr
=
"--"
;
@override
Widget
build
(
BuildContext
context
)
{
var
width
=
MediaQuery
.
of
(
context
).
size
.
width
;
var
height
=
MediaQuery
.
of
(
context
).
size
.
height
;
final
format
=
DateFormat
(
"yyyy-MM-dd"
);
List
<
CoolDropdownItem
<
String
>>
grades
=
[
CoolDropdownItem
(
label:
"Alba"
,
value:
"alba"
,
),
CoolDropdownItem
(
label:
"C-5 Sp"
,
value:
"c5sp"
,
),
CoolDropdownItem
(
label:
"C5"
,
value:
"c5"
,
),
CoolDropdownItem
(
label:
"M-5"
,
value:
"m5"
,
),
CoolDropdownItem
(
label:
"M-4"
,
value:
"m4"
,
),
];
List
<
CoolDropdownItem
<
String
>>
region
=
[
CoolDropdownItem
(
label:
"Galle"
,
value:
"galle"
,
),
CoolDropdownItem
(
label:
"Matara"
,
value:
"matara"
,
),
CoolDropdownItem
(
label:
"Hambantota"
,
value:
"hambantota"
,
),
];
final
gradeDropdownController
=
DropdownController
();
toggleLoadingAndPredict
()
{
setState
(()
{
showPrediction
=
false
;
lkr
=
"3300"
;
usd
=
"10"
;
});
sleep
(
Duration
(
seconds:
4
));
setState
(()
{
showPrediction
=
true
;
});
}
return
Scaffold
(
backgroundColor:
Colors
.
grey
.
shade900
,
appBar:
AppBar
(
backgroundColor:
Colors
.
black
,
title:
Text
(
"Price Forecast"
,
style:
GoogleFonts
.
roboto
(
color:
Colors
.
white
,
fontWeight:
FontWeight
.
bold
,
),
),
leading:
GestureDetector
(
onTap:
()
{
Navigator
.
of
(
context
).
pop
();
},
child:
Icon
(
Icons
.
arrow_back
,
color:
Colors
.
white
,
),
),
),
body:
Container
(
padding:
EdgeInsets
.
fromLTRB
(
20
,
10
,
20
,
0
),
child:
Column
(
children:
[
Card
(
elevation:
10
,
shadowColor:
Colors
.
black38
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
20
,
vertical:
10
,
),
width:
width
,
// height: height / 3,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
DateTimeField
(
format:
format
,
decoration:
InputDecoration
(
labelText:
"Select a day"
,
),
onShowPicker:
(
context
,
currentValue
)
{
return
showDatePicker
(
context:
context
,
firstDate:
DateTime
(
DateTime
.
now
().
year
-
1
,
DateTime
.
now
().
month
,
DateTime
.
now
().
day
,
),
initialDate:
currentValue
??
DateTime
.
now
(),
lastDate:
DateTime
(
2100
),
);
},
),
SizedBox
(
height:
20
,
),
Text
(
"Select a grade"
,
),
SizedBox
(
height:
10
,
),
CoolDropdown
<
String
>(
dropdownList:
grades
,
isMarquee:
false
,
resultOptions:
ResultOptions
(
width:
width
,
),
defaultItem:
CoolDropdownItem
(
label:
"Alba"
,
value:
"alba"
),
dropdownItemOptions:
DropdownItemOptions
(),
controller:
gradeDropdownController
,
onChange:
(
value
)
{
print
(
value
);
}),
SizedBox
(
height:
20
,
),
Text
(
"Select your region"
,
),
SizedBox
(
height:
10
,
),
CoolDropdown
<
String
>(
dropdownList:
region
,
isMarquee:
false
,
resultOptions:
ResultOptions
(
width:
width
,
),
defaultItem:
CoolDropdownItem
(
label:
"Galle"
,
value:
"galle"
),
dropdownItemOptions:
DropdownItemOptions
(),
controller:
gradeDropdownController
,
onChange:
(
value
)
{
print
(
value
);
}),
SizedBox
(
height:
30
,
),
GestureDetector
(
onTap:
()
{
setState
(()
{
showPrediction
=
false
;
lkr
=
"3600"
;
usd
=
"10"
;
});
print
(
"ds"
);
// sleep(Duration(seconds: 4));
setState
(()
{
showPrediction
=
true
;
});
},
child:
Container
(
width:
width
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
20
),
color:
Colors
.
lime
.
shade700
,
),
child:
Center
(
child:
Text
(
"Predict"
,
style:
GoogleFonts
.
roboto
(
color:
Colors
.
white
,
fontWeight:
FontWeight
.
w400
,
fontSize:
width
/
22
,
),
textAlign:
TextAlign
.
center
,
),
),
),
),
SizedBox
(
height:
10
,
),
],
)),
),
SizedBox
(
height:
40
,
),
AnimatedCrossFade
(
firstChild:
Container
(
child:
Column
(
children:
[
Text
(
"
\$
"
+
usd
,
style:
GoogleFonts
.
roboto
(
fontSize:
width
/
10
,
color:
Colors
.
lime
.
shade900
,
fontWeight:
FontWeight
.
bold
,
),
),
Text
(
"≈"
,
style:
GoogleFonts
.
roboto
(
fontSize:
width
/
15
,
color:
Colors
.
white70
,
),
),
Text
(
"LKR "
+
lkr
,
style:
GoogleFonts
.
roboto
(
fontSize:
width
/
10
,
color:
Colors
.
lime
.
shade900
,
fontWeight:
FontWeight
.
bold
,
),
),
Text
(
"Price for 1 kilogram of Cinnamon in
\n
Sri Lankan Rupees (LKR)"
,
textAlign:
TextAlign
.
center
,
style:
GoogleFonts
.
roboto
(
color:
Colors
.
white70
,
fontSize:
width
/
19
,
),
),
],
),
),
secondChild:
Text
(
"Loading...."
),
crossFadeState:
showPrediction
?
CrossFadeState
.
showFirst
:
CrossFadeState
.
showSecond
,
duration:
Duration
(
milliseconds:
500
))
],
),
),
);
}
}
lib/forecast/USD_Filtered.csv
0 → 100644
View file @
33e2ed8a
This diff is collapsed.
Click to expand it.
lib/forecast/model.h5
0 → 100644
View file @
33e2ed8a
File added
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