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
bc9e61b5
Commit
bc9e61b5
authored
Jan 04, 2021
by
Boteju W.J.M.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
04/01/2021 Flutter app
parent
46a61e3b
Pipeline
#2032
canceled with stages
Changes
11
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
169 additions
and
7 deletions
+169
-7
fitnessapp/android/app/src/main/AndroidManifest.xml
fitnessapp/android/app/src/main/AndroidManifest.xml
+13
-0
fitnessapp/android/app/src/main/res/drawable/download.png
fitnessapp/android/app/src/main/res/drawable/download.png
+0
-0
fitnessapp/android/app/src/main/res/drawable/paw.png
fitnessapp/android/app/src/main/res/drawable/paw.png
+0
-0
fitnessapp/lib/Screens/DogBreedRecognition/dog_breed_identification_screen.dart
.../DogBreedRecognition/dog_breed_identification_screen.dart
+1
-0
fitnessapp/lib/Screens/Home/MainHome.dart
fitnessapp/lib/Screens/Home/MainHome.dart
+53
-1
fitnessapp/lib/Screens/Login/components/body.dart
fitnessapp/lib/Screens/Login/components/body.dart
+0
-3
fitnessapp/lib/Screens/WalkingPatternRecognition/service.dart
...essapp/lib/Screens/WalkingPatternRecognition/service.dart
+1
-1
fitnessapp/lib/Screens/Welcome/components/body.dart
fitnessapp/lib/Screens/Welcome/components/body.dart
+70
-1
fitnessapp/lib/commons/my_info.dart
fitnessapp/lib/commons/my_info.dart
+1
-1
fitnessapp/pubspec.lock
fitnessapp/pubspec.lock
+28
-0
fitnessapp/pubspec.yaml
fitnessapp/pubspec.yaml
+2
-0
No files found.
fitnessapp/android/app/src/main/AndroidManifest.xml
View file @
bc9e61b5
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"lk.sliit.flutterapp.fitnessapp"
>
package=
"lk.sliit.flutterapp.fitnessapp"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.VIBRATE"
/>
<uses-permission
android:name=
"android.permission.RECEIVE_BOOT_COMPLETED"
/>
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
In most cases you can leave this as-is, but you if you want to provide
...
@@ -9,6 +14,14 @@
...
@@ -9,6 +14,14 @@
android:name=
"io.flutter.app.FlutterApplication"
android:name=
"io.flutter.app.FlutterApplication"
android:label=
"Woofy"
android:label=
"Woofy"
android:icon=
"@mipmap/ic_launcher"
>
android:icon=
"@mipmap/ic_launcher"
>
<receiver
android:name=
"com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver"
>
<intent-filter>
<action
android:name=
"android.intent.action.BOOT_COMPLETED"
/>
<action
android:name=
"android.intent.action.MY_PACKAGE_REPLACED"
/>
</intent-filter>
</receiver>
<receiver
android:name=
"com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver"
/>
<activity
<activity
android:name=
".MainActivity"
android:name=
".MainActivity"
android:launchMode=
"singleTop"
android:launchMode=
"singleTop"
...
...
fitnessapp/android/app/src/main/res/drawable/download.png
0 → 100644
View file @
bc9e61b5
3.83 KB
fitnessapp/android/app/src/main/res/drawable/paw.png
0 → 100644
View file @
bc9e61b5
3.46 KB
fitnessapp/lib/Screens/DogBreedRecognition/dog_breed_identification_screen.dart
View file @
bc9e61b5
...
@@ -293,6 +293,7 @@ class _DogBreedIdentificationState extends State<DogBreedIdentification> {
...
@@ -293,6 +293,7 @@ class _DogBreedIdentificationState extends State<DogBreedIdentification> {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
print
(
"Heree"
);
return
Scaffold
(
return
Scaffold
(
body:
Center
(
body:
Center
(
child:
Column
(
child:
Column
(
...
...
fitnessapp/lib/Screens/Home/MainHome.dart
View file @
bc9e61b5
...
@@ -6,8 +6,11 @@ import 'package:flutter/material.dart';
...
@@ -6,8 +6,11 @@ import 'package:flutter/material.dart';
import
'package:fitnessapp/commons/my_info.dart'
;
import
'package:fitnessapp/commons/my_info.dart'
;
import
'package:fitnessapp/commons/opaque_image.dart'
;
import
'package:fitnessapp/commons/opaque_image.dart'
;
import
'package:fitnessapp/commons/profile_info_big_card.dart'
;
import
'package:fitnessapp/commons/profile_info_big_card.dart'
;
import
'../../loading.dart'
;
import
'../../loading.dart'
;
import
'package:flutter_local_notifications/flutter_local_notifications.dart'
;
import
'package:timezone/data/latest.dart'
as
tz
;
import
'package:timezone/timezone.dart'
as
tz
;
import
'package:flutter_native_timezone/flutter_native_timezone.dart'
;
class
ProfilePage
extends
StatefulWidget
{
class
ProfilePage
extends
StatefulWidget
{
@override
@override
...
@@ -15,6 +18,8 @@ class ProfilePage extends StatefulWidget {
...
@@ -15,6 +18,8 @@ class ProfilePage extends StatefulWidget {
}
}
class
_ProfilePageState
extends
State
<
ProfilePage
>
{
class
_ProfilePageState
extends
State
<
ProfilePage
>
{
FlutterLocalNotificationsPlugin
fltrNotification
;
int
sliderValue
=
1
;
int
sliderValue
=
1
;
static
dynamic
value
=
[];
static
dynamic
value
=
[];
int
walkingHrs
,
walkingMins
,
runningHrs
,
runningMins
;
int
walkingHrs
,
walkingMins
,
runningHrs
,
runningMins
;
...
@@ -24,6 +29,7 @@ class _ProfilePageState extends State<ProfilePage> {
...
@@ -24,6 +29,7 @@ class _ProfilePageState extends State<ProfilePage> {
String
finalDate
=
''
;
String
finalDate
=
''
;
String
dogBirthday
=
''
;
String
dogBirthday
=
''
;
String
dogBreed
=
''
;
String
dogBreed
=
''
;
String
dogName
=
''
;
bool
loading
=
true
;
bool
loading
=
true
;
String
status
=
''
;
String
status
=
''
;
...
@@ -56,6 +62,7 @@ class _ProfilePageState extends State<ProfilePage> {
...
@@ -56,6 +62,7 @@ class _ProfilePageState extends State<ProfilePage> {
finalDate
=
formattedDate
.
toString
();
finalDate
=
formattedDate
.
toString
();
dogBirthday
=
dogBirthdayAge
.
toString
();
dogBirthday
=
dogBirthdayAge
.
toString
();
globals
.
age
=
dogBirthdayAge
;
globals
.
age
=
dogBirthdayAge
;
dogName
=
globals
.
dogName
;
});
});
getTotalWalkingMinutes
(
datee
,
dog
);
getTotalWalkingMinutes
(
datee
,
dog
);
}
}
...
@@ -124,8 +131,11 @@ class _ProfilePageState extends State<ProfilePage> {
...
@@ -124,8 +131,11 @@ class _ProfilePageState extends State<ProfilePage> {
sliderValue
=
3
;
sliderValue
=
3
;
}
}
globals
.
status
=
data
[
'status'
];
globals
.
status
=
data
[
'status'
];
status
=
globals
.
status
;
globals
.
sliderValue
=
sliderValue
;
globals
.
sliderValue
=
sliderValue
;
loading
=
false
;
loading
=
false
;
_showNotification
();
});
});
});
});
}
}
...
@@ -133,9 +143,42 @@ class _ProfilePageState extends State<ProfilePage> {
...
@@ -133,9 +143,42 @@ class _ProfilePageState extends State<ProfilePage> {
@override
@override
void
initState
()
{
void
initState
()
{
super
.
initState
();
super
.
initState
();
var
androidInitilize
=
new
AndroidInitializationSettings
(
'download'
);
var
iOSinitilize
=
new
IOSInitializationSettings
();
var
initilizationsSettings
=
new
InitializationSettings
(
android:
androidInitilize
,
iOS:
iOSinitilize
);
fltrNotification
=
new
FlutterLocalNotificationsPlugin
();
fltrNotification
.
initialize
(
initilizationsSettings
,
onSelectNotification:
notificationSelected
);
getTotalActivityMinutesPerDay
(
globals
.
birthday
,
globals
.
dogId
);
getTotalActivityMinutesPerDay
(
globals
.
birthday
,
globals
.
dogId
);
}
}
Future
_showNotification
()
async
{
final
String
currentTimeZone
=
await
FlutterNativeTimezone
.
getLocalTimezone
();
tz
.
initializeTimeZones
();
tz
.
setLocalLocation
(
tz
.
getLocation
(
currentTimeZone
));
var
androidDetails
=
new
AndroidNotificationDetails
(
"Channel ID"
,
"Desi programmer"
,
"This is my channel"
,
importance:
Importance
.
max
);
var
iSODetails
=
new
IOSNotificationDetails
();
var
generalNotificationDetails
=
new
NotificationDetails
(
android:
androidDetails
,
iOS:
iSODetails
);
await
fltrNotification
.
periodicallyShow
(
1
,
'Dog Status'
,
"
$dogName
's activity level is
$status
"
,
RepeatInterval
.
everyMinute
,
generalNotificationDetails
,
androidAllowWhileIdle:
true
);
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
loading
return
loading
...
@@ -245,4 +288,13 @@ class _ProfilePageState extends State<ProfilePage> {
...
@@ -245,4 +288,13 @@ class _ProfilePageState extends State<ProfilePage> {
),
),
);
);
}
}
Future
notificationSelected
(
String
payload
)
async
{
showDialog
(
context:
context
,
builder:
(
context
)
=>
AlertDialog
(
content:
Text
(
"Notification :
$payload
"
),
),
);
}
}
}
fitnessapp/lib/Screens/Login/components/body.dart
View file @
bc9e61b5
...
@@ -30,11 +30,8 @@ class _BodyState extends State<Body> {
...
@@ -30,11 +30,8 @@ class _BodyState extends State<Body> {
login
()
async
{
login
()
async
{
if
(
username
==
''
&&
password
==
''
)
{
if
(
username
==
''
&&
password
==
''
)
{
print
(
"OOPS"
);
this
.
enterDetails
=
true
;
this
.
enterDetails
=
true
;
}
else
{
}
else
{
print
(
"HEREEEEEEE"
);
SearchService
.
login
(
username
,
password
).
then
((
responseBody
)
{
SearchService
.
login
(
username
,
password
).
then
((
responseBody
)
{
print
(
username
);
print
(
username
);
...
...
fitnessapp/lib/Screens/WalkingPatternRecognition/service.dart
View file @
bc9e61b5
...
@@ -3,7 +3,7 @@ import 'dart:convert';
...
@@ -3,7 +3,7 @@ import 'dart:convert';
import
'package:fitnessapp/globals.dart'
as
globals
;
import
'package:fitnessapp/globals.dart'
as
globals
;
class
SearchService
{
class
SearchService
{
static
String
ip
=
'http://192.168.
8.103
:8000'
;
static
String
ip
=
'http://192.168.
1.7
:8000'
;
static
String
username
=
'Janadi'
;
static
String
username
=
'Janadi'
;
static
String
password
=
'janadi2.'
;
static
String
password
=
'janadi2.'
;
static
String
basicAuth
=
static
String
basicAuth
=
...
...
fitnessapp/lib/Screens/Welcome/components/body.dart
View file @
bc9e61b5
...
@@ -3,6 +3,10 @@ import 'package:fitnessapp/Screens/Login/login_screen.dart';
...
@@ -3,6 +3,10 @@ import 'package:fitnessapp/Screens/Login/login_screen.dart';
import
'package:fitnessapp/Screens/Signup/signup_screen.dart'
;
import
'package:fitnessapp/Screens/Signup/signup_screen.dart'
;
import
'package:fitnessapp/Screens/Welcome/components/background.dart'
;
import
'package:fitnessapp/Screens/Welcome/components/background.dart'
;
import
'package:fitnessapp/constants.dart'
;
import
'package:fitnessapp/constants.dart'
;
import
'package:flutter_local_notifications/flutter_local_notifications.dart'
;
import
'package:timezone/data/latest.dart'
as
tz
;
import
'package:timezone/timezone.dart'
as
tz
;
import
'package:flutter_native_timezone/flutter_native_timezone.dart'
;
class
Body
extends
StatefulWidget
{
class
Body
extends
StatefulWidget
{
@override
@override
...
@@ -10,6 +14,44 @@ class Body extends StatefulWidget {
...
@@ -10,6 +14,44 @@ class Body extends StatefulWidget {
}
}
class
_BodyState
extends
State
<
Body
>
{
class
_BodyState
extends
State
<
Body
>
{
FlutterLocalNotificationsPlugin
fltrNotification
;
@override
void
initState
()
{
super
.
initState
();
// var androidInitilize = new AndroidInitializationSettings('download');
// var iOSinitilize = new IOSInitializationSettings();
// var initilizationsSettings = new InitializationSettings(
// android: androidInitilize, iOS: iOSinitilize);
// fltrNotification = new FlutterLocalNotificationsPlugin();
// fltrNotification.initialize(initilizationsSettings,
// onSelectNotification: notificationSelected);
// _showNotification();
}
// Future _showNotification() async {
// final String currentTimeZone =
// await FlutterNativeTimezone.getLocalTimezone();
// tz.initializeTimeZones();
// tz.setLocalLocation(tz.getLocation(currentTimeZone));
// var androidDetails = new AndroidNotificationDetails(
// "Channel ID", "Desi programmer", "This is my channel",
// importance: Importance.max);
// var iSODetails = new IOSNotificationDetails();
// var generalNotificationDetails =
// new NotificationDetails(android: androidDetails, iOS: iSODetails);
// await fltrNotification.periodicallyShow(
// 1,
// 'Times Uppp',
// 'Scheduled Notification',
// RepeatInterval.everyMinute,
// generalNotificationDetails,
// androidAllowWhileIdle: true);
// }
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Background
(
return
Background
(
...
@@ -65,10 +107,37 @@ class _BodyState extends State<Body> {
...
@@ -65,10 +107,37 @@ class _BodyState extends State<Body> {
shape:
RoundedRectangleBorder
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
30
)),
borderRadius:
BorderRadius
.
circular
(
30
)),
),
),
)
),
// ButtonTheme(
// buttonColor: Colors.white,
// minWidth: 320,
// height: 55,
// child: OutlineButton(
// onPressed: () {
// _showNotification();
// },
// child: Text(
// "Notification",
// style: TextStyle(
// color: kPrimaryColor, fontWeight: FontWeight.bold),
// ),
// borderSide: BorderSide(color: kPrimaryColor, width: 2),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(30)),
// ),
// )
],
],
),
),
),
),
);
);
}
}
// Future notificationSelected(String payload) async {
// showDialog(
// context: context,
// builder: (context) => AlertDialog(
// content: Text("Notification : $payload"),
// ),
// );
// }
}
}
fitnessapp/lib/commons/my_info.dart
View file @
bc9e61b5
...
@@ -47,7 +47,7 @@ class _MyInfoState extends State<MyInfo> {
...
@@ -47,7 +47,7 @@ class _MyInfoState extends State<MyInfo> {
Row
(
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
children:
<
Widget
>[
globals
.
age
>
0
||
globals
.
age
==
0
globals
.
age
>
1
||
globals
.
age
==
0
?
Text
(
?
Text
(
globals
.
age
.
toString
()
+
" years"
,
globals
.
age
.
toString
()
+
" years"
,
style:
whiteSubHeadingTextStyle
,
style:
whiteSubHeadingTextStyle
,
...
...
fitnessapp/pubspec.lock
View file @
bc9e61b5
...
@@ -195,6 +195,27 @@ packages:
...
@@ -195,6 +195,27 @@ packages:
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "0.8.1"
version: "0.8.1"
flutter_local_notifications:
dependency: "direct main"
description:
name: flutter_local_notifications
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.2"
flutter_local_notifications_platform_interface:
dependency: transitive
description:
name: flutter_local_notifications_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0+1"
flutter_native_timezone:
dependency: "direct main"
description:
name: flutter_native_timezone
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
flutter_plugin_android_lifecycle:
flutter_plugin_android_lifecycle:
dependency: transitive
dependency: transitive
description:
description:
...
@@ -567,6 +588,13 @@ packages:
...
@@ -567,6 +588,13 @@ packages:
url: "https://pub.dartlang.org"
url: "https://pub.dartlang.org"
source: hosted
source: hosted
version: "0.2.17"
version: "0.2.17"
timezone:
dependency: transitive
description:
name: timezone
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.9"
typed_data:
typed_data:
dependency: transitive
dependency: transitive
description:
description:
...
...
fitnessapp/pubspec.yaml
View file @
bc9e61b5
...
@@ -38,6 +38,8 @@ dependencies:
...
@@ -38,6 +38,8 @@ dependencies:
flutter_spinkit
:
^4.1.2
flutter_spinkit
:
^4.1.2
google_fonts
:
^1.1.0
google_fonts
:
^1.1.0
flutter_launcher_icons
:
^0.8.1
flutter_launcher_icons
:
^0.8.1
flutter_local_notifications
:
^3.0.2
flutter_native_timezone
:
^1.0.4
dev_dependencies
:
dev_dependencies
:
flutter_test
:
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