Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2020-045
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
2020-045
2020-045
Commits
bad59434
Commit
bad59434
authored
Sep 16, 2020
by
Boteju W.J.M.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
09/16-flutter
parent
f0dfc3c1
Pipeline
#1493
canceled with stages
Changes
18
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
799 additions
and
652 deletions
+799
-652
fitnessapp/lib/Screens/WalkingPatternRecognition/MainNavigation.dart
...lib/Screens/WalkingPatternRecognition/MainNavigation.dart
+77
-0
fitnessapp/lib/Screens/WalkingPatternRecognition/Navigation.dart
...app/lib/Screens/WalkingPatternRecognition/Navigation.dart
+86
-0
fitnessapp/lib/Screens/WalkingPatternRecognition/annual_details_screen.dart
...eens/WalkingPatternRecognition/annual_details_screen.dart
+61
-56
fitnessapp/lib/Screens/WalkingPatternRecognition/daily_details_screen.dart
...reens/WalkingPatternRecognition/daily_details_screen.dart
+79
-91
fitnessapp/lib/Screens/WalkingPatternRecognition/home.dart
fitnessapp/lib/Screens/WalkingPatternRecognition/home.dart
+69
-0
fitnessapp/lib/Screens/WalkingPatternRecognition/home_page.dart
...sapp/lib/Screens/WalkingPatternRecognition/home_page.dart
+69
-0
fitnessapp/lib/Screens/WalkingPatternRecognition/monthly_details_screen.dart
...ens/WalkingPatternRecognition/monthly_details_screen.dart
+82
-77
fitnessapp/lib/Screens/WalkingPatternRecognition/service.dart
...essapp/lib/Screens/WalkingPatternRecognition/service.dart
+25
-6
fitnessapp/lib/Screens/WalkingPatternRecognition/weekly_details_screen.dart
...eens/WalkingPatternRecognition/weekly_details_screen.dart
+62
-56
fitnessapp/lib/Screens/WalkingPatternRecognition/widgets/annual_chart.dart
...reens/WalkingPatternRecognition/widgets/annual_chart.dart
+71
-56
fitnessapp/lib/Screens/WalkingPatternRecognition/widgets/daily_chart.dart
...creens/WalkingPatternRecognition/widgets/daily_chart.dart
+40
-23
fitnessapp/lib/Screens/WalkingPatternRecognition/widgets/monthly_chart.dart
...eens/WalkingPatternRecognition/widgets/monthly_chart.dart
+24
-19
fitnessapp/lib/Screens/WalkingPatternRecognition/widgets/weekly_chart.dart
...reens/WalkingPatternRecognition/widgets/weekly_chart.dart
+24
-19
fitnessapp/lib/constants.dart
fitnessapp/lib/constants.dart
+0
-1
fitnessapp/lib/loading.dart
fitnessapp/lib/loading.dart
+18
-0
fitnessapp/lib/main.dart
fitnessapp/lib/main.dart
+2
-7
fitnessapp/pubspec.lock
fitnessapp/pubspec.lock
+9
-238
fitnessapp/pubspec.yaml
fitnessapp/pubspec.yaml
+1
-3
No files found.
fitnessapp/lib/Screens/WalkingPatternRecognition/MainNavigation.dart
0 → 100644
View file @
bad59434
import
'package:fitnessapp/Screens/WalkingPatternRecognition/home.dart'
;
import
'package:fitnessapp/constants.dart'
;
import
'package:flutter/material.dart'
;
class
MainNavigation
extends
StatefulWidget
{
Function
open
;
MainNavigation
(
this
.
open
);
@override
_MainNavigationState
createState
()
=>
_MainNavigationState
();
}
class
_MainNavigationState
extends
State
<
MainNavigation
>
with
TickerProviderStateMixin
{
TabController
_tabController
;
@override
void
initState
()
{
super
.
initState
();
_tabController
=
TabController
(
length:
2
,
vsync:
this
);
}
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
child:
SingleChildScrollView
(
child:
Column
(
children:
<
Widget
>[
Padding
(
padding:
EdgeInsets
.
only
(
top:
MediaQuery
.
of
(
context
).
padding
.
top
,
),
),
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
20
,
),
child:
SizedBox
(
height:
60
,
width:
300
,
child:
TabBar
(
indicatorColor:
kPrimaryColor
,
isScrollable:
true
,
labelColor:
Colors
.
grey
,
controller:
_tabController
,
labelPadding:
EdgeInsets
.
symmetric
(
horizontal:
50.0
),
tabs:
<
Widget
>[
Tab
(
child:
Text
(
"Walking"
),
),
Tab
(
child:
Text
(
"Running"
),
)
],
),
),
),
SizedBox
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
-
80
,
child:
TabBarView
(
controller:
_tabController
,
children:
<
Widget
>[
Home
(),
Home
()],
),
)
],
),
),
);
}
}
fitnessapp/lib/Screens/WalkingPatternRecognition/Navigation.dart
0 → 100644
View file @
bad59434
import
'dart:io'
;
import
'package:fitnessapp/constants.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:fitnessapp/Screens/WalkingPatternRecognition/annual_details_screen.dart'
;
import
'package:fitnessapp/Screens/WalkingPatternRecognition/monthly_details_screen.dart'
;
import
'package:fitnessapp/Screens/WalkingPatternRecognition/weekly_details_screen.dart'
;
import
'package:fitnessapp/Screens/WalkingPatternRecognition/daily_details_screen.dart'
;
class
Navigation
extends
StatefulWidget
{
Function
open
;
Navigation
(
this
.
open
);
@override
_NavigationState
createState
()
=>
_NavigationState
();
}
class
_NavigationState
extends
State
<
Navigation
>
with
TickerProviderStateMixin
{
TabController
_tabController
;
@override
void
initState
()
{
super
.
initState
();
_tabController
=
TabController
(
length:
4
,
vsync:
this
);
}
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
child:
SingleChildScrollView
(
child:
Column
(
children:
<
Widget
>[
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
15
,
),
child:
SizedBox
(
height:
60
,
width:
300
,
child:
TabBar
(
indicatorColor:
kPrimaryColor
,
isScrollable:
true
,
labelColor:
Colors
.
grey
,
controller:
_tabController
,
tabs:
<
Widget
>[
Tab
(
child:
Text
(
"Daily"
),
),
Tab
(
child:
Text
(
"Weekly"
),
),
Tab
(
child:
Text
(
"Monthly"
),
),
Tab
(
child:
Text
(
"Anually"
),
),
],
),
),
),
SizedBox
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
-
80
,
child:
TabBarView
(
controller:
_tabController
,
children:
<
Widget
>[
DailyDetailsScreen
(),
WeeklyDetailsScreen
(),
MonthlyDetailsScreen
(),
AnnualDetailsScreen
(),
],
),
)
],
),
),
);
}
}
fitnessapp/lib/Screens/WalkingPatternRecognition/annual_details_screen.dart
View file @
bad59434
...
...
@@ -4,6 +4,7 @@ import 'package:fitnessapp/Screens/WalkingPatternRecognition/service.dart';
import
'dart:convert'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:fitnessapp/loading.dart'
;
class
AnnualDetailsScreen
extends
StatefulWidget
{
@override
...
...
@@ -11,6 +12,7 @@ class AnnualDetailsScreen extends StatefulWidget {
}
class
_AnnualDetailsScreenState
extends
State
<
AnnualDetailsScreen
>
{
bool
loading
=
true
;
String
year
;
static
dynamic
value
,
highlights
,
activity
=
[];
int
hrs
,
mins
;
...
...
@@ -68,6 +70,7 @@ class _AnnualDetailsScreenState extends State<AnnualDetailsScreen> {
dynamic
data
=
jsonDecode
(
responseBody
);
setState
(()
{
highlights
=
data
[
0
][
'Highlights'
];
loading
=
false
;
});
});
}
...
...
@@ -80,68 +83,70 @@ class _AnnualDetailsScreenState extends State<AnnualDetailsScreen> {
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
resizeToAvoidBottomPadding:
false
,
appBar:
buildDetailsAppBar
(
context
),
body:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
20
),
child:
SingleChildScrollView
(
child:
Column
(
children:
<
Widget
>[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
20
,
vertical:
25
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
boxShadow:
[
BoxShadow
(
offset:
Offset
(
0
,
21
),
blurRadius:
53
,
color:
Colors
.
black
.
withOpacity
(
0.05
),
),
],
),
return
loading
?
Loading
()
:
Scaffold
(
resizeToAvoidBottomPadding:
false
,
body:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
20
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
buildDateTitle
(),
SizedBox
(
height:
10
),
buildTotalTitle
(),
SizedBox
(
height:
10
),
buildAmountTitle
(),
SizedBox
(
height:
40
),
AnnualChart
(),
SizedBox
(
height:
15
),
],
),
),
SizedBox
(
height:
20
),
Container
(
padding:
EdgeInsets
.
all
(
20
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
boxShadow:
[
BoxShadow
(
offset:
Offset
(
0
,
21
),
blurRadius:
54
,
color:
Colors
.
black
.
withOpacity
(
0.05
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
20
,
vertical:
25
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
boxShadow:
[
BoxShadow
(
offset:
Offset
(
0
,
21
),
blurRadius:
53
,
color:
Colors
.
black
.
withOpacity
(
0.05
),
),
],
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
buildDateTitle
(),
SizedBox
(
height:
10
),
buildTotalTitle
(),
SizedBox
(
height:
10
),
buildAmountTitle
(),
SizedBox
(
height:
40
),
AnnualChart
(),
SizedBox
(
height:
15
),
],
),
),
],
),
child:
Column
(
children:
<
Widget
>[
highlightsTitle
(),
SizedBox
(
height:
20
),
highlightsContent
(),
Container
(
padding:
EdgeInsets
.
all
(
20
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
boxShadow:
[
BoxShadow
(
offset:
Offset
(
0
,
21
),
blurRadius:
54
,
color:
Colors
.
black
.
withOpacity
(
0.05
),
),
],
),
child:
Column
(
children:
<
Widget
>[
highlightsTitle
(),
SizedBox
(
height:
20
),
highlightsContent
(),
],
),
),
],
),
),
],
),
),
),
);
),
);
}
Row
buildDateTitle
()
{
...
...
@@ -198,7 +203,7 @@ class _AnnualDetailsScreenState extends State<AnnualDetailsScreen> {
fontSize:
20
,
),
)
else
if
(
mins
>
1
)
else
if
(
mins
>
=
1
)
Text
(
"
$hrs
hrs
$mins
mins"
,
style:
TextStyle
(
...
...
fitnessapp/lib/Screens/WalkingPatternRecognition/daily_details_screen.dart
View file @
bad59434
import
'package:fitnessapp/constants.dart'
;
import
'package:fitnessapp/Screens/WalkingPatternRecognition/widgets/daily_chart.dart'
;
import
'package:fitnessapp/Screens/WalkingPatternRecognition/service.dart'
;
import
'package:fitnessapp/loading.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'dart:convert'
;
...
...
@@ -11,8 +12,9 @@ class DailyDetailsScreen extends StatefulWidget {
}
class
_DailyDetailsScreenState
extends
State
<
DailyDetailsScreen
>
{
bool
loading
=
true
;
String
finalDate
=
''
;
static
dynamic
timePeriod
=
[];
static
dynamic
value
=
[];
static
dynamic
highlights
=
[];
static
dynamic
activity
=
[];
int
hrs
,
mins
;
...
...
@@ -34,46 +36,52 @@ class _DailyDetailsScreenState extends State<DailyDetailsScreen> {
];
var
date
=
new
DateTime
.
now
().
toString
();
var
dateParse
=
DateTime
.
parse
(
date
);
var
month
=
months
[
dateParse
.
month
-
1
];
var
formattedDate
=
"
${dateParse.day}
$month
${dateParse.year}
"
;
String
datee
=
"
${dateParse.year}
-0
${dateParse.month}
-
${dateParse.day}
"
;
setState
(()
{
finalDate
=
formattedDate
.
toString
();
});
getTotalMinutes
();
getHighlightsPerDay
();
getActivityNameById
();
getTotalMinutes
(
datee
);
getHighlightsPerDay
(
datee
);
}
getActivityNameById
()
async
{
SearchService
.
getActivityNameById
().
then
((
responseBody
)
{
print
(
responseBody
);
dynamic
data
=
jsonDecode
(
responseBody
);
setState
(()
{
activity
=
data
[
0
][
'activity'
];
print
(
activity
);
});
});
}
getTotalMinutes
()
async
{
SearchService
.
getTotalMinutesPerDay
().
then
((
responseBody
)
{
getTotalMinutes
(
day
)
async
{
SearchService
.
getTotalMinutesPerDay
(
day
).
then
((
responseBody
)
{
dynamic
data
=
jsonDecode
(
responseBody
);
setState
(()
{
timePeriod
=
data
[
0
][
'minutes per day'
];
timePeriod
=
timePeriod
/
60
;
value
=
data
[
0
][
'minutes per day'
];
if
(
value
!=
0
)
{
value
=
value
.
toInt
();
hrs
=
value
~/
60
;
mins
=
value
%
60
;
}
else
{
hrs
=
0
;
mins
=
0
;
}
});
});
}
getHighlightsPerDay
()
async
{
SearchService
.
getHighlightsPerDay
().
then
((
responseBody
)
{
getHighlightsPerDay
(
datee
)
async
{
SearchService
.
getHighlightsPerDay
(
datee
).
then
((
responseBody
)
{
dynamic
data
=
jsonDecode
(
responseBody
);
setState
(()
{
highlights
=
data
[
0
][
'Highlights'
];
loading
=
false
;
});
});
}
...
...
@@ -86,68 +94,70 @@ class _DailyDetailsScreenState extends State<DailyDetailsScreen> {
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
resizeToAvoidBottomPadding:
false
,
appBar:
buildDetailsAppBar
(
context
),
body:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
20
),
child:
SingleChildScrollView
(
child:
Column
(
children:
<
Widget
>[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
20
,
vertical:
25
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
boxShadow:
[
BoxShadow
(
offset:
Offset
(
0
,
21
),
blurRadius:
53
,
color:
Colors
.
black
.
withOpacity
(
0.05
),
),
],
),
return
loading
?
Loading
()
:
Scaffold
(
resizeToAvoidBottomPadding:
false
,
body:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
20
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
buildDateTitle
(),
SizedBox
(
height:
10
),
buildTotalTitle
(),
SizedBox
(
height:
10
),
buildAmountTitle
(),
SizedBox
(
height:
40
),
DailyChart
(),
SizedBox
(
height:
15
),
],
),
),
SizedBox
(
height:
20
),
Container
(
padding:
EdgeInsets
.
all
(
20
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
boxShadow:
[
BoxShadow
(
offset:
Offset
(
0
,
21
),
blurRadius:
54
,
color:
Colors
.
black
.
withOpacity
(
0.05
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
20
,
vertical:
25
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
boxShadow:
[
BoxShadow
(
offset:
Offset
(
0
,
21
),
blurRadius:
53
,
color:
Colors
.
black
.
withOpacity
(
0.05
),
),
],
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
buildDateTitle
(),
SizedBox
(
height:
10
),
buildTotalTitle
(),
SizedBox
(
height:
10
),
buildAmountTitle
(),
SizedBox
(
height:
40
),
DailyChart
(),
SizedBox
(
height:
15
),
],
),
),
],
),
child:
Column
(
children:
<
Widget
>[
highlightsTitle
(),
SizedBox
(
height:
20
),
highlightsContent
(),
Container
(
padding:
EdgeInsets
.
all
(
20
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
boxShadow:
[
BoxShadow
(
offset:
Offset
(
0
,
21
),
blurRadius:
54
,
color:
Colors
.
black
.
withOpacity
(
0.05
),
),
],
),
child:
Column
(
children:
<
Widget
>[
highlightsTitle
(),
SizedBox
(
height:
20
),
highlightsContent
(),
],
),
),
],
),
),
],
),
),
),
);
),
);
}
Row
buildDateTitle
()
{
...
...
@@ -204,7 +214,7 @@ class _DailyDetailsScreenState extends State<DailyDetailsScreen> {
fontSize:
20
,
),
)
else
if
(
mins
>
1
)
else
if
(
mins
>
=
1
)
Text
(
"
$hrs
hrs
$mins
mins"
,
style:
TextStyle
(
...
...
@@ -248,26 +258,4 @@ class _DailyDetailsScreenState extends State<DailyDetailsScreen> {
],
);
}
AppBar
buildDetailsAppBar
(
BuildContext
context
)
{
return
AppBar
(
backgroundColor:
kBackgroundColor
,
elevation:
0
,
leading:
IconButton
(
icon:
Icon
(
Icons
.
arrow_back_ios
,
color:
kPrimaryColor
,
),
onPressed:
()
{
Navigator
.
pop
(
context
);
},
),
actions:
<
Widget
>[
IconButton
(
icon:
SvgPicture
.
asset
(
"assets/icons/search.svg"
),
onPressed:
()
{},
),
],
);
}
}
fitnessapp/lib/Screens/WalkingPatternRecognition/home.dart
0 → 100644
View file @
bad59434
import
'package:flutter/material.dart'
;
import
'Navigation.dart'
;
class
Home
extends
StatefulWidget
{
@override
_HomeState
createState
()
=>
_HomeState
();
}
class
_HomeState
extends
State
<
Home
>
{
double
left
=
0
;
double
direction
;
double
MAX_LEFT
=
0
;
@override
void
initState
()
{
super
.
initState
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
body:
Builder
(
builder:
(
context
)
{
MAX_LEFT
=
MediaQuery
.
of
(
context
).
size
.
width
*
1.0
-
80
;
return
_buildBody
();
},
),
);
}
Widget
_buildBody
()
{
return
GestureDetector
(
onHorizontalDragUpdate:
(
update
)
{
left
=
left
+
update
.
delta
.
dx
;
direction
=
update
.
delta
.
direction
;
if
(
left
<=
0
)
{
left
=
0
;
}
if
(
left
>
MAX_LEFT
)
{
left
=
MAX_LEFT
;
}
setState
(()
{});
},
onHorizontalDragEnd:
(
end
)
{},
child:
Container
(
color:
Color
(
0xFF0D8E53
),
child:
Stack
(
children:
<
Widget
>[
Positioned
(
left:
left
,
top:
left
*
0.2
,
bottom:
left
*
0.2
/
2
,
child:
Navigation
(
open
),
),
],
),
),
);
}
void
open
()
{
if
(
left
==
MAX_LEFT
)
{
direction
=
1
;
}
else
{
direction
=
0
;
}
}
}
fitnessapp/lib/Screens/WalkingPatternRecognition/home_page.dart
0 → 100644
View file @
bad59434
import
'package:flutter/material.dart'
;
import
'MainNavigation.dart'
;
class
HomePage
extends
StatefulWidget
{
@override
_HomePageState
createState
()
=>
_HomePageState
();
}
class
_HomePageState
extends
State
<
HomePage
>
{
double
left
=
0
;
double
direction
;
double
MAX_LEFT
=
0
;
@override
void
initState
()
{
super
.
initState
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
body:
Builder
(
builder:
(
context
)
{
MAX_LEFT
=
MediaQuery
.
of
(
context
).
size
.
width
*
1.0
-
80
;
return
_buildBody
();
},
),
);
}
Widget
_buildBody
()
{
return
GestureDetector
(
onHorizontalDragUpdate:
(
update
)
{
left
=
left
+
update
.
delta
.
dx
;
direction
=
update
.
delta
.
direction
;
if
(
left
<=
0
)
{
left
=
0
;
}
if
(
left
>
MAX_LEFT
)
{
left
=
MAX_LEFT
;
}
setState
(()
{});
},
onHorizontalDragEnd:
(
end
)
{},
child:
Container
(
color:
Color
(
0xFF0D8E53
),
child:
Stack
(
children:
<
Widget
>[
Positioned
(
left:
left
,
top:
left
*
0.2
,
bottom:
left
*
0.2
/
2
,
child:
MainNavigation
(
open
),
),
],
),
),
);
}
void
open
()
{
if
(
left
==
MAX_LEFT
)
{
direction
=
1
;
}
else
{
direction
=
0
;
}
}
}
fitnessapp/lib/Screens/WalkingPatternRecognition/monthly_details_screen.dart
View file @
bad59434
...
...
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import
'package:flutter_svg/svg.dart'
;
import
'package:fitnessapp/Screens/WalkingPatternRecognition/service.dart'
;
import
'dart:convert'
;
import
'package:fitnessapp/loading.dart'
;
class
MonthlyDetailsScreen
extends
StatefulWidget
{
@override
...
...
@@ -11,6 +12,7 @@ class MonthlyDetailsScreen extends StatefulWidget {
}
class
_MonthlyDetailsScreenState
extends
State
<
MonthlyDetailsScreen
>
{
bool
loading
=
true
;
String
monthAndYear
,
month
=
''
;
int
hrs
,
mins
;
static
dynamic
value
,
activity
,
highlights
=
[];
...
...
@@ -70,6 +72,7 @@ class _MonthlyDetailsScreenState extends State<MonthlyDetailsScreen> {
dynamic
data
=
jsonDecode
(
responseBody
);
setState
(()
{
highlights
=
data
[
0
][
'Highlights'
];
loading
=
false
;
});
});
}
...
...
@@ -82,68 +85,70 @@ class _MonthlyDetailsScreenState extends State<MonthlyDetailsScreen> {
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
resizeToAvoidBottomPadding:
false
,
appBar:
buildDetailsAppBar
(
context
),
body:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
20
),
child:
SingleChildScrollView
(
child:
Column
(
children:
<
Widget
>[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
20
,
vertical:
25
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
boxShadow:
[
BoxShadow
(
offset:
Offset
(
0
,
21
),
blurRadius:
53
,
color:
Colors
.
black
.
withOpacity
(
0.05
),
),
],
),
return
loading
?
Loading
()
:
Scaffold
(
resizeToAvoidBottomPadding:
false
,
body:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
20
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
buildDateTitle
(),
SizedBox
(
height:
10
),
buildTotalTitle
(),
SizedBox
(
height:
10
),
buildAmountTitle
(),
SizedBox
(
height:
40
),
MonthlyChart
(),
SizedBox
(
height:
15
),
],
),
),
SizedBox
(
height:
20
),
Container
(
padding:
EdgeInsets
.
all
(
20
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
boxShadow:
[
BoxShadow
(
offset:
Offset
(
0
,
21
),
blurRadius:
54
,
color:
Colors
.
black
.
withOpacity
(
0.05
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
20
,
vertical:
25
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
boxShadow:
[
BoxShadow
(
offset:
Offset
(
0
,
21
),
blurRadius:
53
,
color:
Colors
.
black
.
withOpacity
(
0.05
),
),
],
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
buildDateTitle
(),
SizedBox
(
height:
10
),
buildTotalTitle
(),
SizedBox
(
height:
10
),
buildAmountTitle
(),
SizedBox
(
height:
40
),
MonthlyChart
(),
SizedBox
(
height:
15
),
],
),
),
],
),
child:
Column
(
children:
<
Widget
>[
highlightsTitle
(),
SizedBox
(
height:
20
),
highlightsContent
(),
Container
(
padding:
EdgeInsets
.
all
(
20
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
boxShadow:
[
BoxShadow
(
offset:
Offset
(
0
,
21
),
blurRadius:
54
,
color:
Colors
.
black
.
withOpacity
(
0.05
),
),
],
),
child:
Column
(
children:
<
Widget
>[
highlightsTitle
(),
SizedBox
(
height:
20
),
highlightsContent
(),
],
),
),
],
),
),
],
),
),
),
);
),
);
}
Row
buildDateTitle
()
{
...
...
@@ -200,7 +205,7 @@ class _MonthlyDetailsScreenState extends State<MonthlyDetailsScreen> {
fontSize:
20
,
),
)
else
if
(
mins
>
1
)
else
if
(
mins
>
=
1
)
Text
(
"
$hrs
hrs
$mins
mins"
,
style:
TextStyle
(
...
...
@@ -245,25 +250,25 @@ class _MonthlyDetailsScreenState extends State<MonthlyDetailsScreen> {
);
}
AppBar
buildDetailsAppBar
(
BuildContext
context
)
{
return
AppBar
(
backgroundColor:
kBackgroundColor
,
elevation:
0
,
leading:
IconButton
(
icon:
Icon
(
Icons
.
arrow_back_ios
,
color:
kPrimaryColor
,
),
onPressed:
()
{
Navigator
.
pop
(
context
);
},
),
actions:
<
Widget
>[
IconButton
(
icon:
SvgPicture
.
asset
(
"assets/icons/search.svg"
),
onPressed:
()
{},
),
],
);
}
//
AppBar buildDetailsAppBar(BuildContext context) {
//
return AppBar(
//
backgroundColor: kBackgroundColor,
//
elevation: 0,
//
leading: IconButton(
//
icon: Icon(
//
Icons.arrow_back_ios,
//
color: kPrimaryColor,
//
),
//
onPressed: () {
//
Navigator.pop(context);
//
},
//
),
//
actions: <Widget>[
//
IconButton(
//
icon: SvgPicture.asset("assets/icons/search.svg"),
//
onPressed: () {},
//
),
//
],
//
);
//
}
}
fitnessapp/lib/Screens/WalkingPatternRecognition/service.dart
View file @
bad59434
...
...
@@ -2,18 +2,37 @@ import 'package:http/http.dart' as http;
import
'dart:convert'
;
class
SearchService
{
static
String
ip
=
'http://
localhost:808
0'
;
static
String
ip
=
'http://
192.168.1.10:800
0'
;
static
String
username
=
'Janadi'
;
static
String
password
=
'janadi2.'
;
static
String
basicAuth
=
'Basic '
+
base64Encode
(
utf8
.
encode
(
'
$username
:
$password
'
));
//Get Readings Evey Minute
static
Future
<
String
>
getCurrentActivity
()
async
{
String
url
=
'
$ip
/getCurrentActivity'
;
var
body
=
jsonEncode
({
"id"
:
1
,
});
http
.
Response
response
=
await
http
.
post
(
url
,
headers:
{
"Content-Type"
:
"application/json"
,
'authorization'
:
basicAuth
},
body:
body
)
.
then
((
http
.
Response
response
)
{
return
response
;
});
return
response
.
body
;
}
//Daily
static
Future
<
String
>
getActivityNameById
()
async
{
String
url
=
'
$ip
/getActivityNameById'
;
var
body
=
jsonEncode
({
"id"
:
1
,
"id"
:
2
,
});
http
.
Response
response
=
await
http
.
post
(
url
,
...
...
@@ -28,9 +47,9 @@ class SearchService {
return
response
.
body
;
}
static
Future
<
String
>
getTotalMinutesPerDay
()
async
{
static
Future
<
String
>
getTotalMinutesPerDay
(
day
)
async
{
String
url
=
'
$ip
/getTotalMinutesPerDay'
;
var
body
=
jsonEncode
({
"activity"
:
2
,
"dog"
:
1
,
"date"
:
"2020-07-01"
});
var
body
=
jsonEncode
({
"activity"
:
2
,
"dog"
:
1
,
"date"
:
day
});
http
.
Response
response
=
await
http
.
post
(
url
,
headers:
{
...
...
@@ -44,9 +63,9 @@ class SearchService {
return
response
.
body
;
}
static
Future
<
String
>
getHighlightsPerDay
()
async
{
static
Future
<
String
>
getHighlightsPerDay
(
date
)
async
{
String
url
=
'
$ip
/highlightsPerDay'
;
var
body
=
jsonEncode
({
"activity"
:
2
,
"dog"
:
1
,
"date"
:
"2020-07-01"
});
var
body
=
jsonEncode
({
"activity"
:
2
,
"dog"
:
1
,
"date"
:
date
});
http
.
Response
response
=
await
http
.
post
(
url
,
headers:
{
...
...
fitnessapp/lib/Screens/WalkingPatternRecognition/weekly_details_screen.dart
View file @
bad59434
...
...
@@ -6,6 +6,7 @@ import 'package:flutter_svg/svg.dart';
import
'dart:convert'
;
import
'package:jiffy/jiffy.dart'
;
import
'package:intl/intl.dart'
;
import
'package:fitnessapp/loading.dart'
;
class
WeeklyDetailsScreen
extends
StatefulWidget
{
@override
...
...
@@ -13,6 +14,7 @@ class WeeklyDetailsScreen extends StatefulWidget {
}
class
_WeeklyDetailsScreenState
extends
State
<
WeeklyDetailsScreen
>
{
bool
loading
=
true
;
DateTime
startDate
,
endDate
;
String
finalStartDate
,
finalEndDate
;
static
dynamic
activity
=
[];
...
...
@@ -100,6 +102,7 @@ class _WeeklyDetailsScreenState extends State<WeeklyDetailsScreen> {
dynamic
data
=
jsonDecode
(
responseBody
);
setState
(()
{
highlights
=
data
[
0
][
'Highlights'
];
loading
=
false
;
});
});
}
...
...
@@ -112,68 +115,71 @@ class _WeeklyDetailsScreenState extends State<WeeklyDetailsScreen> {
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
resizeToAvoidBottomPadding:
false
,
appBar:
buildDetailsAppBar
(
context
),
body:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
20
),
child:
SingleChildScrollView
(
child:
Column
(
children:
<
Widget
>[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
20
,
vertical:
25
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
boxShadow:
[
BoxShadow
(
offset:
Offset
(
0
,
21
),
blurRadius:
53
,
color:
Colors
.
black
.
withOpacity
(
0.05
),
),
],
),
return
loading
?
Loading
()
:
Scaffold
(
resizeToAvoidBottomPadding:
false
,
// appBar: buildDetailsAppBar(context),
body:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
20
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
buildDateTitle
(),
SizedBox
(
height:
10
),
buildTotalTitle
(),
SizedBox
(
height:
10
),
buildAmountTitle
(),
SizedBox
(
height:
50
),
WeeklyChart
(),
SizedBox
(
height:
15
),
],
),
),
SizedBox
(
height:
20
),
Container
(
padding:
EdgeInsets
.
all
(
20
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
boxShadow:
[
BoxShadow
(
offset:
Offset
(
0
,
21
),
blurRadius:
54
,
color:
Colors
.
black
.
withOpacity
(
0.05
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
20
,
vertical:
25
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
boxShadow:
[
BoxShadow
(
offset:
Offset
(
0
,
21
),
blurRadius:
53
,
color:
Colors
.
black
.
withOpacity
(
0.05
),
),
],
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
buildDateTitle
(),
SizedBox
(
height:
10
),
buildTotalTitle
(),
SizedBox
(
height:
10
),
buildAmountTitle
(),
SizedBox
(
height:
50
),
WeeklyChart
(),
SizedBox
(
height:
15
),
],
),
),
],
),
child:
Column
(
children:
<
Widget
>[
highlightsTitle
(),
SizedBox
(
height:
20
),
highlightsContent
(),
Container
(
padding:
EdgeInsets
.
all
(
20
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
boxShadow:
[
BoxShadow
(
offset:
Offset
(
0
,
21
),
blurRadius:
54
,
color:
Colors
.
black
.
withOpacity
(
0.05
),
),
],
),
child:
Column
(
children:
<
Widget
>[
highlightsTitle
(),
SizedBox
(
height:
20
),
highlightsContent
(),
],
),
),
],
),
),
],
),
),
),
);
),
);
}
Row
buildDateTitle
()
{
...
...
@@ -230,7 +236,7 @@ class _WeeklyDetailsScreenState extends State<WeeklyDetailsScreen> {
fontSize:
20
,
),
)
else
if
(
mins
>
1
)
else
if
(
mins
>
=
1
)
Text
(
"
$hrs
hrs
$mins
mins"
,
style:
TextStyle
(
...
...
fitnessapp/lib/Screens/WalkingPatternRecognition/widgets/annual_chart.dart
View file @
bad59434
...
...
@@ -3,6 +3,7 @@ import 'package:fl_chart/fl_chart.dart';
import
'package:flutter/material.dart'
;
import
'package:fitnessapp/Screens/WalkingPatternRecognition/service.dart'
;
import
'dart:convert'
;
import
'package:fitnessapp/loading.dart'
;
class
AnnualChart
extends
StatefulWidget
{
@override
...
...
@@ -10,82 +11,97 @@ class AnnualChart extends StatefulWidget {
}
class
_AnnualChartState
extends
State
<
AnnualChart
>
{
static
dynamic
data
=
[];
bool
loading
=
true
;
static
dynamic
data
=
[];
List
<
int
>
timePeriodArray
=
new
List
(
12
);
getCurrentYear
(){
var
date
=
new
DateTime
.
now
().
toString
();
var
dateParse
=
DateTime
.
parse
(
date
);
print
(
"heree"
);
getMonthlyDetailsInYear
(
dateParse
.
year
);
getCurrentYear
()
{
var
date
=
new
DateTime
.
now
().
toString
();
var
dateParse
=
DateTime
.
parse
(
date
);
getMonthlyDetailsInYear
(
dateParse
.
year
);
}
getMonthlyDetailsInYear
(
currentYear
)
async
{
print
(
"dateParse.year"
);
var
year
=[
"JAN"
,
"FEB"
,
"MARCH"
,
"APR"
,
"MAY"
,
"JUN"
,
"JUL"
,
"AUG"
,
"SEP"
,
"OCT"
,
"NOV"
,
"DEC"
];
getMonthlyDetailsInYear
(
currentYear
)
async
{
var
year
=
[
"JAN"
,
"FEB"
,
"MARCH"
,
"APR"
,
"MAY"
,
"JUN"
,
"JUL"
,
"AUG"
,
"SEP"
,
"OCT"
,
"NOV"
,
"DEC"
];
SearchService
.
getMonthlyDetailsInYear
(
currentYear
).
then
((
responseBody
)
{
dynamic
jsondata
=
jsonDecode
(
responseBody
);
print
(
jsondata
);
setState
((){
data
=
jsondata
[
0
][
'data'
];
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++)
{
int
time
=
data
[
i
][
'timePeriod'
];
String
date
=
data
[
i
][
'date'
];
dynamic
jsondata
=
jsonDecode
(
responseBody
);
print
(
jsondata
);
setState
(()
{
data
=
jsondata
[
0
][
'data'
];
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++)
{
int
time
=
data
[
i
][
'timePeriod'
];
String
date
=
data
[
i
][
'date'
];
DateTime
myDatetime
=
DateTime
.
parse
(
date
);
var
month
=
year
[
myDatetime
.
month
-
1
];
if
(
data
[
i
][
'timePeriod'
]==
null
)
{
time
=
0
;
var
month
=
year
[
myDatetime
.
month
-
1
];
if
(
data
[
i
][
'timePeriod'
]
==
null
)
{
time
=
0
;
}
switch
(
month
)
{
case
'JAN'
:
timePeriodArray
[
0
]
=
time
;
timePeriodArray
[
0
]
=
time
;
break
;
case
'FEB'
:
timePeriodArray
[
1
]
=
time
;
timePeriodArray
[
1
]
=
time
;
break
;
case
'MAR'
:
timePeriodArray
[
2
]=
time
;
timePeriodArray
[
2
]
=
time
;
break
;
case
'APR'
:
timePeriodArray
[
3
]
=
time
;
timePeriodArray
[
3
]
=
time
;
break
;
case
'MAY'
:
timePeriodArray
[
4
]
=
time
;
timePeriodArray
[
4
]
=
time
;
break
;
case
'JUN'
:
timePeriodArray
[
5
]
=
time
;
timePeriodArray
[
5
]
=
time
;
break
;
case
'JUL'
:
timePeriodArray
[
6
]
=
time
;
timePeriodArray
[
6
]
=
time
;
break
;
case
'AUG'
:
timePeriodArray
[
7
]
=
time
;
timePeriodArray
[
7
]
=
time
;
break
;
case
'SEP'
:
timePeriodArray
[
8
]
=
time
;
timePeriodArray
[
8
]
=
time
;
break
;
case
'OCT'
:
timePeriodArray
[
9
]
=
time
;
timePeriodArray
[
9
]
=
time
;
break
;
case
'NOV'
:
timePeriodArray
[
10
]
=
time
;
timePeriodArray
[
10
]
=
time
;
break
;
case
'DEC'
:
timePeriodArray
[
11
]
=
time
;
timePeriodArray
[
11
]
=
time
;
break
;
}
}
}
}
loading
=
false
;
});
});
}
@override
Widget
build
(
BuildContext
context
)
{
void
initState
()
{
super
.
initState
();
getCurrentYear
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
AspectRatio
(
aspectRatio:
1.7
,
child:
BarChart
(
...
...
@@ -113,32 +129,31 @@ class _AnnualChartState extends State<AnnualChart> {
}
getBarGroups
(
List
<
int
>
list
)
{
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++){
if
(
list
[
i
]==
null
){
list
[
i
]=
0
;
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++)
{
if
(
list
[
i
]
==
null
)
{
list
[
i
]
=
0
;
}
}
// List<double> barChartDatas = list.map((s) => s.toDouble()).toList();
// List<double> barChartDatas = list.map((s) => s.toDouble()).toList();
List
<
double
>
barChartDatas
=
[
6
,
10
,
8
,
7
,
10
,
15
,
9
,
12
,
1
1
,
10
,
9
,
4
];
List
<
double
>
barChartDatas
=
[
6
,
10
,
8
,
7
,
10
,
15
,
9
,
12
,
1
0
,
0
,
0
,
0
];
List
<
BarChartGroupData
>
barChartGroups
=
[];
barChartDatas
.
asMap
().
forEach
(
(
i
,
value
)
=>
barChartGroups
.
add
(
BarChartGroupData
(
x:
i
,
barRods:
[
BarChartRodData
(
y:
value
,
//This is not the proper way, this is just for demo
color:
i
==
6
?
kPrimaryColor
:
kTextLight
Color
,
width:
15
,
)
],
),
),
);
BarChartGroupData
(
x:
i
,
barRods:
[
BarChartRodData
(
y:
value
,
//This is not the proper way, this is just for demo
color:
kPrimary
Color
,
width:
15
,
)
],
),
),
);
return
barChartGroups
;
}
...
...
fitnessapp/lib/Screens/WalkingPatternRecognition/widgets/daily_chart.dart
View file @
bad59434
import
'package:fitnessapp/constants.dart'
;
import
'package:fl_chart/fl_chart.dart'
;
import
'package:flutter/material.dart'
;
import
'package:fitnessapp/loading.dart'
;
class
DailyChart
extends
StatefulWidget
{
@override
_DailyChartState
createState
()
=>
_DailyChartState
();
}
class
_DailyChartState
extends
State
<
DailyChart
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
AspectRatio
(
aspectRatio:
1.7
,
child:
BarChart
(
...
...
@@ -46,23 +38,48 @@ class _DailyChartState extends State<DailyChart> {
}
getBarGroups
()
{
List
<
double
>
barChartDatas
=
[
1
,
2
,
3
,
3
,
4
,
5
,
4
,
5.5
,
1
,
2
,
3
,
0.5
,
5
,
3.5
,
4
,
3
,
3
,
2
,
1
,
0.5
,
2
,
2
,
2
,
5
];
List
<
double
>
barChartDatas
=
[
1
,
2
,
3
,
3
,
4
,
5
,
4
,
5.5
,
1
,
2
,
3
,
0.5
,
5
,
3.5
,
4
,
3
,
3
,
2
,
1
,
0.5
,
2
,
2
,
2
,
5
];
List
<
BarChartGroupData
>
barChartGroups
=
[];
barChartDatas
.
asMap
().
forEach
(
(
i
,
value
)
=>
barChartGroups
.
add
(
BarChartGroupData
(
x:
i
,
barRods:
[
BarChartRodData
(
y:
value
,
//This is not the proper way, this is just for demo
color:
i
==
4
?
kPrimaryColor
:
kTextLight
Color
,
width:
5
,
)
],
),
),
);
BarChartGroupData
(
x:
i
,
barRods:
[
BarChartRodData
(
y:
value
,
//This is not the proper way, this is just for demo
color:
i
==
4
?
kTextLightColor
:
kPrimary
Color
,
width:
5
,
)
],
),
),
);
return
barChartGroups
;
}
...
...
fitnessapp/lib/Screens/WalkingPatternRecognition/widgets/monthly_chart.dart
View file @
bad59434
...
...
@@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart';
import
'package:flutter/material.dart'
;
import
'package:fitnessapp/Screens/WalkingPatternRecognition/service.dart'
;
import
'dart:convert'
;
import
'package:fitnessapp/loading.dart'
;
class
MonthlyChart
extends
StatefulWidget
{
@override
...
...
@@ -11,6 +12,7 @@ class MonthlyChart extends StatefulWidget {
}
class
_MonthlyChartState
extends
State
<
MonthlyChart
>
{
bool
loading
=
true
;
double
time
;
static
dynamic
data
=
[];
List
<
dynamic
>
weekNumbers
=
[];
...
...
@@ -33,6 +35,7 @@ class _MonthlyChartState extends State<MonthlyChart> {
timePeriods
[
3
]
=
data
[
3
].
toDouble
();
timePeriods
[
4
]
=
data
[
4
].
toDouble
();
});
loading
=
false
;
});
}
...
...
@@ -46,26 +49,28 @@ class _MonthlyChartState extends State<MonthlyChart> {
Widget
build
(
BuildContext
context
)
{
return
AspectRatio
(
aspectRatio:
1.7
,
child:
BarChart
(
BarChartData
(
barGroups:
getBarGroups
(
timePeriods
),
borderData:
FlBorderData
(
show:
false
),
titlesData:
FlTitlesData
(
leftTitles:
SideTitles
(
showTitles:
false
,
),
bottomTitles:
SideTitles
(
showTitles:
true
,
getTitles:
getWeeks
,
textStyle:
TextStyle
(
color:
kTextLightColor
,
fontSize:
15
,
fontWeight:
FontWeight
.
bold
,
child:
loading
?
Loading
()
:
BarChart
(
BarChartData
(
barGroups:
getBarGroups
(
timePeriods
),
borderData:
FlBorderData
(
show:
false
),
titlesData:
FlTitlesData
(
leftTitles:
SideTitles
(
showTitles:
false
,
),
bottomTitles:
SideTitles
(
showTitles:
true
,
getTitles:
getWeeks
,
textStyle:
TextStyle
(
color:
kTextLightColor
,
fontSize:
15
,
fontWeight:
FontWeight
.
bold
,
),
),
),
),
),
),
),
),
);
}
}
...
...
@@ -80,7 +85,7 @@ getBarGroups(List<double> barChartData) {
BarChartRodData
(
y:
value
,
//This is not the proper way, this is just for demo
color:
i
==
2
?
kPrimaryColor
:
kTextLight
Color
,
color:
kPrimary
Color
,
width:
15
,
)
],
...
...
fitnessapp/lib/Screens/WalkingPatternRecognition/widgets/weekly_chart.dart
View file @
bad59434
...
...
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import
'package:fitnessapp/Screens/WalkingPatternRecognition/service.dart'
;
import
'package:intl/intl.dart'
;
import
'dart:convert'
;
import
'package:fitnessapp/loading.dart'
;
class
WeeklyChart
extends
StatefulWidget
{
@override
...
...
@@ -11,6 +12,7 @@ class WeeklyChart extends StatefulWidget {
}
class
_WeeklyChartState
extends
State
<
WeeklyChart
>
{
bool
loading
=
true
;
static
dynamic
data
=
[];
List
<
int
>
timePeriodArray
=
new
List
(
7
);
DateTime
startDate
,
endDate
;
...
...
@@ -60,6 +62,7 @@ class _WeeklyChartState extends State<WeeklyChart> {
break
;
}
}
loading
=
false
;
});
});
}
...
...
@@ -74,26 +77,28 @@ class _WeeklyChartState extends State<WeeklyChart> {
Widget
build
(
BuildContext
context
)
{
return
AspectRatio
(
aspectRatio:
1.7
,
child:
BarChart
(
BarChartData
(
barGroups:
getBarGroups
(
timePeriodArray
),
borderData:
FlBorderData
(
show:
false
),
titlesData:
FlTitlesData
(
leftTitles:
SideTitles
(
showTitles:
false
,
),
bottomTitles:
SideTitles
(
showTitles:
true
,
getTitles:
getWeek
,
textStyle:
TextStyle
(
color:
kTextLightColor
,
fontSize:
12
,
fontWeight:
FontWeight
.
bold
,
child:
loading
?
Loading
()
:
BarChart
(
BarChartData
(
barGroups:
getBarGroups
(
timePeriodArray
),
borderData:
FlBorderData
(
show:
false
),
titlesData:
FlTitlesData
(
leftTitles:
SideTitles
(
showTitles:
false
,
),
bottomTitles:
SideTitles
(
showTitles:
true
,
getTitles:
getWeek
,
textStyle:
TextStyle
(
color:
kTextLightColor
,
fontSize:
12
,
fontWeight:
FontWeight
.
bold
,
),
),
),
),
),
),
),
),
);
}
}
...
...
@@ -116,7 +121,7 @@ getBarGroups(List<int> list) {
BarChartRodData
(
y:
value
,
//This is not the proper way, this is just for demo
color:
i
==
4
?
k
PrimaryColor
:
kTextLight
Color
,
color:
i
==
4
?
k
TextLightColor
:
kPrimary
Color
,
width:
16
,
)
],
...
...
fitnessapp/lib/constants.dart
View file @
bad59434
...
...
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
//const kPrimaryColor = Color(0xFF6F35A5);
const
kPrimaryLightColor
=
Color
(
0xFFF1E6FF
);
const
kPrimaryGreenColor
=
Color
(
0xFF55BD8B
);
const
kTextColor
=
Color
(
0xFF1E2432
);
const
kTextMediumColor
=
Color
(
0xFF53627C
);
...
...
fitnessapp/lib/loading.dart
0 → 100644
View file @
bad59434
import
'package:flutter/material.dart'
;
import
'package:flutter_spinkit/flutter_spinkit.dart'
;
import
'package:fitnessapp/constants.dart'
;
class
Loading
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
color:
kBackgroundColor
,
child:
Center
(
child:
SpinKitChasingDots
(
color:
kPrimaryColor
,
size:
50.0
,
),
),
);
}
}
fitnessapp/lib/main.dart
View file @
bad59434
import
'package:flutter/material.dart'
;
import
'package:fitnessapp/Screens/WalkingPatternRecognition/home_page.dart'
;
import
'package:fitnessapp/constants.dart'
;
import
'package:fitnessapp/Screens/WalkingPatternRecognition/monthly_details_screen.dart'
;
import
'Screens/DogBreedRecognition/dog_breed_identification_screen.dart'
;
import
'Screens/DogBreedRecognition/dog_details_screen.dart'
;
void
main
(
)
=>
runApp
(
MyApp
());
class
MyApp
extends
StatelessWidget
{
...
...
@@ -17,9 +14,7 @@ class MyApp extends StatelessWidget {
scaffoldBackgroundColor:
Colors
.
white
,
),
debugShowCheckedModeBanner:
false
,
home:
DogDetails
(),
//home: DogBreedIdentification(),
//home: MonthlyDetailsScreen(),
home:
HomePage
(),
);
}
}
fitnessapp/pubspec.lock
View file @
bad59434
...
...
@@ -7,28 +7,7 @@ packages:
name: animations
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
archive:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.13"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.0"
asn1lib:
dependency: transitive
description:
name: asn1lib
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.5"
version: "1.1.1"
async:
dependency: transitive
description:
...
...
@@ -36,13 +15,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.2"
basic_utils:
dependency: transitive
description:
name: basic_utils
url: "https://pub.dartlang.org"
source: hosted
version: "2.6.2"
boolean_selector:
dependency: transitive
description:
...
...
@@ -85,20 +57,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
country_pickers:
dependency: transitive
description:
name: country_pickers
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.5"
cupertino_icons:
dependency: "direct main"
description:
...
...
@@ -106,27 +64,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
date_range_picker:
dependency: transitive
description:
name: date_range_picker
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.6"
datetime_picker_formfield:
dependency: transitive
description:
name: datetime_picker_formfield
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
equatable:
dependency: transitive
description:
name: equatable
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.
5
"
version: "1.2.
0
"
fake_async:
dependency: transitive
description:
...
...
@@ -146,79 +90,32 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_chips_input:
dependency: transitive
description:
name: flutter_chips_input
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.4"
flutter_colorpicker:
dependency: transitive
description:
name: flutter_colorpicker
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.4"
flutter_form_builder:
flutter_spinkit:
dependency: "direct main"
description:
name: flutter_
form_builder
name: flutter_
spinkit
url: "https://pub.dartlang.org"
source: hosted
version: "3.13.5"
flutter_keyboard_visibility:
dependency: transitive
description:
name: flutter_keyboard_visibility
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.2"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.9"
version: "4.1.2+1"
flutter_svg:
dependency: "direct main"
description:
name: flutter_svg
url: "https://pub.dartlang.org"
source: hosted
version: "0.18.
1
"
version: "0.18.
0
"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
flutter_touch_spin:
dependency: transitive
description:
name: flutter_touch_spin
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
flutter_typeahead:
dependency: transitive
description:
name: flutter_typeahead
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.8"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
http:
dependency: "direct main"
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.
2
"
version: "0.12.
1
"
http_parser:
dependency: transitive
description:
...
...
@@ -226,34 +123,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.4"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.14"
image_picker:
dependency: "direct main"
description:
name: image_picker
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.7+7"
image_picker_for_web:
dependency: transitive
description:
name: image_picker_for_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0+2"
image_picker_platform_interface:
dependency: transitive
description:
name: image_picker_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
intl:
dependency: "direct main"
description:
...
...
@@ -268,27 +137,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.2"
json_annotation:
dependency: transitive
description:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
logging:
dependency: transitive
description:
name: logging
url: "https://pub.dartlang.org"
source: hosted
version: "0.11.4"
matcher:
dependency: transitive
description:
...
...
@@ -316,7 +164,7 @@ packages:
name: path_drawing
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.1
+1
"
version: "0.4.1"
path_parsing:
dependency: transitive
description:
...
...
@@ -338,27 +186,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.4"
phone_number:
dependency: transitive
description:
name: phone_number
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.2+4"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
pointycastle:
dependency: transitive
description:
name: pointycastle
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
quiver:
dependency: "direct main"
description:
...
...
@@ -366,27 +193,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
random_string:
dependency: transitive
description:
name: random_string
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
rating_bar:
dependency: transitive
description:
name: rating_bar
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
signature:
dependency: transitive
description:
name: signature
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.0"
sky_engine:
dependency: transitive
description: flutter
...
...
@@ -441,13 +247,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
validators:
dependency: transitive
description:
name: validators
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
vector_math:
dependency: transitive
description:
...
...
@@ -455,34 +254,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
video_player:
dependency: "direct main"
description:
name: video_player
url: "https://pub.dartlang.org"
source: hosted
version: "0.10.12+2"
video_player_platform_interface:
dependency: transitive
description:
name: video_player_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
video_player_web:
dependency: transitive
description:
name: video_player_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3+2"
vin_decoder:
dependency: transitive
description:
name: vin_decoder
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
xml:
dependency: transitive
description:
...
...
@@ -492,4 +263,4 @@ packages:
version: "4.2.0"
sdks:
dart: ">=2.9.0-14.0.dev <3.0.0"
flutter: ">=1.
20.0
<2.0.0"
flutter: ">=1.
18.0-6.0.pre
<2.0.0"
fitnessapp/pubspec.yaml
View file @
bad59434
...
...
@@ -17,9 +17,6 @@ environment:
sdk
:
"
>=2.6.0
<3.0.0"
dependencies
:
image_picker
:
^0.6.7+7
video_player
:
^0.10.12+2
flutter_form_builder
:
^3.13.5
flutter
:
sdk
:
flutter
...
...
@@ -33,6 +30,7 @@ dependencies:
http
:
^0.12.1
jiffy
:
^3.0.1
quiver
:
^2.1.3
flutter_spinkit
:
"
^4.1.2"
dev_dependencies
:
flutter_test
:
...
...
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