Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #2

Merged
merged 39 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
8f5b634
feat: integrated auth related queries and mutations
nb9960 Jun 20, 2021
c21dfe0
feat: add models and update home screen
nb9960 Jun 27, 2021
5219756
feat: integrated create beacon and update leader loc mutations
nb9960 Jun 29, 2021
b41f8e4
ft: added hike screen view model
nb9960 Jul 1, 2021
45b6854
ft: joinBeacon mutation and share link
nb9960 Jul 2, 2021
dc7b2f1
ft: update leaderlocation on location change, add route, markers and …
nb9960 Jul 5, 2021
23044f3
fix: getToken after signup
nb9960 Jul 7, 2021
4481a6d
ft: merge follower update and location update streams
nb9960 Jul 8, 2021
4f0433e
adds fall back mechanism if user denies to share the location
nb9960 Jul 9, 2021
db38954
ft: add logout option and fix token
nb9960 Jul 10, 2021
2d86d6d
fix
nb9960 Jul 10, 2021
27037fb
updated log out button ui and hike screen panel
nb9960 Jul 11, 2021
f8b0523
add validators and improvise error handling
nb9960 Jul 11, 2021
7590894
fixes login as guest and validation msgs
nb9960 Jul 12, 2021
354bacb
Add logout dialog
nb9960 Jul 12, 2021
90793eb
fix navigation and remove unnecessary validator
nb9960 Jul 20, 2021
8c3b730
login as guest if joinBeacon is called and user is not logged in
nb9960 Jul 20, 2021
2c65cae
Add duration instead of DateTime for expiringAt field
nb9960 Jul 22, 2021
993e8b0
modified user model to support guest user
nb9960 Jul 22, 2021
4ba8b54
skip auth and add isGuest field
nb9960 Aug 7, 2021
a5e8f3c
add landmark model and queries and refractor code
nb9960 Aug 8, 2021
a7c752f
update createBeacon query to add startLocation
nb9960 Aug 9, 2021
c5a9aa1
modify beacon model to store landmarks
nb9960 Aug 9, 2021
31e207a
modify beacon model to store most recent loc
nb9960 Aug 9, 2021
ddacc33
saves beacons locally
nb9960 Aug 9, 2021
baba4eb
modifies main screen to display beacons
nb9960 Aug 10, 2021
8d7bbe0
fetch nearby beacons
nb9960 Aug 11, 2021
ba1d82f
add location and landmark model in local storage
nb9960 Aug 11, 2021
7196529
add createLandmark mutation and updated subscription flow
nb9960 Aug 11, 2021
091de40
auth bug fix
nb9960 Aug 13, 2021
d67d6ca
fix startTime in card and add create landmark method
nb9960 Aug 13, 2021
a95de36
fetch subscription data based on condition
nb9960 Aug 13, 2021
07a5c46
add icon and update app name
nb9960 Aug 14, 2021
3ffb2ec
add additional query to fetch beacon detail on screen launch
nb9960 Aug 15, 2021
c850c42
check if location is off before fetching nearby beacons
nb9960 Aug 15, 2021
cfbbd13
fix null error
nb9960 Aug 16, 2021
2ed320f
fix location access bug
nb9960 Aug 16, 2021
9faed2c
add non null constraint for landmark title
nb9960 Aug 16, 2021
96dcb41
modifies ui for shimmer effect
nb9960 Aug 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ if (flutterVersionName == null) {

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"


Expand Down Expand Up @@ -59,7 +58,6 @@ flutter {
}

dependencies {
implementation "com.google.android.gms:play-services-basement:17.5.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.android.support:multidex:1.0.3"
}
16 changes: 8 additions & 8 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<application
android:label="beacon"
android:icon="@mipmap/ic_launcher"
android:label="Beacon"
android:icon="@mipmap/launcher_icon"
android:usesCleartextTraffic="true">
<meta-data android:name="com.google.android.geo.API_KEY" android:value="AIzaSyCXlRxfbr9Y368nLy8o59r0_XZmHdK5-2w"/>
<activity
Expand Down Expand Up @@ -38,15 +40,13 @@
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<meta-data android:name="flutter_deeplinking_enabled" android:value="true" />
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="beacon.page.link"
android:scheme="https" />
<data android:scheme="http" android:host="beacon.aadibajpai.com" />
<data android:scheme="https" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ buildscript {
}

dependencies {
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
Expand Down
Binary file added images/icon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/marker.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -468,4 +468,4 @@
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 0 additions & 29 deletions lib/api/queries.dart

This file was deleted.

178 changes: 178 additions & 0 deletions lib/components/beacon_card.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
import 'dart:io';

import 'package:beacon/locator.dart';
import 'package:beacon/models/beacon/beacon.dart';
import 'package:beacon/utilities/constants.dart';
import 'package:beacon/view_model/home_view_model.dart';
import 'package:beacon/views/hike_screen.dart';
import 'package:flutter/material.dart';
import 'package:geocoder/geocoder.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:skeleton_text/skeleton_text.dart';
import 'package:intl/intl.dart';

class BeaconCustomWidgets {
static final Color textColor = Color(0xFFAFAFAF);

static Widget getBeaconCard(BuildContext context, Beacon beacon) {
return GestureDetector(
onTap: () async {
bool isJoinee = false;
for (var i in beacon.followers) {
if (i.id == userConfig.currentUser.id) {
isJoinee = true;
}
}
if (beacon.leader.id == userConfig.currentUser.id || isJoinee) {
navigationService.pushScreen('/hikeScreen',
arguments: HikeScreen(
beacon,
isLeader: (beacon.leader.id == userConfig.currentUser.id),
));
} else {
databaseFunctions.init();
final Beacon _beacon =
await databaseFunctions.joinBeacon(beacon.shortcode);
if (_beacon != null) {
navigationService.pushScreen('/hikeScreen',
arguments: HikeScreen(beacon, isLeader: false));
} else {
navigationService.showSnackBar('Something went wrong');
}
}
},
child: Container(
margin: const EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 10.0,
),
height: 110,
padding: EdgeInsets.only(left: 16.0, right: 16.0, bottom: 8, top: 8),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text('${beacon?.title} by ${beacon.leader.name}',
style: Style.titleTextStyle),
SizedBox(height: 4.0),
Text('Passkey: ${beacon?.shortcode}', style: Style.commonTextStyle),
SizedBox(height: 4.0),
(beacon.startsAt != null)
? Text(
'Starts At: ${DateFormat("hh:mm a, d/M/y").format(DateTime.fromMillisecondsSinceEpoch(beacon.startsAt)).toString()}',
style: Style.commonTextStyle)
: Container(),
SizedBox(height: 4.0),
(beacon.expiresAt != null)
? Text(
'Expires At: ${DateFormat("hh:mm a, d/M/y").format(DateTime.fromMillisecondsSinceEpoch(beacon.expiresAt)).toString()}',
style: Style.commonTextStyle)
: Container(),
],
),
decoration: BoxDecoration(
color: kBlue,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8.0),
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.black26,
blurRadius: 10.0,
offset: Offset(0.0, 10.0),
),
],
),
),
);
}

static ListView getPlaceholder() {
final BorderRadius borderRadius = BorderRadius.circular(10.0);
return ListView.builder(
scrollDirection: Axis.vertical,
physics: BouncingScrollPhysics(),
itemCount: 3,
padding: const EdgeInsets.all(8.0),
itemBuilder: (BuildContext context, int index) {
return Container(
margin: const EdgeInsets.symmetric(
vertical: 10.0,
horizontal: 10.0,
),
height: 110,
decoration: BoxDecoration(
color: kBlue,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8.0),
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.black26,
blurRadius: 10.0,
offset: Offset(0.0, 10.0),
),
],
),
padding:
EdgeInsets.only(left: 16.0, right: 16.0, bottom: 10, top: 10),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(
left: 15.0, bottom: 10.0, right: 15.0),
child: ClipRRect(
borderRadius: borderRadius,
child: SkeletonAnimation(
child: Container(
height: 15.0,
decoration: BoxDecoration(color: shimmerSkeletonColor),
),
),
),
),
Padding(
padding: const EdgeInsets.only(
left: 15.0, right: 30.0, bottom: 10.0),
child: ClipRRect(
borderRadius: borderRadius,
child: SkeletonAnimation(
child: Container(
height: 10.0,
decoration: BoxDecoration(color: shimmerSkeletonColor),
),
),
),
),
Padding(
padding: const EdgeInsets.only(
left: 15.0, right: 45.0, bottom: 10.0),
child: ClipRRect(
borderRadius: BorderRadius.circular(10.0),
child: SkeletonAnimation(
child: Container(
height: 10.0,
decoration: BoxDecoration(color: shimmerSkeletonColor),
),
),
),
),
Padding(
padding: const EdgeInsets.only(left: 15.0, right: 60.0),
child: ClipRRect(
borderRadius: BorderRadius.circular(10.0),
child: SkeletonAnimation(
child: Container(
height: 10.0,
decoration: BoxDecoration(color: shimmerSkeletonColor),
),
),
),
),
],
),
);
});
}
}
Loading