-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from 3Dpass/dev
feat: Links for assets and objects. Version 2.17.1
- Loading branch information
Showing
298 changed files
with
4,694 additions
and
6,947 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,24 @@ | ||
import 'package:threedpass/core/architecture/local_repository_interface.dart'; | ||
import 'package:threedpass/core/architecture/remote_repository_interface.dart'; | ||
import 'package:threedpass/core/usecase.dart'; | ||
|
||
abstract class GetDataUseCase<TResult, Params> | ||
extends UseCase<TResult, Params> { | ||
final LocalRepoI<TResult, Params> localRepo; | ||
final RemoteRepoI<TResult, Params> remoteRepo; | ||
|
||
const GetDataUseCase({required this.localRepo, required this.remoteRepo}); | ||
|
||
@override | ||
Future<TResult> call(final Params params) async { | ||
final localRes = await localRepo.get(params); | ||
|
||
if (localRes != null) { | ||
return localRes; | ||
} else { | ||
final data = await remoteRepo.get(params); | ||
await localRepo.set(data); | ||
return data; | ||
} | ||
} | ||
} |
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,7 @@ | ||
import 'dart:async'; | ||
|
||
abstract class LocalRepoI<TData, Params> { | ||
FutureOr<TData?> get(final Params params); | ||
|
||
Future<void> set(final TData data); | ||
} |
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,3 @@ | ||
abstract class RemoteRepoI<TData, Params> { | ||
Future<TData> get(final Params params); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
22 changes: 11 additions & 11 deletions
22
...raphql/__generated__/serializers.gql.dart → ...raphql/__generated__/serializers.gql.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
29 changes: 16 additions & 13 deletions
29
...phql/__generated__/serializers.gql.g.dart → ...phql/__generated__/serializers.gql.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
Oops, something went wrong.