Skip to content

Commit

Permalink
Merge pull request #31 from nuilewis/main
Browse files Browse the repository at this point in the history
Added closest source calculation features, Removed exposed API keys, arranged other stuff, made UI changes, and more
  • Loading branch information
DSCUBa2020 committed Sep 12, 2021
2 parents cb21a4b + d39e5f4 commit 4653b0d
Show file tree
Hide file tree
Showing 30 changed files with 801 additions and 497 deletions.
4 changes: 4 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,4 @@
{
"dart.previewFlutterUiGuides": true,
"dart.previewFlutterUiGuidesCustomTracking": true
}
1 change: 1 addition & 0 deletions Assets/icons/svgs/fi-rr-home-alt.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Assets/icons/svgs/fi-sr-home-alt-filled.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Assets/icons/svgs/fi-sr-search-filled.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Assets/icons/svgs/fi-sr-user-filled.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Assets/icons/svgs/fi-sr-user.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/images/marker-icon-green-small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/images/marker-icon-red-small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions android/app/google-services.json
Expand Up @@ -20,7 +20,7 @@
],
"api_key": [
{
"current_key": "AIzaSyBkw-O_rAY5UTYDmj3Rl6-kWjg57Ze48nw"
"current_key": "YOUR GOOGLE MAPS API KEY HERE"
}
],
"services": {
Expand All @@ -36,4 +36,4 @@
}
],
"configuration_version": "1"
}
}
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Expand Up @@ -8,7 +8,7 @@
android:icon="@mipmap/ic_launcher">
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyD9wO2GB7X6X8MTM1avTDWscKgYyFhin28" />
android:value="YOUR GOOGLE MAPS API KEY HERE" />
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
Expand Down
25 changes: 8 additions & 17 deletions lib/Components/bottom_sheet_info.dart
@@ -1,4 +1,3 @@
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flow/Components/directions/distance_calculator.dart';
import 'package:flutter/material.dart';
import 'package:flow/constants.dart';
Expand All @@ -19,7 +18,7 @@ class BottomSheetInfo extends StatefulWidget {
final bool bottomSheetIsTypeTap;
final bool bottomSheetIsFlowing;
final String distance;
final GeoPoint tapLocation;
final LatLng tapLocation;

BottomSheetInfo({
Key key,
Expand Down Expand Up @@ -101,18 +100,6 @@ class BottomSheetInfoState extends State<BottomSheetInfo> {
print('current location data is $currentLocation');

return currentLocation;

// PermissionStatus currentPermissionStatus;
// if (currentPermissionStatus == PermissionStatus.granted) {
// print('get current locationf from bottom sheet is running');
// final LocationData currentLocData = await getLocation();
// currentLocation =
// LatLng(currentLocData.latitude, currentLocData.longitude);
//
// print('current location data is $currentLocation');
//
// return currentLocation;
// }
}

///method to call the distance calculator
Expand Down Expand Up @@ -142,8 +129,9 @@ class BottomSheetInfoState extends State<BottomSheetInfo> {
ifIsFlowing = 'Not Flowing';
}

markerLocation =
LatLng(widget.tapLocation.latitude, widget.tapLocation.longitude);
// markerLocation =
// LatLng(widget.tapLocation.latitude, widget.tapLocation.longitude);
markerLocation = widget.tapLocation;

// if (estDistance == null) {
// setState(() {
Expand Down Expand Up @@ -310,7 +298,8 @@ class BottomSheetInfoState extends State<BottomSheetInfo> {
savedDistance: '$estDistance Km',
savedFlowing: widget.bottomSheetIsFlowing,
savedTypeTap: ifIsTypeTap,
//savedTapLocation: widget.tapLocation,
savedTapLocationLatitude: markerLocation.latitude.toDouble(),
savedTapLocationLongitude: markerLocation.longitude.toDouble(),

// savedisSaved: isSaved,
));
Expand Down Expand Up @@ -339,6 +328,8 @@ class BottomSheetInfoState extends State<BottomSheetInfo> {
savedDistance: widget.distance.toString(),
savedFlowing: widget.bottomSheetIsFlowing,
savedTypeTap: ifIsTypeTap,
savedTapLocationLatitude: markerLocation.latitude.toDouble(),
savedTapLocationLongitude: markerLocation.longitude.toDouble(),
// savedisSaved: isSaved,
),
widget.bottomSheetID,
Expand Down
43 changes: 43 additions & 0 deletions lib/Components/custom_dialog_route.dart
@@ -0,0 +1,43 @@
import 'package:flutter/material.dart';

///{@template custom hero_dialod_route}
///Custom [PageRoute] that creates an overlay dialog popup effect
///
///Best used with a [Hero] animation
class CustomHeroDialogRoute<T> extends PageRoute<T> {
CustomHeroDialogRoute({
@required WidgetBuilder builder,
RouteSettings settings,
bool fullscreenDialog = false,
}) : _builder = builder,
super(settings: settings, fullscreenDialog: fullscreenDialog);

final WidgetBuilder _builder;

@override
bool get opaque => false;
@override
bool get barrierDismissible => true;
@override
Duration get transitionDuration => const Duration(milliseconds: 300);
@override
bool get maintainState => true;

@override
Color get barrierColor => Colors.black54;
@override
Widget buildTransitions(BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation, Widget child) {
return child;
}

@override
Widget buildPage(BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation) {
return _builder(context);
}

@override
String get barrierLabel => 'Popup dialog open';
}
1 change: 1 addition & 0 deletions lib/Components/directions/.env.dart
@@ -0,0 +1 @@
const String googleAPIKey = 'YOUR API KEY HERE';
122 changes: 82 additions & 40 deletions lib/Components/directions/nav_instructions.dart
Expand Up @@ -21,51 +21,93 @@ class NavigationInstructions extends StatelessWidget {

@override
Widget build(BuildContext context) {
return DraggableScrollableSheet(
minChildSize: .2,
maxChildSize: .6,
builder: (
context,
scrollController,
) {
return SingleChildScrollView(
controller: scrollController,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.vertical(top: Radius.circular(15)),
color: primarycolor,
),
child: Stack(
children: [
Column(
children: [
Text('Navigating To..'),
Text(tapID),
Text(tapDescription),
Row(
Size screenSize = MediaQuery.of(context).size;
return Material(
child: DraggableScrollableSheet(
minChildSize: .3,
maxChildSize: .6,
builder: (
context,
scrollController,
) {
return SingleChildScrollView(
controller: scrollController,
child: Container(
height: screenSize.height * .5,
decoration: BoxDecoration(
borderRadius: BorderRadius.vertical(top: Radius.circular(15)),
color: Colors.white,
),
child: Stack(
children: [
Positioned(
top: 5,
left: 5,
child: Text(
'Navigating To..',
style: TextStyle(
fontSize: 42,
fontWeight: FontWeight.bold,
color: Colors.black12),
),
),
Padding(
padding: const EdgeInsets.fromLTRB(20, 40, 0, 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(distance),
Text(time),
HeadlineTextBold(
title: tapID,
color: primarycolor,
),
SizedBox(height: 10),
BodyText(
title: tapDescription,
color: textcolor,
),
// Row(
// children: [
// Text(distance),
// Text(time),
// ],
// )
],
)
],
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white,
),
),
child: SingleChildScrollView(
// child: ListView.builder(
// itemBuilder: ,
// ),
Positioned(
top: screenSize.height * .2,
left: 0,
right: 0,
child: Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.blue,
),
child: SingleChildScrollView(
child: Column(
children: [
Text('sup'),
Text('sup'),
Text('sup'),
Text('sup'),
Text('sup'),
Text('sup'),
Text('sup'),
],
),
// child: ListView.builder(
// itemBuilder: ,
// ),
),
),
],
),
),
],
),
),
),
);
});
);
}),
);
}
}

Expand Down

0 comments on commit 4653b0d

Please sign in to comment.