forked from AOSSIE-Org/Monumento
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: monument_3d_model, follow, discover, notification, scan and view
- Loading branch information
1 parent
3602b78
commit 9bee413
Showing
49 changed files
with
2,065 additions
and
428 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
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.
Binary file not shown.
Binary file not shown.
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 @@ | ||
0 Mount Rushmore National Memorial | ||
1 Pyramids of Giza | ||
2 Colosseum | ||
3 Taj Mahal |
Binary file not shown.
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
26 changes: 26 additions & 0 deletions
26
lib/application/popular_monuments/monument_3d_model/monument_3d_model_bloc.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,26 @@ | ||
import 'package:equatable/equatable.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:monumento/domain/entities/monument_entity.dart'; | ||
import 'package:monumento/domain/repositories/monument_repository.dart'; | ||
|
||
part 'monument_3d_model_event.dart'; | ||
part 'monument_3d_model_state.dart'; | ||
|
||
class Monument3dModelBloc extends Bloc<MonumentModelEvent, MonumentModelState> { | ||
final MonumentRepository _monumentRepository; | ||
Monument3dModelBloc(this._monumentRepository) : super(MonumentInitial()) { | ||
on<ViewMonument3DModel>(_mapViewMonument3DModelToState); | ||
} | ||
|
||
_mapViewMonument3DModelToState( | ||
ViewMonument3DModel event, Emitter<MonumentModelState> emit) async { | ||
try { | ||
emit(LoadingMonumentModel()); | ||
final monumentModel = await _monumentRepository.getMonumentModelByName( | ||
monumentName: event.monumentName); | ||
emit(LoadingMonumentModelSuccess(monumentModel: monumentModel!.toEntity())); | ||
} catch (e) { | ||
emit(MonumentModelLoadFailed(message: e.toString())); | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
lib/application/popular_monuments/monument_3d_model/monument_3d_model_event.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,18 @@ | ||
part of 'monument_3d_model_bloc.dart'; | ||
|
||
sealed class MonumentModelEvent extends Equatable { | ||
const MonumentModelEvent(); | ||
|
||
@override | ||
List<Object?> get props => []; | ||
} | ||
|
||
class ViewMonument3DModel extends MonumentModelEvent { | ||
final String monumentName; | ||
|
||
const ViewMonument3DModel({required this.monumentName}); | ||
|
||
@override | ||
List<Object?> get props => [monumentName]; | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
lib/application/popular_monuments/monument_3d_model/monument_3d_model_state.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,35 @@ | ||
part of 'monument_3d_model_bloc.dart'; | ||
|
||
sealed class MonumentModelState extends Equatable { | ||
const MonumentModelState(); | ||
|
||
@override | ||
List<Object> get props => []; | ||
} | ||
|
||
class MonumentInitial extends MonumentModelState { | ||
@override | ||
List<Object> get props => []; | ||
} | ||
|
||
class LoadingMonumentModel extends MonumentModelState { | ||
@override | ||
List<Object> get props => []; | ||
} | ||
|
||
class LoadingMonumentModelSuccess extends MonumentModelState { | ||
final MonumentEntity monumentModel; | ||
|
||
const LoadingMonumentModelSuccess({required this.monumentModel}); | ||
@override | ||
List<Object> get props => []; | ||
} | ||
|
||
class MonumentModelLoadFailed extends MonumentModelState { | ||
final String message; | ||
|
||
const MonumentModelLoadFailed({required this.message}); | ||
@override | ||
List<Object> get props => [message]; | ||
} | ||
|
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,41 +1,41 @@ | ||
part of 'follow_bloc.dart'; | ||
|
||
abstract class FollowEvent extends Equatable { | ||
sealed class FollowEvent extends Equatable { | ||
const FollowEvent(); | ||
} | ||
|
||
class FollowUser extends FollowEvent { | ||
final class FollowUser extends FollowEvent { | ||
final UserEntity targetUser; | ||
|
||
const FollowUser({required this.targetUser}); | ||
|
||
@override | ||
List<Object> get props => []; | ||
List<Object> get props => [targetUser]; | ||
} | ||
|
||
class UnfollowUser extends FollowEvent { | ||
final class UnfollowUser extends FollowEvent { | ||
final UserEntity targetUser; | ||
const UnfollowUser({required this.targetUser}); | ||
|
||
@override | ||
List<Object> get props => []; | ||
List<Object> get props => [targetUser]; | ||
} | ||
|
||
class GetFollowStatus extends FollowEvent { | ||
final class GetFollowStatus extends FollowEvent { | ||
final UserEntity targetUser; | ||
|
||
const GetFollowStatus({required this.targetUser}); | ||
|
||
@override | ||
List<Object> get props => []; | ||
List<Object> get props => [targetUser]; | ||
} | ||
|
||
class LoadUser extends FollowEvent { | ||
final class LoadUser extends FollowEvent { | ||
final List<String> following; | ||
|
||
const LoadUser({required this.following}); | ||
|
||
@override | ||
List<Object?> get props => []; | ||
List<Object?> get props => [following]; | ||
|
||
} |
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
Oops, something went wrong.