Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

Commit

Permalink
feat: Maps API Migration, Minor Bugs Fixed , Version Upgraded
Browse files Browse the repository at this point in the history
  • Loading branch information
HoussemTN committed Oct 15, 2020
1 parent cf21dce commit e1b0245
Show file tree
Hide file tree
Showing 12 changed files with 208 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"app_settings","dependencies":[]},{"name":"fluttertoast","dependencies":[]},{"name":"geolocator","dependencies":["google_api_availability","location_permissions"]},{"name":"google_api_availability","dependencies":[]},{"name":"location_permissions","dependencies":[]},{"name":"path_provider","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"shared_preferences","dependencies":[]},{"name":"sqflite","dependencies":[]}]}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"app_settings","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\app_settings-4.0.4\\\\","dependencies":[]},{"name":"fluttertoast","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\fluttertoast-3.1.0\\\\","dependencies":[]},{"name":"geolocator","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\geolocator-5.1.5\\\\","dependencies":["location_permissions"]},{"name":"location_permissions","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\location_permissions-2.0.5\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.18\\\\","dependencies":[]},{"name":"permission_handler","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler-4.0.0\\\\","dependencies":[]},{"name":"shared_preferences","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences-0.4.3\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-1.3.1+1\\\\","dependencies":[]}],"android":[{"name":"app_settings","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\app_settings-4.0.4\\\\","dependencies":[]},{"name":"fluttertoast","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\fluttertoast-3.1.0\\\\","dependencies":[]},{"name":"geolocator","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\geolocator-5.1.5\\\\","dependencies":["google_api_availability","location_permissions"]},{"name":"google_api_availability","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\google_api_availability-2.0.4\\\\","dependencies":[]},{"name":"location_permissions","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\location_permissions-2.0.5\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.18\\\\","dependencies":[]},{"name":"permission_handler","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler-4.0.0\\\\","dependencies":[]},{"name":"shared_preferences","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences-0.4.3\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-1.3.1+1\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-0.0.4+4\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-1.3.1+1\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-0.0.1+2\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-0.0.4+1\\\\","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"app_settings","dependencies":[]},{"name":"fluttertoast","dependencies":[]},{"name":"geolocator","dependencies":["google_api_availability","location_permissions"]},{"name":"google_api_availability","dependencies":[]},{"name":"location_permissions","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"shared_preferences","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2020-10-15 15:09:49.039755","version":"1.22.1"}
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<meta-data android:name="flutterEmbedding" android:value="2"/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
package com.brains404.localizer;

import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.embedding.android.FlutterActivity;


public class MainActivity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}

}
11 changes: 8 additions & 3 deletions ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\flutter"
export "FLUTTER_APPLICATION_PATH=C:\Users\Houssem\AndroidStudioProjects\localizer"
export "FLUTTER_APPLICATION_PATH=C:\Users\Houssem\AndroidStudioProjects\localizator"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build\ios"
export "OTHER_LDFLAGS=$(inherited) -framework Flutter"
export "FLUTTER_FRAMEWORK_DIR=C:\flutter\bin\cache\artifacts\engine\ios"
export "FLUTTER_BUILD_NAME=1.4.0"
export "FLUTTER_BUILD_NUMBER=1.4.0"
export "FLUTTER_BUILD_NAME=1.5.1"
export "FLUTTER_BUILD_NUMBER=1.5.1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
10 changes: 5 additions & 5 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import './views/ErrorView.dart';
import './views/TabsView.dart';
import './views/splashView.dart';

main() {

// SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]).then((_) {
runApp( MyApp( ) );

//});

}


Expand All @@ -18,6 +14,10 @@ class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
]);
ErrorWidget.builder = getErrorWidget;
return MaterialApp(
theme: ThemeData(
Expand Down
9 changes: 5 additions & 4 deletions lib/views/FavoriteLocationDropDownView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class FavoriteLocationDropDownState extends State<FavoriteLocationDropDown> {
children: <Widget>[
CircleAvatar(
radius: 20.0,
backgroundColor: Colors.white,
child: Image.asset( favoriteLocationImage[imageKey] ),
backgroundColor: Colors.white54,
child: Image.asset( favoriteLocationImage[imageKey],height: 20,width: 20,),
),
Container(
padding: new EdgeInsets.only( top: 10.0, left: 4.0 ),
Expand All @@ -52,7 +52,7 @@ class FavoriteLocationDropDownState extends State<FavoriteLocationDropDown> {
@override
Widget build(BuildContext context) {
return new Container(
padding: new EdgeInsets.all(12.0),
padding: new EdgeInsets.all(10.0),
// Ensure the desired width on different devices
width: MediaQuery.of( context ).size.width / 2.5,
//dropDown Background Color
Expand All @@ -70,7 +70,8 @@ class FavoriteLocationDropDownState extends State<FavoriteLocationDropDown> {
value: FavoriteLocationDropDown.currentImage,
items: _dropDownMenuItems,
onChanged: changedDropDownItem,
iconSize: 30.0,
isExpanded: true,
iconSize: 15.0,
),
)
],
Expand Down
8 changes: 3 additions & 5 deletions lib/views/MyLocationView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ class MyLocationViewState extends State<MyLocationView>
),
layers: [
new TileLayerOptions(
urlTemplate: "https://api.tiles.mapbox.com/v4/"
"{id}/{z}/{x}/{y}@2x.png?access_token={accessToken}",
urlTemplate: "https://api.mapbox.com/styles/v1/houssemtn/ckg4f2d9h02tp19nr1ynkt3tf/tiles/{z}/{x}/{y}?access_token={accessToken}",
additionalOptions: {
'accessToken':
secrets.accessToken,
Expand Down Expand Up @@ -336,11 +335,10 @@ class MyLocationViewState extends State<MyLocationView>
),
layers: [
new TileLayerOptions(
urlTemplate: "https://api.tiles.mapbox.com/v4/"
"{id}/{z}/{x}/{y}@2x.png?access_token={accessToken}",
urlTemplate: "https://api.mapbox.com/styles/v1/houssemtn/ckg4f2d9h02tp19nr1ynkt3tf/tiles/{z}/{x}/{y}?access_token={accessToken}",
additionalOptions: {
'accessToken':
secrets.accessToken,
secrets.accessToken,
'id': 'mapbox.streets',
},
),
Expand Down
3 changes: 1 addition & 2 deletions lib/views/SearchFavoriteView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ class _SearchFavoriteViewState extends State<SearchFavoriteView> {
),
layers: [
new TileLayerOptions(
urlTemplate: "https://api.tiles.mapbox.com/v4/"
"{id}/{z}/{x}/{y}@2x.png?access_token={accessToken}",
urlTemplate: "https://api.mapbox.com/styles/v1/houssemtn/ckg4f2d9h02tp19nr1ynkt3tf/tiles/{z}/{x}/{y}?access_token={accessToken}",
additionalOptions: {
'accessToken':
secrets.accessToken,
Expand Down
5 changes: 2 additions & 3 deletions lib/views/SearchView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,10 @@ class _SearchViewState extends State<SearchView> {
),
layers: [
new TileLayerOptions(
urlTemplate: "https://api.tiles.mapbox.com/v4/"
"{id}/{z}/{x}/{y}@2x.png?access_token={accessToken}",
urlTemplate: "https://api.mapbox.com/styles/v1/houssemtn/ckg4f2d9h02tp19nr1ynkt3tf/tiles/{z}/{x}/{y}?access_token={accessToken}",
additionalOptions: {
'accessToken':
secrets.accessToken,
secrets.accessToken,
'id': 'mapbox.streets',
},
),
Expand Down
16 changes: 9 additions & 7 deletions lib/views/WeatherView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,29 @@ class _WeatherState extends State<WeatherView> {
if (globals.weatherResponse==null|| isWeatherUpToDate==false) {

weatherResponse = await http.get(
"https://api.openweathermap.org/data/2.5/weather?APPID=${secrets.APP_ID}&lat=${lat
"https://api.openweathermap.org/data/2.5/weather?APPID=${secrets.APPID}&lat=${lat
.toString( )}&lon=${long.toString( )}" );
globals.weatherResponse=weatherResponse;
///last Update Time;
globals.lastWeatherUpdateDateTime=DateTime.now().toUtc();
}
if(globals.forecastResponse==null||isWeatherUpToDate==false) {
forecastResponse = await http.get(
'https://api.openweathermap.org/data/2.5/forecast?APPID=${secrets.APP_ID}&lat=${lat
'https://api.openweathermap.org/data/2.5/forecast?APPID=${secrets.APPID}&lat=${lat
.toString( )}&lon=${long.toString( )}&lang=eng' );
globals.forecastResponse=forecastResponse;

}
if (weatherResponse.statusCode == 200 &&
forecastResponse.statusCode == 200) {
return setState(() {
weatherData =
new WeatherData.fromJson(jsonDecode(weatherResponse.body));
forecastData =
new ForecastData.fromJson(jsonDecode(forecastResponse.body));
isLoading = false;
if(mounted) {
weatherData =
new WeatherData.fromJson(jsonDecode(weatherResponse.body));
forecastData =
new ForecastData.fromJson(jsonDecode(forecastResponse.body));
isLoading = false;
}
});
}else{
/// Get Date From Local without calling the weather API
Expand Down
Loading

0 comments on commit e1b0245

Please sign in to comment.