Skip to content
Open
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
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"entites"
]
}
200 changes: 200 additions & 0 deletions android/.kotlin/errors/errors-1758560907485.log

Large diffs are not rendered by default.

200 changes: 200 additions & 0 deletions android/.kotlin/errors/errors-1758560907636.log

Large diffs are not rendered by default.

200 changes: 200 additions & 0 deletions android/.kotlin/errors/errors-1758634868199.log

Large diffs are not rendered by default.

200 changes: 200 additions & 0 deletions android/.kotlin/errors/errors-1758634868227.log

Large diffs are not rendered by default.

21 changes: 13 additions & 8 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<application
android:label="elevate_tracking_app"
android:name="${applicationName}"
Expand All @@ -17,12 +22,12 @@
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
Expand All @@ -38,8 +43,8 @@
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
<action android:name="android.intent.action.PROCESS_TEXT" />
<data android:mimeType="text/plain" />
</intent>
</queries>
</manifest>
</manifest>
232 changes: 232 additions & 0 deletions assets/data/country.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
[
{
"isoCode": "EG",
"name": "Egypt",
"phoneCode": "20",
"flag": "🇪🇬",
"flagUrl": "https://flagcdn.com/w320/eg.png",
"currency": "EGP",
"latitude": "27.00000000",
"longitude": "30.00000000"
},
{
"isoCode": "SA",
"name": "Saudi Arabia",
"phoneCode": "966",
"flag": "🇸🇦",
"flagUrl": "https://flagcdn.com/w320/sa.png",
"currency": "SAR",
"latitude": "25.00000000",
"longitude": "45.00000000"
},
{
"isoCode": "AE",
"name": "United Arab Emirates",
"phoneCode": "971",
"flag": "🇦🇪",
"flagUrl": "https://flagcdn.com/w320/ae.png",
"currency": "AED",
"latitude": "24.00000000",
"longitude": "54.00000000"
},
{
"isoCode": "QA",
"name": "Qatar",
"phoneCode": "974",
"flag": "🇶🇦",
"flagUrl": "https://flagcdn.com/w320/qa.png",
"currency": "QAR",
"latitude": "25.50000000",
"longitude": "51.25000000"
},
{
"isoCode": "KW",
"name": "Kuwait",
"phoneCode": "965",
"flag": "🇰🇼",
"flagUrl": "https://flagcdn.com/w320/kw.png",
"currency": "KWD",
"latitude": "29.50000000",
"longitude": "47.75000000"
},
{
"isoCode": "BH",
"name": "Bahrain",
"phoneCode": "973",
"flag": "🇧🇭",
"flagUrl": "https://flagcdn.com/w320/bh.png",
"currency": "BHD",
"latitude": "26.00000000",
"longitude": "50.55000000"
},
{
"isoCode": "OM",
"name": "Oman",
"phoneCode": "968",
"flag": "🇴🇲",
"flagUrl": "https://flagcdn.com/w320/om.png",
"currency": "OMR",
"latitude": "21.00000000",
"longitude": "57.00000000"
},
{
"isoCode": "JO",
"name": "Jordan",
"phoneCode": "962",
"flag": "🇯🇴",
"flagUrl": "https://flagcdn.com/w320/jo.png",
"currency": "JOD",
"latitude": "31.00000000",
"longitude": "36.00000000"
},
{
"isoCode": "LB",
"name": "Lebanon",
"phoneCode": "961",
"flag": "🇱🇧",
"flagUrl": "https://flagcdn.com/w320/lb.png",
"currency": "LBP",
"latitude": "33.83333333",
"longitude": "35.83333333"
},
{
"isoCode": "SY",
"name": "Syria",
"phoneCode": "963",
"flag": "🇸🇾",
"flagUrl": "https://flagcdn.com/w320/sy.png",
"currency": "SYP",
"latitude": "35.00000000",
"longitude": "38.00000000"
},
{
"isoCode": "IQ",
"name": "Iraq",
"phoneCode": "964",
"flag": "🇮🇶",
"flagUrl": "https://flagcdn.com/w320/iq.png",
"currency": "IQD",
"latitude": "33.00000000",
"longitude": "44.00000000"
},
{
"isoCode": "YE",
"name": "Yemen",
"phoneCode": "967",
"flag": "🇾🇪",
"flagUrl": "https://flagcdn.com/w320/ye.png",
"currency": "YER",
"latitude": "15.00000000",
"longitude": "48.00000000"
},
{
"isoCode": "SD",
"name": "Sudan",
"phoneCode": "249",
"flag": "🇸🇩",
"flagUrl": "https://flagcdn.com/w320/sd.png",
"currency": "SDG",
"latitude": "15.00000000",
"longitude": "30.00000000"
},
{
"isoCode": "MA",
"name": "Morocco",
"phoneCode": "212",
"flag": "🇲🇦",
"flagUrl": "https://flagcdn.com/w320/ma.png",
"currency": "MAD",
"latitude": "32.00000000",
"longitude": "-5.00000000"
},
{
"isoCode": "DZ",
"name": "Algeria",
"phoneCode": "213",
"flag": "🇩🇿",
"flagUrl": "https://flagcdn.com/w320/dz.png",
"currency": "DZD",
"latitude": "28.00000000",
"longitude": "3.00000000"
},
{
"isoCode": "TN",
"name": "Tunisia",
"phoneCode": "216",
"flag": "🇹🇳",
"flagUrl": "https://flagcdn.com/w320/tn.png",
"currency": "TND",
"latitude": "34.00000000",
"longitude": "9.00000000"
},
{
"isoCode": "LY",
"name": "Libya",
"phoneCode": "218",
"flag": "🇱🇾",
"flagUrl": "https://flagcdn.com/w320/ly.png",
"currency": "LYD",
"latitude": "25.00000000",
"longitude": "17.00000000"
},
{
"isoCode": "PS",
"name": "Palestine",
"phoneCode": "970",
"flag": "🇵🇸",
"flagUrl": "https://flagcdn.com/w320/ps.png",
"currency": "ILS",
"latitude": "31.90000000",
"longitude": "35.20000000"
},
{
"isoCode": "US",
"name": "United States",
"phoneCode": "1",
"flag": "🇺🇸",
"flagUrl": "https://flagcdn.com/w320/us.png",
"currency": "USD",
"latitude": "38.00000000",
"longitude": "-97.00000000"
},
{
"isoCode": "GB",
"name": "United Kingdom",
"phoneCode": "44",
"flag": "🇬🇧",
"flagUrl": "https://flagcdn.com/w320/gb.png",
"currency": "GBP",
"latitude": "54.00000000",
"longitude": "-2.00000000"
},
{
"isoCode": "FR",
"name": "France",
"phoneCode": "33",
"flag": "🇫🇷",
"flagUrl": "https://flagcdn.com/w320/fr.png",
"currency": "EUR",
"latitude": "46.00000000",
"longitude": "2.00000000"
},
{
"isoCode": "DE",
"name": "Germany",
"phoneCode": "49",
"flag": "🇩🇪",
"flagUrl": "https://flagcdn.com/w320/de.png",
"currency": "EUR",
"latitude": "51.00000000",
"longitude": "9.00000000"
},
{
"isoCode": "TR",
"name": "Turkey",
"phoneCode": "90",
"flag": "🇹🇷",
"flagUrl": "https://flagcdn.com/w320/tr.png",
"currency": "TRY",
"latitude": "39.00000000",
"longitude": "35.00000000"
}
]
1 change: 1 addition & 0 deletions coverage/build/.last_build_id
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5de0e0f9d69168653226eee8e3dae383
4 changes: 4 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPhotoLibraryUsageDescription</key>
<string>We need access to your photo library to upload images</string>
<key>NSCameraUsageDescription</key>
<string>We need access to your camera to take pictures</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
Expand Down
12 changes: 8 additions & 4 deletions lib/api/client/api_client.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
import 'package:dio/dio.dart';
import 'package:elevate_tracking_app/api/models/requests/login_request.dart';
import 'package:elevate_tracking_app/api/models/responses/login_response.dart';
import 'package:elevate_tracking_app/api/models/responses/apply_response_dto.dart';
import 'package:elevate_tracking_app/api/models/responses/vehicles_response.dart';
import 'package:elevate_tracking_app/core/constants/end_points.dart';
import 'package:injectable/injectable.dart';
import 'package:retrofit/retrofit.dart';

import '../../core/constants/end_points.dart';

part 'api_client.g.dart';

@injectable
@RestApi()
abstract class ApiClient {
@factoryMethod
factory ApiClient(Dio dio) = _ApiClient;

@POST(EndPoints.login)
@POST(Endpoints.apply)
Future<ApplyResponseDto> apply(@Body() FormData request);
@GET(Endpoints.vehicle)
Future<VehiclesResponse> getAllVehicles();
@POST(Endpoints.login)
Future<LoginResponse> login(@Body() LoginRequest loginRequest);
}
27 changes: 25 additions & 2 deletions lib/api/data_source/auth_local_data_source_impl.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,37 @@
import 'dart:convert';
import 'package:elevate_tracking_app/api/mapper/apply_mapper.dart';
import 'package:elevate_tracking_app/api/models/responses/country_dto.dart';
import 'package:elevate_tracking_app/core/api_result/api_result.dart';
import 'package:elevate_tracking_app/core/constants/end_points.dart';
import 'package:elevate_tracking_app/core/constants/const_keys.dart';
import 'package:elevate_tracking_app/data/data_source/auth_local_data_source.dart';
import 'package:elevate_tracking_app/domain/entites/country_entity.dart';
import 'package:flutter/services.dart';
import 'package:elevate_tracking_app/domain/entites/requests/login_request_entity.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:injectable/injectable.dart';

@Injectable(as: AuthLocalDataSource)
class AuthLocalDataSourceImpl implements AuthLocalDataSource {
final AssetBundle bundle;
final FlutterSecureStorage _secureStorage;
AuthLocalDataSourceImpl(this._secureStorage, AssetBundle? testBundle)
: bundle = testBundle ?? rootBundle;

AuthLocalDataSourceImpl(this._secureStorage);
@override
Future<ApiResult<List<CountryEntity>>> getAllCountry() async {
try {
final jsonString = await bundle.loadString(Endpoints.countryLocalData);
final List<dynamic> decoded = jsonDecode(jsonString);
final dtoList = decoded
.map((e) => CountryDto.fromJson(e as Map<String, dynamic>))
.toList();
final entities = dtoList.map((c) => c.toEntity()).toList();
return ApiSuccessResult<List<CountryEntity>>(entities);
} catch (e) {
return ApiErrorResult(e.toString());
}
}

@override
Future<void> saveUserRememberMe({
Expand All @@ -26,7 +49,7 @@ class AuthLocalDataSourceImpl implements AuthLocalDataSource {
key: ConstKeys.kUserPassword,
value: loginRequestEntity.password,
);
}else{
} else {
await _secureStorage.delete(key: ConstKeys.kUserLogin);
await _secureStorage.delete(key: ConstKeys.kUserPassword);
}
Expand Down
Loading
Loading