-
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
33 changed files
with
409 additions
and
304 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,56 @@ | ||
# Sparkz Dating App | ||
### Under Development | ||
### Project Directory | ||
|
||
- Project Directory | ||
```shell | ||
app | ||
bloc | ||
services | ||
UI | ||
generated | ||
l10n | ||
localization | ||
src | ||
``` | ||
|
||
### Screenshots | ||
![Image 1](assets/images/1.png) ![Image 2](assets/images/2.png) | ||
![image 3](assets/images/3.png) ![image 4](assets/images/4.png) | ||
|
||
|
||
|
||
<p> The Services folder contains all business logic and functions that interacts with the Backend </p> | ||
<p> The Ui folder contains all the necessary files for developing and maintaining the UI</p> | ||
<h5> The src folder contains all the necessary files for developing and maintaining the UI</h5> | ||
|
||
<h5>Inside the UI they are, two folders, shared and the views</h5> | ||
<p>The shared folder contains UI tools, widgets, extensions and helpful strings</p> | ||
<p>The view folder contains all the app views such as Login View, Sign up View, Forgot Password View etc.</p> | ||
<h5>The shared folder contains UI tools, widgets, extensions and helpful strings</h5> | ||
<h5>The view folder contains all the app views such as Login View, Sign up View, Forgot Password View etc.</h5> | ||
|
||
<h5>The view folder are are seperated in two ways, which are, the Features folder, containing the app views after authentication e.g Home View, Chat View etc</h5> | ||
<h5>The other views are the views for the various means of authentication and each routing is handled by the GoRouter package, from the code a simple navigation as been customized to _navigationService.pushScreen(context, LoginScreen.route)</h5> | ||
|
||
##### Build App | ||
You can build the app using the commands below | ||
|
||
for Android | ||
|
||
``` | ||
## development: flutter build apk -t lib/main.dart --flavor dev | ||
## production: flutter build apk -t lib/main.dart --flavor prod | ||
``` | ||
|
||
for IOS | ||
|
||
``` | ||
Coming Soon | ||
``` | ||
|
||
|
||
|
||
### Olawills Dating App with Flutter, Node JS, Express Js and Bloc for State management | ||
#### Olawills Dating App with Flutter, Node JS, Express Js and Bloc for State management | ||
|
||
<p>This project is going to be a large and comprehensive with lots of features, bug fixings, and possible more addition of developers <p> | ||
<p>This project will be using it's own backend service which i will be creating myself with tge help of node and express js</p> | ||
<p> The project uses the MVVM pattern and Dependency injection (GetIt) to structure and organize all files and folders | ||
<p>By the end of this project i will be providing the screenshot and also a detailed view of each folders and codes</p> | ||
<h5>This project is going to be a large and comprehensive with lots of features, bug fixings, and possible more addition of developers </h5> | ||
<h5>This project will be using it's own backend service which i will be creating myself with tge help of node and express js</h5> | ||
<h5> The project uses the MVVM pattern and Dependency injection (GetIt) to structure and organize all files and folders | ||
<h5>By the end of this project i will be providing the screenshot and also a detailed view of each folders and codes</h5> | ||
|
||
<h5>To enjoy Flutter utils stay follow me on my Linkedln and Twitter page which are <a href ="https://www.linkedln.com/in/olawills">Linkedln page</a> and <a href ="https://www.twitter.com/olawillfFlutter"> Twitter Page</a></h5> | ||
|
||
A new Flutter project. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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,28 @@ | ||
import 'dart:async'; | ||
import 'dart:developer'; | ||
|
||
import 'package:dating_app/app/core/domain/all_blocs.dart'; | ||
|
||
import '../../../../localization/localization.dart'; | ||
import '../../core.dart'; | ||
import '../../logger/app_logger.dart'; | ||
|
||
Future<void> bootstrap(FutureOr<Widget> Function() builder) async { | ||
FlutterError.onError = (details) { | ||
log(details.exceptionAsString(), stackTrace: details.stack); | ||
}; | ||
|
||
await runZonedGuarded( | ||
() async { | ||
runApp( | ||
initializeLocation( | ||
child: MultiBlocProvider( | ||
providers: AppBlocProviders.allBlocProviders, | ||
child: await builder(), | ||
), | ||
), | ||
); | ||
}, | ||
(error, stackTrace) => Log.debug(error.toString(), [stackTrace]), | ||
); | ||
} |
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,6 @@ | ||
import 'package:dating_app/app/core/domain/flavours/app_flavour.dart'; | ||
import 'package:dating_app/app/core/domain/sparkz_config.dart'; | ||
|
||
void main() { | ||
bootstrap(() => const SparkzConfig()); | ||
} |
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,6 @@ | ||
import 'package:dating_app/app/core/domain/flavours/app_flavour.dart'; | ||
import 'package:dating_app/app/core/domain/sparkz_config.dart'; | ||
|
||
void main() { | ||
bootstrap(() => const SparkzConfig()); | ||
} |
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 |
---|---|---|
@@ -1,31 +1,42 @@ | ||
import 'package:dating_app/app/core/logger/app_logger.dart'; | ||
import 'dart:io'; | ||
|
||
import 'package:dating_app/app/core/network/request_retrier.dart'; | ||
import 'package:dio/dio.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class RetryOnConnectionChangeInterceptor extends Interceptor { | ||
final DioConnectivityRequestRetrier requestRetrier; | ||
RetryOnConnectionChangeInterceptor({required this.requestRetrier}); | ||
|
||
class DioInterceptor extends Interceptor { | ||
@override | ||
void onRequest(RequestOptions options, RequestInterceptorHandler handler) { | ||
Log.info('==================START===================='); | ||
Log.info( | ||
debugPrint( | ||
'Request => ${options.baseUrl} ${options.path}${options.queryParameters}'); | ||
Log.info('Request: ${options.method} ${options.uri}'); | ||
Log.info('Data: ${options.data}'); | ||
return super.onRequest(options, handler); | ||
debugPrint('Data: ${options.data}'); | ||
return handler.next(options); | ||
} | ||
|
||
@override | ||
void onResponse(Response response, ResponseInterceptorHandler handler) { | ||
Log.debug( | ||
'Response => StatusCode: ${response.statusCode} ${response.statusMessage}'); | ||
Log.verbose('Response => Body ${response.data}'); | ||
Log.verbose('Headers => ${response.headers}'); | ||
return super.onResponse(response, handler); | ||
debugPrint('Response => ${response.data}'); | ||
return handler.next(response); | ||
} | ||
|
||
@override | ||
void onError(DioException err, ErrorInterceptorHandler handler) { | ||
final options = err.requestOptions; | ||
Log.error(options.method); //Debug log | ||
Log.error('${err.message}', 'Error: ${err.error}'); | ||
return super.onError(err, handler); | ||
if (_shouldRetry(err)) { | ||
try { | ||
requestRetrier.scheduleRequestRetry(err.requestOptions); | ||
} catch (e) { | ||
e; | ||
} | ||
} | ||
err; | ||
} | ||
|
||
bool _shouldRetry(DioException err) { | ||
return err.type == DioExceptionType.unknown && | ||
err.error != null && | ||
err.error is SocketException; | ||
} | ||
} |
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,32 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:connectivity_plus/connectivity_plus.dart'; | ||
import 'package:dio/dio.dart'; | ||
|
||
|
||
class DioConnectivityRequestRetrier { | ||
final Dio dio; | ||
final Connectivity connectivity; | ||
DioConnectivityRequestRetrier({ | ||
required this.dio, | ||
required this.connectivity, | ||
}); | ||
Future<Response> scheduleRequestRetry(RequestOptions requestOptions) async { | ||
StreamSubscription? streamSubscription; | ||
final responseCompleter = Completer<Response>(); | ||
|
||
streamSubscription = connectivity | ||
.onConnectivityChanged | ||
.listen((event) async { | ||
if (event != ConnectivityResult.none) { | ||
streamSubscription?.cancel(); | ||
|
||
// Complete the completer instead of returning | ||
responseCompleter.complete( | ||
dio.fetch(requestOptions), | ||
); | ||
} | ||
}); | ||
return responseCompleter.future; | ||
} | ||
} |
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
Oops, something went wrong.