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
d4b61b88
Commit
d4b61b88
authored
Sep 21, 2020
by
Boteju W.J.M.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
@09/21@
parent
8cac7d60
Pipeline
#1566
failed with stages
Changes
11
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
162 additions
and
84 deletions
+162
-84
fitnessapp/assets/images/heartpawprints2.png
fitnessapp/assets/images/heartpawprints2.png
+0
-0
fitnessapp/assets/images/pawprint.png
fitnessapp/assets/images/pawprint.png
+0
-0
fitnessapp/lib/Screens/Login/components/background.dart
fitnessapp/lib/Screens/Login/components/background.dart
+19
-14
fitnessapp/lib/Screens/Login/components/body.dart
fitnessapp/lib/Screens/Login/components/body.dart
+87
-41
fitnessapp/lib/Screens/WalkingPatternRecognition/MainNavigation.dart
...lib/Screens/WalkingPatternRecognition/MainNavigation.dart
+1
-1
fitnessapp/lib/Screens/WalkingPatternRecognition/daily_details_screen.dart
...reens/WalkingPatternRecognition/daily_details_screen.dart
+2
-1
fitnessapp/lib/Screens/WalkingPatternRecognition/home.dart
fitnessapp/lib/Screens/WalkingPatternRecognition/home.dart
+11
-1
fitnessapp/lib/Screens/WalkingPatternRecognition/service.dart
...essapp/lib/Screens/WalkingPatternRecognition/service.dart
+32
-21
fitnessapp/lib/constants.dart
fitnessapp/lib/constants.dart
+4
-4
fitnessapp/lib/globals.dart
fitnessapp/lib/globals.dart
+3
-0
fitnessapp/lib/main.dart
fitnessapp/lib/main.dart
+3
-1
No files found.
fitnessapp/assets/images/heartpawprints2.png
0 → 100644
View file @
d4b61b88
88.4 KB
fitnessapp/assets/images/pawprint.png
0 → 100644
View file @
d4b61b88
66.2 KB
fitnessapp/lib/Screens/Login/components/background.dart
View file @
d4b61b88
import
'package:flutter/material.dart'
;
class
Background
extends
State
less
Widget
{
class
Background
extends
State
ful
Widget
{
final
Widget
child
;
const
Background
({
Key
key
,
@required
this
.
child
,
})
:
super
(
key:
key
);
@override
_BackgroundState
createState
()
=>
_BackgroundState
();
}
class
_BackgroundState
extends
State
<
Background
>
{
@override
Widget
build
(
BuildContext
context
)
{
Size
size
=
MediaQuery
.
of
(
context
).
size
;
...
...
@@ -17,22 +22,22 @@ class Background extends StatelessWidget {
alignment:
Alignment
.
center
,
children:
<
Widget
>[
Positioned
(
top:
0
,
left:
0
,
child:
Image
.
asset
(
"assets/images/main_top.png"
,
width:
size
.
width
*
0.35
,
),
),
Positioned
(
bottom:
0
,
right:
0
,
top:
50
,
left:
25
,
child:
Image
.
asset
(
"assets/images/
login_bottom
.png"
,
width:
size
.
width
*
0.
4
,
"assets/images/
pawprint
.png"
,
width:
size
.
width
*
0.
25
,
),
),
child
,
// Positioned(
// bottom: 0,
// right: 0,
// // child: Image.asset(
// // "assets/images/login_bottom.png",
// // width: size.width * 0.4,
// // ),
// ),
widget
.
child
,
],
),
);
...
...
fitnessapp/lib/Screens/Login/components/body.dart
View file @
d4b61b88
import
'dart:convert'
;
import
'dart:developer'
;
import
'package:fitnessapp/Screens/WalkingPatternRecognition/service.dart'
;
import
'package:flutter/material.dart'
;
import
'package:fitnessapp/Screens/Login/components/background.dart'
;
import
'package:fitnessapp/Screens/Signup/signup_screen.dart'
;
...
...
@@ -6,57 +10,99 @@ import 'package:fitnessapp/components/rounded_button.dart';
import
'package:fitnessapp/components/rounded_input_field.dart'
;
import
'package:fitnessapp/components/rounded_password_field.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:http/http.dart'
;
import
'../../../loading.dart'
;
class
Body
extends
State
less
Widget
{
class
Body
extends
State
ful
Widget
{
const
Body
({
Key
key
,
})
:
super
(
key:
key
);
@override
_BodyState
createState
()
=>
_BodyState
();
}
class
_BodyState
extends
State
<
Body
>
{
bool
loading
=
false
;
String
token
=
''
;
String
username
=
''
;
String
password
=
''
;
login
()
async
{
SearchService
.
login
(
username
,
password
).
then
((
responseBody
)
{
dynamic
data
=
jsonDecode
(
responseBody
);
print
(
data
);
setState
(()
{
token
=
data
[
'token'
];
if
(
token
.
length
>
0
)
{
loading
=
false
;
}
});
});
}
@override
Widget
build
(
BuildContext
context
)
{
Size
size
=
MediaQuery
.
of
(
context
).
size
;
return
Background
(
child:
SingleChildScrollView
(
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Text
(
"LOGIN"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
),
),
SizedBox
(
height:
size
.
height
*
0.03
),
SvgPicture
.
asset
(
"assets/icons/login.svg"
,
height:
size
.
height
*
0.35
,
),
SizedBox
(
height:
size
.
height
*
0.03
),
RoundedInputField
(
hintText:
"Your Email"
,
onChanged:
(
value
)
{},
),
RoundedPasswordField
(
onChanged:
(
value
)
{},
),
RoundedButton
(
text:
"LOGIN"
,
press:
()
{},
),
SizedBox
(
height:
size
.
height
*
0.03
),
AlreadyHaveAnAccountCheck
(
press:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
{
return
SignUpScreen
();
return
loading
?
Loading
()
:
Background
(
child:
SingleChildScrollView
(
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
// Text(
// "LOGIN",
// style: TextStyle(fontWeight: FontWeight.bold),
// ),
SizedBox
(
height:
size
.
height
*
0.1
),
// SvgPicture.asset(
// "assets/icons/login.svg",
// height: size.height * 0.35,
// ),
SizedBox
(
height:
200
),
RoundedInputField
(
hintText:
"Your Username"
,
onChanged:
(
value
)
{
setState
(()
{
username
=
value
;
});
},
),
RoundedPasswordField
(
onChanged:
(
value
)
{
setState
(()
{
password
=
value
;
});
},
),
RoundedButton
(
text:
"LOGIN"
,
press:
()
{
setState
(()
{
loading
=
true
;
});
this
.
login
();
},
),
SizedBox
(
height:
size
.
height
*
0.03
),
AlreadyHaveAnAccountCheck
(
press:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
{
return
SignUpScreen
();
},
),
);
},
),
);
}
,
],
)
,
),
],
),
),
);
);
}
}
fitnessapp/lib/Screens/WalkingPatternRecognition/MainNavigation.dart
View file @
d4b61b88
...
...
@@ -66,7 +66,7 @@ class _MainNavigationState extends State<MainNavigation>
height:
MediaQuery
.
of
(
context
).
size
.
height
-
80
,
child:
TabBarView
(
controller:
_tabController
,
children:
<
Widget
>[
Home
(
),
Home
(
)],
children:
<
Widget
>[
Home
(
activityId:
1
),
Home
(
activityId:
2
)],
),
)
],
...
...
fitnessapp/lib/Screens/WalkingPatternRecognition/daily_details_screen.dart
View file @
d4b61b88
...
...
@@ -46,7 +46,7 @@ class _DailyDetailsScreenState extends State<DailyDetailsScreen> {
});
getActivityNameById
();
getTotalMinutes
(
datee
);
getHighlightsPerDay
(
datee
);
//
getHighlightsPerDay(datee);
}
getActivityNameById
()
async
{
...
...
@@ -77,6 +77,7 @@ class _DailyDetailsScreenState extends State<DailyDetailsScreen> {
}
getHighlightsPerDay
(
datee
)
async
{
print
(
datee
);
SearchService
.
getHighlightsPerDay
(
datee
).
then
((
responseBody
)
{
dynamic
data
=
jsonDecode
(
responseBody
);
setState
(()
{
...
...
fitnessapp/lib/Screens/WalkingPatternRecognition/home.dart
View file @
d4b61b88
import
'package:flutter/material.dart'
;
import
'Navigation.dart'
;
import
'package:fitnessapp/globals.dart'
as
globals
;
class
Home
extends
StatefulWidget
{
Home
({
Key
key
,
this
.
activityId
})
:
super
(
key:
key
);
final
int
activityId
;
@override
_HomeState
createState
()
=>
_HomeState
();
_HomeState
createState
()
=>
_HomeState
(
activityId
);
}
class
_HomeState
extends
State
<
Home
>
{
int
activityId
=
1
;
_HomeState
(
this
.
activityId
);
double
left
=
0
;
double
direction
;
double
MAX_LEFT
=
0
;
...
...
@@ -14,6 +20,10 @@ class _HomeState extends State<Home> {
@override
void
initState
()
{
super
.
initState
();
setState
(()
{
globals
.
activityId
=
activityId
;
});
}
@override
...
...
fitnessapp/lib/Screens/WalkingPatternRecognition/service.dart
View file @
d4b61b88
import
'package:http/http.dart'
as
http
;
import
'dart:convert'
;
import
'package:fitnessapp/globals.dart'
as
globals
;
class
SearchService
{
static
String
ip
=
'http://192.168.1.
10
:8000'
;
static
String
ip
=
'http://192.168.1.
2
:8000'
;
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
,
});
//Login
static
Future
<
String
>
login
(
username
,
password
)
async
{
String
url
=
'
$ip
/auth/'
;
var
body
=
jsonEncode
({
"username"
:
username
,
"password"
:
password
});
http
.
Response
response
=
await
http
.
post
(
url
,
headers:
{
"Content-Type"
:
"application/json"
,
'authorization'
:
basicAuth
},
body:
body
)
.
then
((
http
.
Response
response
)
{
...
...
@@ -32,7 +30,7 @@ class SearchService {
static
Future
<
String
>
getActivityNameById
()
async
{
String
url
=
'
$ip
/getActivityNameById'
;
var
body
=
jsonEncode
({
"id"
:
2
,
"id"
:
globals
.
activityId
,
});
http
.
Response
response
=
await
http
.
post
(
url
,
...
...
@@ -49,7 +47,8 @@ class SearchService {
static
Future
<
String
>
getTotalMinutesPerDay
(
day
)
async
{
String
url
=
'
$ip
/getTotalMinutesPerDay'
;
var
body
=
jsonEncode
({
"activity"
:
2
,
"dog"
:
1
,
"date"
:
day
});
var
body
=
jsonEncode
({
"activity"
:
globals
.
activityId
,
"dog"
:
1
,
"date"
:
day
});
http
.
Response
response
=
await
http
.
post
(
url
,
headers:
{
...
...
@@ -65,7 +64,8 @@ class SearchService {
static
Future
<
String
>
getHighlightsPerDay
(
date
)
async
{
String
url
=
'
$ip
/highlightsPerDay'
;
var
body
=
jsonEncode
({
"activity"
:
2
,
"dog"
:
1
,
"date"
:
date
});
var
body
=
jsonEncode
({
"activity"
:
globals
.
activityId
,
"dog"
:
1
,
"date"
:
date
});
http
.
Response
response
=
await
http
.
post
(
url
,
headers:
{
...
...
@@ -83,7 +83,8 @@ class SearchService {
static
Future
<
String
>
getTotalMinutesPerWeek
(
formattedDate
)
async
{
String
url
=
'
$ip
/getTotalMinutesPerWeek'
;
var
body
=
jsonEncode
({
"activity"
:
2
,
"dog"
:
1
,
"date"
:
formattedDate
});
var
body
=
jsonEncode
(
{
"activity"
:
globals
.
activityId
,
"dog"
:
1
,
"date"
:
formattedDate
});
http
.
Response
response
=
await
http
.
post
(
url
,
headers:
{
...
...
@@ -99,7 +100,8 @@ class SearchService {
static
Future
<
String
>
getTotalMinutesPerDayInWeek
(
date
)
async
{
String
url
=
'
$ip
/getTotalMinutesPerDayInWeek'
;
var
body
=
jsonEncode
({
"activity"
:
2
,
"dog"
:
1
,
"date"
:
date
});
var
body
=
jsonEncode
({
"activity"
:
globals
.
activityId
,
"dog"
:
1
,
"date"
:
date
});
http
.
Response
response
=
await
http
.
post
(
url
,
headers:
{
...
...
@@ -116,7 +118,8 @@ class SearchService {
static
Future
<
String
>
getHighlightsPerWeek
(
date
)
async
{
String
url
=
'
$ip
/highlightsPerWeek'
;
var
body
=
jsonEncode
({
"activity"
:
2
,
"dog"
:
1
,
"date"
:
date
});
var
body
=
jsonEncode
({
"activity"
:
globals
.
activityId
,
"dog"
:
1
,
"date"
:
date
});
http
.
Response
response
=
await
http
.
post
(
url
,
headers:
{
...
...
@@ -134,8 +137,12 @@ class SearchService {
static
Future
<
String
>
getWeeklyDetailsInMonth
(
year
,
month
)
async
{
String
url
=
'
$ip
/getWeeklyDetailsInMonth'
;
var
body
=
jsonEncode
({
"activity"
:
2
,
"dog"
:
1
,
"year"
:
year
,
"month"
:
month
});
var
body
=
jsonEncode
({
"activity"
:
globals
.
activityId
,
"dog"
:
1
,
"year"
:
year
,
"month"
:
month
});
http
.
Response
response
=
await
http
.
post
(
url
,
headers:
{
...
...
@@ -152,7 +159,8 @@ class SearchService {
static
Future
<
String
>
getTotalMinutesPerMonth
(
month
)
async
{
String
url
=
'
$ip
/getTotalMinutesPerMonth'
;
var
body
=
jsonEncode
({
"activity"
:
2
,
"dog"
:
1
,
"month"
:
month
});
var
body
=
jsonEncode
({
"activity"
:
globals
.
activityId
,
"dog"
:
1
,
"month"
:
month
});
http
.
Response
response
=
await
http
.
post
(
url
,
headers:
{
...
...
@@ -169,7 +177,8 @@ class SearchService {
static
Future
<
String
>
getHighlightsPerMonth
(
month
)
async
{
String
url
=
'
$ip
/highlightsPerMonth'
;
var
body
=
jsonEncode
({
"activity"
:
2
,
"dog"
:
1
,
"month"
:
month
});
var
body
=
jsonEncode
({
"activity"
:
globals
.
activityId
,
"dog"
:
1
,
"month"
:
month
});
http
.
Response
response
=
await
http
.
post
(
url
,
headers:
{
...
...
@@ -187,7 +196,8 @@ class SearchService {
static
Future
<
String
>
getTotalMinutesPerYear
(
year
)
async
{
String
url
=
'
$ip
/getTotalMinutesPerYear'
;
var
body
=
jsonEncode
({
"activity"
:
2
,
"dog"
:
1
,
"year"
:
year
});
var
body
=
jsonEncode
({
"activity"
:
globals
.
activityId
,
"dog"
:
1
,
"year"
:
year
});
http
.
Response
response
=
await
http
.
post
(
url
,
headers:
{
...
...
@@ -205,7 +215,7 @@ class SearchService {
static
Future
<
String
>
getMonthlyDetailsInYear
(
year
)
async
{
String
url
=
'
$ip
/getMonthlyDetailsInYear'
;
var
body
=
jsonEncode
({
"activity"
:
2
,
"activity"
:
globals
.
activityId
,
"dog"
:
1
,
"year"
:
year
,
});
...
...
@@ -225,7 +235,8 @@ class SearchService {
static
Future
<
String
>
getHighlightsPerYear
(
year
)
async
{
String
url
=
'
$ip
/highlightsPerYear'
;
var
body
=
jsonEncode
({
"activity"
:
2
,
"dog"
:
1
,
"year"
:
year
});
var
body
=
jsonEncode
({
"activity"
:
globals
.
activityId
,
"dog"
:
1
,
"year"
:
year
});
http
.
Response
response
=
await
http
.
post
(
url
,
headers:
{
...
...
fitnessapp/lib/constants.dart
View file @
d4b61b88
import
'package:flutter/material.dart'
;
//const kPrimaryColor = Color(0xFF6F35A5);
const
kPrimaryLightColor
=
Color
(
0xFFF1E6FF
);
const
kPrimaryLightColor
=
Color
(
0xF8FFEC
);
const
kTextColor
=
Color
(
0xFF1E2432
);
const
kTextMediumColor
=
Color
(
0xFF53627C
);
const
kTextLightColor
=
Color
(
0xFFACB1C0
);
const
kPrimaryColor
=
Color
(
0xFF0D8E53
);
// const kPrimaryColor = Color(0xFF0D8E53);
const
kPrimaryColor
=
Color
(
0xFF388E3C
);
const
kBackgroundColor
=
Color
(
0xFFFCFCFC
);
const
kInactiveChartColor
=
Color
(
0xFFEAECEF
);
\ No newline at end of file
const
kInactiveChartColor
=
Color
(
0xFFEAECEF
);
fitnessapp/lib/globals.dart
0 → 100644
View file @
d4b61b88
library
my_prj
.
globals
;
int
activityId
;
fitnessapp/lib/main.dart
View file @
d4b61b88
import
'package:flutter/material.dart'
;
import
'package:fitnessapp/Screens/WalkingPatternRecognition/home_page.dart'
;
// import 'package:fitnessapp/Screens/Login/login_screen.dart';
import
'package:fitnessapp/constants.dart'
;
void
main
(
)
=>
runApp
(
MyApp
());
...
...
@@ -8,7 +10,7 @@ class MyApp extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
title:
'Dog
gy App
'
,
title:
'Dog
Behavioural Monitoring System
'
,
theme:
ThemeData
(
primaryColor:
kPrimaryColor
,
scaffoldBackgroundColor:
Colors
.
white
,
...
...
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