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

update newer version of Flutter, newer versions of deps #3

Merged
merged 1 commit into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion beyond/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 1b66dae606f75376c5f2135a8290850eeb09ae83

COCOAPODS: 1.9.1
COCOAPODS: 1.9.3
14 changes: 1 addition & 13 deletions beyond/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
55C20923CCDD20EF67347A34 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 983CADD3BAF26E649B0081EF /* Pods_Runner.framework */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
Expand All @@ -28,8 +24,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -40,13 +34,11 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand All @@ -63,8 +55,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
55C20923CCDD20EF67347A34 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -94,9 +84,7 @@
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
Expand Down Expand Up @@ -254,7 +242,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
8 changes: 4 additions & 4 deletions beyond/lib/domain/manager/auth_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ part 'auth_manager.g.dart';
class AuthManager = _AuthManager with _$AuthManager;

abstract class _AuthManager with Store {
static const loginTokenKey = "loginToken";
static const loginTokenKey = 'loginToken';

final ApiService _api;
final SharedPreferencesService _sharedPreferencesService;
Expand Down Expand Up @@ -45,7 +45,7 @@ abstract class _AuthManager with Store {
@action
Future logout() async {
_api.token = null;
await _sharedPreferencesService.setString(loginTokenKey, "");
await _sharedPreferencesService.setString(loginTokenKey, '');
authState = AuthState();
}
}
Expand All @@ -65,8 +65,8 @@ class AuthState {
}

return other is AuthState &&
this.token == other.token &&
this.isLoggedIn == other.isLoggedIn;
token == other.token &&
isLoggedIn == other.isLoggedIn;
}

@override
Expand Down
22 changes: 11 additions & 11 deletions beyond/lib/domain/manager/auth_manager.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 47 additions & 48 deletions beyond/lib/service/api_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ class ApiService {
/// This performs a fake login for demo purposes
Future<ApiResponse<String>> getAuthToken(String username, String password) {
return Future.delayed(
Duration(milliseconds: 500), () => ApiResponse(200, data: "token"));
Duration(milliseconds: 500), () => ApiResponse(200, data: 'token'));
}

Future<ApiResponse<Place>> getPlace(double longitude, double latitude) async {
var response = await http.get(
"https://us1.locationiq.com/v1/reverse.php?key=${_configService.locationIqApiKey}&lat=$latitude&lon=$longitude&format=json",
'https://us1.locationiq.com/v1/reverse.php?key=${_configService.locationIqApiKey}&lat=$latitude&lon=$longitude&format=json',
headers: getHeaders(),
);

Expand All @@ -38,30 +38,29 @@ class ApiService {
double longitude, double latitude, String type,
{int radius = 500}) async {
var response = await http.get(
"https://us1.locationiq.com/v1/nearby.php?key=${_configService.locationIqApiKey}&lat=$latitude&lon=$longitude&tag=$type&radius=$radius&format=json",
'https://us1.locationiq.com/v1/nearby.php?key=${_configService.locationIqApiKey}&lat=$latitude&lon=$longitude&tag=$type&radius=$radius&format=json',
headers: getHeaders(),
);

if (_isSuccessStatusCode(response.statusCode)) {
Iterable list = json.decode(response.body);
List<PointOfInterest> data =
list.map((x) => PointOfInterest.fromJson(x)).toList();
var data = list.map((x) => PointOfInterest.fromJson(x)).toList();
return ApiResponse(response.statusCode, data: data);
} else {
return ApiResponse(response.statusCode, error: response.body);
}
}

String getStaticMapImageUrl(String longitude, String latitude) {
return "https://maps.locationiq.com/v2/staticmap?key=${_configService.locationIqApiKey}&size=600x600&zoom=17&markers=$latitude,$longitude|icon:large-blue-cutout;&format=png";
return 'https://maps.locationiq.com/v2/staticmap?key=${_configService.locationIqApiKey}&size=600x600&zoom=17&markers=$latitude,$longitude|icon:large-blue-cutout;&format=png';
}

/// It is common practice to send some app information as headers on API requests
/// This can help you analyze usage in the field
Map<String, String> getHeaders() {
return {
"Version": _packageInfoService.version,
"BuildNumber": _packageInfoService.buildNumber,
'Version': _packageInfoService.version,
'BuildNumber': _packageInfoService.buildNumber,
};
}
}
Expand Down Expand Up @@ -98,23 +97,23 @@ class Place {
});

factory Place.fromJson(Map<String, dynamic> json) => Place(
placeId: json["place_id"],
licence: json["licence"],
lat: json["lat"],
lon: json["lon"],
displayName: json["display_name"],
importance: json["importance"].toDouble(),
address: Address.fromJson(json["address"]),
placeId: json['place_id'],
licence: json['licence'],
lat: json['lat'],
lon: json['lon'],
displayName: json['display_name'],
importance: json['importance'].toDouble(),
address: Address.fromJson(json['address']),
);

Map<String, dynamic> toJson() => {
"place_id": placeId,
"licence": licence,
"lat": lat,
"lon": lon,
"display_name": displayName,
"importance": importance,
"address": address.toJson(),
'place_id': placeId,
'licence': licence,
'lat': lat,
'lon': lon,
'display_name': displayName,
'importance': importance,
'address': address.toJson(),
};
}

Expand All @@ -140,25 +139,25 @@ class Address {
});

factory Address.fromJson(Map<String, dynamic> json) => Address(
houseNumber: json["house_number"],
road: json["road"],
city: json["city"],
county: json["county"],
state: json["state"],
postcode: json["postcode"],
country: json["country"],
countryCode: json["country_code"],
houseNumber: json['house_number'],
road: json['road'],
city: json['city'],
county: json['county'],
state: json['state'],
postcode: json['postcode'],
country: json['country'],
countryCode: json['country_code'],
);

Map<String, dynamic> toJson() => {
"house_number": houseNumber,
"road": road,
"city": city,
"county": county,
"state": state,
"postcode": postcode,
"country": country,
"country_code": countryCode,
'house_number': houseNumber,
'road': road,
'city': city,
'county': county,
'state': state,
'postcode': postcode,
'country': country,
'country_code': countryCode,
};
}

Expand All @@ -179,18 +178,18 @@ class PointOfInterest {

factory PointOfInterest.fromJson(Map<String, dynamic> json) =>
PointOfInterest(
lat: json["lat"],
lon: json["lon"],
tagType: json["tag_type"],
name: json["name"],
distance: json["distance"],
lat: json['lat'],
lon: json['lon'],
tagType: json['tag_type'],
name: json['name'],
distance: json['distance'],
);

Map<String, dynamic> toJson() => {
"lat": lat,
"lon": lon,
"tag_type": tagType,
"name": name,
"distance": distance,
'lat': lat,
'lon': lon,
'tag_type': tagType,
'name': name,
'distance': distance,
};
}
2 changes: 1 addition & 1 deletion beyond/lib/service/config/config.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Get an API key from https://locationiq.com/
String locationIqApiKey = "";
String locationIqApiKey = '';
2 changes: 1 addition & 1 deletion beyond/lib/service/location_service.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:geolocator/geolocator.dart';

class LocationService {
Geolocator _geolocator = Geolocator();
final Geolocator _geolocator = Geolocator();

Future<Position> getCurrentPosition(
{LocationAccuracy desiredAccuracy = LocationAccuracy.best,
Expand Down
8 changes: 4 additions & 4 deletions beyond/lib/ui/home/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class HomePage extends StatelessWidget {
viewModel: viewModel,
child: Scaffold(
appBar: AppBar(
title: Text("Home"),
title: Text('Home'),
),
body: SafeArea(
child: Padding(
Expand Down Expand Up @@ -52,7 +52,7 @@ class HomePage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
"Nearby Parks",
'Nearby Parks',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
SizedBox(height: 5),
Expand Down Expand Up @@ -91,7 +91,7 @@ class HomePage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
"Current Location",
'Current Location',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
SizedBox(height: 5),
Expand Down Expand Up @@ -134,7 +134,7 @@ class HomePage extends StatelessWidget {
borderRadius: BorderRadius.circular(30),
),
child: Text(
"LOGOUT",
'LOGOUT',
textAlign: TextAlign.center,
),
);
Expand Down
6 changes: 3 additions & 3 deletions beyond/lib/ui/home/home_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abstract class _HomeViewModel extends ViewModel with Store {
final NavigationManager _navigationManager;

@observable
String currentLocation = "";
String currentLocation = '';

@observable
bool isCurrentLocationLoading = true;
Expand Down Expand Up @@ -70,7 +70,7 @@ abstract class _HomeViewModel extends ViewModel with Store {
Future _getNearbyParks(Position position) async {
isNearbyParksLoading = true;
var x = await _apiService.getPointsOfInterest(
position.longitude, position.latitude, "park");
position.longitude, position.latitude, 'park');
if (x.isSuccess) {
nearbyParks = x.data
.where((x) => x.name != null)
Expand All @@ -91,5 +91,5 @@ class ParkListItem {

ParkListItem(this.park);

String get nameAndDistance => "${park.name} is ${park.distance} meters away";
String get nameAndDistance => '${park.name} is ${park.distance} meters away';
}
Loading