-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
1,549 additions
and
601 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import '../../core/core.dart'; | ||
import '../constants/app_style.dart'; | ||
|
||
class AppThemes { | ||
static final AppThemes _instance = AppThemes._(); | ||
|
||
factory AppThemes() => _instance; | ||
AppThemes._(); | ||
|
||
final theme = ThemeData.light().copyWith( | ||
textTheme: TextTheme( | ||
titleLarge: AppTextStyle.titleLarge, | ||
titleMedium: AppTextStyle.titleMedium, | ||
titleSmall: AppTextStyle.titleSmall, | ||
bodyLarge: AppTextStyle.bodyLarge, | ||
bodyMedium: AppTextStyle.bodyMedium, | ||
bodySmall: AppTextStyle.bodySmall, | ||
)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import 'package:dating_app/app/core/network/dio_interceptors.dart'; | ||
import 'package:dio/dio.dart'; | ||
|
||
import '../services/api_url.dart'; | ||
|
||
class DioHelper { | ||
static Dio dio = Dio(); | ||
|
||
static void init() { | ||
dio = Dio( | ||
BaseOptions( | ||
baseUrl: ApiConfig.baseUrl, | ||
receiveDataWhenStatusError: true, | ||
connectTimeout: ApiConfig.connectionTimeout, | ||
receiveTimeout: ApiConfig.receiveTimeout, | ||
sendTimeout: const Duration(milliseconds: 20000), | ||
), | ||
); | ||
dio.interceptors.add(DioInterceptor()); | ||
} | ||
|
||
static Future<Response> postData({ | ||
required String path, | ||
Map<String, dynamic>? query, | ||
required String data, | ||
String? token, | ||
}) async { | ||
dio.options.headers = ApiConfig.header; | ||
return await dio.post( | ||
path, | ||
queryParameters: query, | ||
data: data, | ||
); | ||
} | ||
|
||
static Future<Response> getData({ | ||
required String path, | ||
Map<String, dynamic>? query, | ||
String? token, | ||
}) async { | ||
dio.options.headers = ApiConfig.header; | ||
return await dio.get( | ||
path, | ||
queryParameters: query, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import 'dart:convert'; | ||
|
||
import 'package:dio/dio.dart'; | ||
import 'package:google_maps_flutter/google_maps_flutter.dart'; | ||
|
||
import '../../../../../app/core/services/api_url.dart'; | ||
|
||
class GeolocationService { | ||
static final GeolocationService instance = GeolocationService._init(); | ||
|
||
factory GeolocationService() { | ||
return instance; | ||
} | ||
GeolocationService._init(); | ||
|
||
Future<String> reverseGeolocation(LatLng position) async { | ||
final uri = | ||
Uri.parse(ApiConfig.locationUrl(position.latitude, position.longitude)); | ||
final response = await Dio().getUri(uri); | ||
if (response.statusCode == 200) { | ||
final data = json.decode(response.data); | ||
final results = data['results'] as List; | ||
if (results.isNotEmpty) { | ||
final address = results[0]['formatted_address']; | ||
return address; | ||
} else { | ||
return 'Unknown location'; | ||
} | ||
} else { | ||
throw Exception('Failed to reverse geocode location'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export 'api_url.dart'; | ||
export 'app_tokens.dart'; | ||
export 'auth_local_data_source.dart'; | ||
export 'geolocation.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart | ||
// This is a library that looks up messages for specific locales by | ||
// delegating to the appropriate library. | ||
|
||
// Ignore issues from commonly used lints in this file. | ||
// ignore_for_file:implementation_imports, file_names, unnecessary_new | ||
// ignore_for_file:unnecessary_brace_in_string_interps, directives_ordering | ||
// ignore_for_file:argument_type_not_assignable, invalid_assignment | ||
// ignore_for_file:prefer_single_quotes, prefer_generic_function_type_aliases | ||
// ignore_for_file:comment_references | ||
|
||
import 'dart:async'; | ||
|
||
import 'package:flutter/foundation.dart'; | ||
import 'package:intl/intl.dart'; | ||
import 'package:intl/message_lookup_by_library.dart'; | ||
import 'package:intl/src/intl_helpers.dart'; | ||
|
||
import 'messages_en.dart' as messages_en; | ||
|
||
typedef Future<dynamic> LibraryLoader(); | ||
Map<String, LibraryLoader> _deferredLibraries = { | ||
'en': () => new SynchronousFuture(null), | ||
}; | ||
|
||
MessageLookupByLibrary? _findExact(String localeName) { | ||
switch (localeName) { | ||
case 'en': | ||
return messages_en.messages; | ||
default: | ||
return null; | ||
} | ||
} | ||
|
||
/// User programs should call this before using [localeName] for messages. | ||
Future<bool> initializeMessages(String localeName) { | ||
var availableLocale = Intl.verifiedLocale( | ||
localeName, (locale) => _deferredLibraries[locale] != null, | ||
onFailure: (_) => null); | ||
if (availableLocale == null) { | ||
return new SynchronousFuture(false); | ||
} | ||
var lib = _deferredLibraries[availableLocale]; | ||
lib == null ? new SynchronousFuture(false) : lib(); | ||
initializeInternalMessageLookup(() => new CompositeMessageLookup()); | ||
messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor); | ||
return new SynchronousFuture(true); | ||
} | ||
|
||
bool _messagesExistFor(String locale) { | ||
try { | ||
return _findExact(locale) != null; | ||
} catch (e) { | ||
return false; | ||
} | ||
} | ||
|
||
MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) { | ||
var actualLocale = | ||
Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null); | ||
if (actualLocale == null) return null; | ||
return _findExact(actualLocale); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart | ||
// This is a library that provides messages for a en locale. All the | ||
// messages from the main program should be duplicated here with the same | ||
// function name. | ||
|
||
// Ignore issues from commonly used lints in this file. | ||
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new | ||
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering | ||
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases | ||
// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes | ||
// ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes | ||
|
||
import 'package:intl/intl.dart'; | ||
import 'package:intl/message_lookup_by_library.dart'; | ||
|
||
final messages = new MessageLookup(); | ||
|
||
typedef String MessageIfAbsent(String messageStr, List<dynamic> args); | ||
|
||
class MessageLookup extends MessageLookupByLibrary { | ||
String get localeName => 'en'; | ||
|
||
final messages = _notInlinedMessages(_notInlinedMessages); | ||
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{}; | ||
} |
Oops, something went wrong.