Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
22_23-J 35
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
22_23-J 35
22_23-J 35
Commits
46c1c5ae
Commit
46c1c5ae
authored
May 11, 2023
by
Chamindu Madushan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added new home designed to card view
parent
93028673
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
202 additions
and
0 deletions
+202
-0
HomePage.dart
HomePage.dart
+202
-0
No files found.
HomePage.dart
0 → 100644
View file @
46c1c5ae
import
'package:flutter/material.dart'
;
import
'package:smart_poultry_farm/screens/options.dart'
;
import
'package:smart_poultry_farm/util/job_card.dart'
;
import
'package:smart_poultry_farm/util/prediction.dart'
;
class
HomePage
extends
StatefulWidget
{
@override
State
<
HomePage
>
createState
()
=>
_HomePageState
();
}
class
_HomePageState
extends
State
<
HomePage
>
{
final
List
jobsForYou
=
[
[
'Uberooooo'
,
'Egg production'
,
'lib/icons/egg.png'
,
45
],
[
'Google'
,
'Tempurature'
,
'lib/icons/temperature.png'
,
85
],
[
'Apple'
,
'humedity'
,
'lib/icons/temp.png'
,
95
],
];
final
List
predictions
=
[
[
'Tempurature'
,
'Try to keep this 12-16 range'
,
'lib/icons/temperature.png'
,
20
],
[
'humedity'
,
'Try to keep this 12-16 range'
,
'lib/icons/temp.png'
,
95
],
[
'Egg production'
,
'this is optimal value'
,
'lib/icons/egg.png'
,
44
],
];
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
backgroundColor:
Colors
.
white
,
// grey[200]
body:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
const
SizedBox
(
height:
55
,
),
//appBar
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
25.0
),
child:
GestureDetector
(
child:
Container
(
height:
50
,
padding:
EdgeInsets
.
all
(
10
),
decoration:
BoxDecoration
(
border:
Border
.
all
(
color:
Colors
.
white
),
borderRadius:
BorderRadius
.
circular
(
12
),
color:
Colors
.
grey
[
200
]),
child:
Image
.
asset
(
'lib/icons/menu_left.png'
,
),
),
onTap:
(){
print
(
'options clicked'
);
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
Options
()));
},
),
),
const
SizedBox
(
height:
20
,
),
//decover a new path
const
Padding
(
padding:
EdgeInsets
.
only
(
left:
25.0
),
child:
Text
(
'Hi Good Evening ..'
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
fontSize:
26
),
),
),
const
SizedBox
(
height:
25
,
),
//Search bar
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
25.0
),
child:
Row
(
children:
[
Expanded
(
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
grey
[
200
],
border:
Border
.
all
(
color:
Colors
.
white
),
borderRadius:
BorderRadius
.
circular
(
12
),
),
child:
Row
(
children:
[
const
SizedBox
(
width:
8
,
),
Container
(
height:
30
,
child:
Image
.
asset
(
'lib/icons/search.png'
),
),
const
SizedBox
(
width:
8
,
),
const
Expanded
(
child:
TextField
(
decoration:
InputDecoration
(
border:
InputBorder
.
none
,
hintText:
'Search what you want know..'
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
bold
)),
),
),
],
),
),
),
const
SizedBox
(
width:
10
,
),
Container
(
height:
50
,
child:
Image
.
asset
(
'lib/icons/preferences.png'
,
),
decoration:
BoxDecoration
(
color:
Colors
.
grey
[
900
],
borderRadius:
BorderRadius
.
circular
(
12
),
),
)
],
),
),
const
SizedBox
(
height:
50
,
),
//for you job cards
const
Padding
(
padding:
EdgeInsets
.
only
(
left:
25.0
),
child:
Text
(
'Current Status of Poultry Hub'
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
fontSize:
26
),
),
),
const
SizedBox
(
height:
20
,
),
Container
(
height:
160
,
color:
Colors
.
white
,
child:
ListView
.
builder
(
itemCount:
jobsForYou
.
length
,
scrollDirection:
Axis
.
horizontal
,
itemBuilder:
(
context
,
index
)
{
return
JobCard
(
companyName:
jobsForYou
[
index
][
0
],
jobTitle:
jobsForYou
[
index
][
1
],
logoImagePath:
jobsForYou
[
index
][
2
],
hourlyRate:
jobsForYou
[
index
][
3
],
);
},
),
),
//Predection Details View
const
SizedBox
(
height:
30
,
),
const
Padding
(
padding:
EdgeInsets
.
only
(
left:
25.0
),
child:
Text
(
'Future Predections'
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
fontSize:
26
),
),
),
const
SizedBox
(
height:
10
,
),
Expanded
(
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
25.0
),
child:
ListView
.
builder
(
itemCount:
predictions
.
length
,
itemBuilder:
(
context
,
index
)
{
return
PredectionsResults
(
predicType:
predictions
[
index
][
0
],
result:
predictions
[
index
][
1
],
lableImagePath:
predictions
[
index
][
2
],
predicValue:
predictions
[
index
][
3
],
);
},
),
))
],
),
);
}
}
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