Browse Source

fix: battle league pages

pull/14/head
AmirrezaChegini 7 days ago
parent
commit
7875016d33
  1. 27
      lib/core/routers/my_routes.dart
  2. 9
      lib/features/battle_league/presentation/controller/battle_league_controller.dart
  3. 45
      lib/features/battle_league/presentation/ui/battle_league_finding_page.dart
  4. 67
      lib/features/battle_league/presentation/ui/battle_league_founded_page.dart
  5. 4
      lib/features/battle_league/presentation/ui/battle_league_page.dart
  6. 17
      lib/features/battle_league/presentation/ui/battle_league_topic_page.dart
  7. 4
      lib/features/battle_league/presentation/ui/widgets/button/battle_golden_button.dart
  8. 0
      lib/features/battle_league/presentation/ui/widgets/button/battle_grey_button.dart
  9. 42
      lib/features/battle_league/presentation/ui/widgets/button/battle_purple_button.dart
  10. 0
      lib/features/battle_league/presentation/ui/widgets/topic_widget.dart
  11. 28
      lib/features/topic/data/datasource/topic_datasource.dart
  12. 13
      lib/features/topic/data/model/topic_model.dart
  13. 29
      lib/features/topic/data/repository_impl/topic_repository_impl.dart
  14. 14
      lib/features/topic/domain/entity/topic_entity.dart
  15. 8
      lib/features/topic/domain/repository/topic_repository.dart
  16. 19
      lib/features/topic/domain/usecases/get_topic_usecase.dart
  17. 20
      lib/features/topic/presentation/binding/topic_binding.dart
  18. 54
      lib/features/topic/presentation/controller/topic_controller.dart
  19. 9
      lib/init_bindings.dart

27
lib/core/routers/my_routes.dart

@ -1,5 +1,7 @@
import 'package:shia_game_flutter/features/awards/presentation/binding/awards_binding.dart'; import 'package:shia_game_flutter/features/awards/presentation/binding/awards_binding.dart';
import 'package:shia_game_flutter/features/awards/presentation/ui/awards_page.dart'; import 'package:shia_game_flutter/features/awards/presentation/ui/awards_page.dart';
import 'package:shia_game_flutter/features/battle_league/presentation/ui/battle_league_finding_page.dart';
import 'package:shia_game_flutter/features/battle_league/presentation/ui/battle_league_founded_page.dart';
import 'package:shia_game_flutter/features/home/presentation/binding/home_binding.dart'; import 'package:shia_game_flutter/features/home/presentation/binding/home_binding.dart';
import 'package:shia_game_flutter/features/home/presentation/pages/home_page.dart'; import 'package:shia_game_flutter/features/home/presentation/pages/home_page.dart';
import 'package:shia_game_flutter/features/intro/presentation/binding/intro_binding.dart'; import 'package:shia_game_flutter/features/intro/presentation/binding/intro_binding.dart';
@ -15,8 +17,7 @@ import 'package:shia_game_flutter/features/battle_league/presentation/ui/battle_
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:shia_game_flutter/features/shop/presentation/binding/shop_binding.dart'; import 'package:shia_game_flutter/features/shop/presentation/binding/shop_binding.dart';
import 'package:shia_game_flutter/features/shop/presentation/ui/shop_page.dart'; import 'package:shia_game_flutter/features/shop/presentation/ui/shop_page.dart';
import 'package:shia_game_flutter/features/topic/presentation/binding/topic_binding.dart';
import 'package:shia_game_flutter/features/topic/presentation/ui/topic_page.dart';
import 'package:shia_game_flutter/features/battle_league/presentation/ui/battle_league_topic_page.dart';
class Routes { class Routes {
static const Routes _i = Routes._internal(); static const Routes _i = Routes._internal();
@ -30,8 +31,12 @@ class Routes {
static const String shopPage = '/shop_page'; static const String shopPage = '/shop_page';
static const String awardsPage = '/awards_page'; static const String awardsPage = '/awards_page';
static const String profilePage = '/profile_page'; static const String profilePage = '/profile_page';
/// Battle league
static const String battleLeaguePage = '/battle_league_page'; static const String battleLeaguePage = '/battle_league_page';
static const String topicPage = '/topic_page';
static const String battleLeagueTopicPage = '/battle_league_topic_page';
static const String battleLeagueFindingPage = '/battle_league_finding_page';
static const String battleLeagueFoundedPage = '/battle_league_founded_page';
} }
final List<GetPage> appPages = [ final List<GetPage> appPages = [
@ -78,8 +83,18 @@ final List<GetPage> appPages = [
binding: BattleLeagueBinding(), binding: BattleLeagueBinding(),
), ),
GetPage( GetPage(
name: Routes.topicPage,
page: () => const TopicPage(),
binding: TopicBinding(),
name: Routes.battleLeagueTopicPage,
page: () => const BattleLeagueTopicPage(),
binding: BattleLeagueBinding(),
),
GetPage(
name: Routes.battleLeagueFindingPage,
page: () => const BattleLeagueFindingPage(),
binding: BattleLeagueBinding(),
),
GetPage(
name: Routes.battleLeagueFoundedPage,
page: () => const BattleLeagueFoundedPage(),
binding: BattleLeagueBinding(),
), ),
]; ];

9
lib/features/battle_league/presentation/controller/battle_league_controller.dart

@ -40,7 +40,14 @@ class BattleLeagueController extends GetxController
/// ------ Functions ------ /// ------ Functions ------
void goToTopicPage(){ void goToTopicPage(){
Get.toNamed(Routes.topicPage);
Get.toNamed(Routes.battleLeagueTopicPage);
}
void goToFindingPage(){
Get.toNamed(Routes.battleLeagueFindingPage);
}
void goToFoundedPage(){
Get.toNamed(Routes.battleLeagueFoundedPage);
} }
/// ------ Api Calls ------ /// ------ Api Calls ------

45
lib/features/battle_league/presentation/ui/battle_find_page.dart → lib/features/battle_league/presentation/ui/battle_league_finding_page.dart

@ -6,13 +6,12 @@ import 'package:shia_game_flutter/common_ui/resources/my_text_style.dart';
import 'package:shia_game_flutter/core/utils/gap.dart'; import 'package:shia_game_flutter/core/utils/gap.dart';
import 'package:shia_game_flutter/core/utils/my_localization.dart'; import 'package:shia_game_flutter/core/utils/my_localization.dart';
import 'package:shia_game_flutter/core/utils/screen_size.dart'; import 'package:shia_game_flutter/core/utils/screen_size.dart';
import 'package:shia_game_flutter/core/widgets/container/my_container.dart';
import 'package:shia_game_flutter/core/widgets/image/my_image.dart'; import 'package:shia_game_flutter/core/widgets/image/my_image.dart';
import 'package:shia_game_flutter/core/widgets/text/gradient_text.dart';
import 'package:shia_game_flutter/features/battle_league/presentation/controller/battle_league_controller.dart'; import 'package:shia_game_flutter/features/battle_league/presentation/controller/battle_league_controller.dart';
import 'package:shia_game_flutter/features/battle_league/presentation/ui/widgets/button/battle_purple_button.dart';
class BattleFindPage extends GetView<BattleLeagueController> {
const BattleFindPage({super.key});
class BattleLeagueFindingPage extends GetView<BattleLeagueController> {
const BattleLeagueFindingPage({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -30,7 +29,7 @@ class BattleFindPage extends GetView<BattleLeagueController> {
const Spacer(), const Spacer(),
_description(context), _description(context),
37.h.gapHeight, 37.h.gapHeight,
const BattlePurpleButton(),
_startFindingButton(context),
], ],
), ),
), ),
@ -102,39 +101,11 @@ class BattleFindPage extends GetView<BattleLeagueController> {
], ],
); );
} }
}
class BattlePurpleButton extends StatelessWidget {
const BattlePurpleButton({super.key});
@override
Widget build(BuildContext context) {
return MyContainer(
onTap: () {},
width: context.widthScreen,
height: 64.h,
borderRadius: const BorderRadius.all(Radius.circular(20)),
borderGradient: LinearGradient(
begin: AlignmentDirectional.topStart,
end: AlignmentDirectional.bottomEnd,
colors: [
const Color(0XFF7F4CD4),
const Color(0XFF7F4CD4).withValues(alpha: 0),
],
),
gradient: const RadialGradient(
radius: 5,
center: Alignment(-0.5, 0),
colors: [Color(0xFF6A36BF), Color(0xFF562A9E)],
),
child: GradientText(
text: context.translate.stop_finding,
fontSize: 22.sp,
color: const Color(0xFFE1E1E1),
offset: const Offset(0, 1.04),
blurRadius: 1.9,
shadowColor: const Color(0xFF898989),
),
Widget _startFindingButton(BuildContext context) {
return BattlePurpleButton(
label: context.translate.stop_finding,
onTap: () => Get.back(),
); );
} }
} }

67
lib/features/battle_league/presentation/ui/battle_league_founded_page.dart

@ -0,0 +1,67 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shia_game_flutter/common_ui/resources/my_assets.dart';
import 'package:shia_game_flutter/common_ui/resources/my_colors.dart';
import 'package:shia_game_flutter/common_ui/resources/my_text_style.dart';
import 'package:shia_game_flutter/core/utils/gap.dart';
import 'package:shia_game_flutter/core/utils/my_localization.dart';
import 'package:shia_game_flutter/core/utils/screen_size.dart';
import 'package:shia_game_flutter/core/widgets/image/my_image.dart';
import 'package:shia_game_flutter/features/battle_league/presentation/controller/battle_league_controller.dart';
import 'package:shia_game_flutter/features/intro/presentation/ui/widgets/intro_loading.dart';
class BattleLeagueFoundedPage extends GetView<BattleLeagueController> {
const BattleLeagueFoundedPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColors.battleLeagueBackgroundColor,
body: SafeArea(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 30),
child: Column(
children: [
20.h.gapHeight,
_rankTitle(context),
const Spacer(),
const IntroLoading(),
],
),
),
),
);
}
Container _rankTitle(BuildContext context) {
return Container(
height: 42.h,
width: context.widthScreen,
alignment: Alignment.center,
padding: const EdgeInsets.symmetric(horizontal: 17),
decoration: const ShapeDecoration(
shape: StadiumBorder(),
color: Color(0XFF2E0869),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: FittedBox(
child: Text(
'${context.translate.quiz_league} (june) | ${context.translate.your_place} (1,569)',
textAlign: TextAlign.center,
maxLines: 1,
style: Lexend.semiBold.copyWith(fontSize: 12.sp),
),
),
),
15.w.gapWidth,
const MyImage(asset: MyAssets.iconRank),
4.w.gapWidth,
Text('265', style: Lexend.bold.copyWith(fontSize: 12.sp)),
],
),
);
}
}

4
lib/features/battle_league/presentation/ui/battle_league_page.dart

@ -7,7 +7,7 @@ import 'package:shia_game_flutter/core/utils/screen_size.dart';
import 'package:shia_game_flutter/core/widgets/app_bar/enums/app_bar_type.dart'; import 'package:shia_game_flutter/core/widgets/app_bar/enums/app_bar_type.dart';
import 'package:shia_game_flutter/core/widgets/app_bar/my_app_bar.dart'; import 'package:shia_game_flutter/core/widgets/app_bar/my_app_bar.dart';
import 'package:shia_game_flutter/features/battle_league/presentation/controller/battle_league_controller.dart'; import 'package:shia_game_flutter/features/battle_league/presentation/controller/battle_league_controller.dart';
import 'package:shia_game_flutter/features/battle_league/presentation/ui/widgets/battle_league_start_button.dart';
import 'package:shia_game_flutter/features/battle_league/presentation/ui/widgets/button/battle_golden_button.dart';
import 'package:shia_game_flutter/features/battle_league/presentation/ui/widgets/battle_league_tab_bar.dart'; import 'package:shia_game_flutter/features/battle_league/presentation/ui/widgets/battle_league_tab_bar.dart';
import 'package:shia_game_flutter/features/battle_league/presentation/ui/widgets/regional_ranking.dart'; import 'package:shia_game_flutter/features/battle_league/presentation/ui/widgets/regional_ranking.dart';
import 'package:shia_game_flutter/features/battle_league/presentation/ui/widgets/time_ranking.dart'; import 'package:shia_game_flutter/features/battle_league/presentation/ui/widgets/time_ranking.dart';
@ -75,7 +75,7 @@ class BattleLeaguePage extends GetView<BattleLeagueController> {
Padding _startButton(BuildContext context) { Padding _startButton(BuildContext context) {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 30), padding: const EdgeInsets.symmetric(horizontal: 30),
child: BattleLeagueStartButton(
child: BattleGoldenButton(
title: context.translate.play_now, title: context.translate.play_now,
onTap: controller.goToTopicPage, onTap: controller.goToTopicPage,
), ),

17
lib/features/topic/presentation/ui/topic_page.dart → lib/features/battle_league/presentation/ui/battle_league_topic_page.dart

@ -8,13 +8,13 @@ import 'package:shia_game_flutter/core/utils/my_localization.dart';
import 'package:shia_game_flutter/core/utils/screen_size.dart'; import 'package:shia_game_flutter/core/utils/screen_size.dart';
import 'package:shia_game_flutter/core/widgets/app_bar/enums/app_bar_type.dart'; import 'package:shia_game_flutter/core/widgets/app_bar/enums/app_bar_type.dart';
import 'package:shia_game_flutter/core/widgets/app_bar/my_app_bar.dart'; import 'package:shia_game_flutter/core/widgets/app_bar/my_app_bar.dart';
import 'package:shia_game_flutter/features/battle_league/presentation/ui/widgets/battle_league_start_button.dart';
import 'package:shia_game_flutter/features/topic/presentation/controller/topic_controller.dart';
import 'package:shia_game_flutter/features/topic/presentation/ui/widgets/battle_grey_button.dart';
import 'package:shia_game_flutter/features/topic/presentation/ui/widgets/topic_widget.dart';
import 'package:shia_game_flutter/features/battle_league/presentation/controller/battle_league_controller.dart';
import 'package:shia_game_flutter/features/battle_league/presentation/ui/widgets/button/battle_golden_button.dart';
import 'package:shia_game_flutter/features/battle_league/presentation/ui/widgets/button/battle_grey_button.dart';
import 'package:shia_game_flutter/features/battle_league/presentation/ui/widgets/topic_widget.dart';
class TopicPage extends GetView<TopicController> {
const TopicPage({super.key});
class BattleLeagueTopicPage extends GetView<BattleLeagueController> {
const BattleLeagueTopicPage({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -104,7 +104,10 @@ class TopicPage extends GetView<TopicController> {
Widget _startButton(BuildContext context) { Widget _startButton(BuildContext context) {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 30), padding: const EdgeInsets.symmetric(horizontal: 30),
child: BattleLeagueStartButton(title: context.translate.start_finding),
child: BattleGoldenButton(
onTap: controller.goToFindingPage,
title: context.translate.start_finding,
),
); );
} }
} }

4
lib/features/battle_league/presentation/ui/widgets/battle_league_start_button.dart → lib/features/battle_league/presentation/ui/widgets/button/battle_golden_button.dart

@ -3,8 +3,8 @@ import 'package:shia_game_flutter/core/utils/screen_size.dart';
import 'package:shia_game_flutter/core/widgets/container/my_container.dart'; import 'package:shia_game_flutter/core/widgets/container/my_container.dart';
import 'package:shia_game_flutter/core/widgets/text/gradient_text.dart'; import 'package:shia_game_flutter/core/widgets/text/gradient_text.dart';
class BattleLeagueStartButton extends StatelessWidget {
const BattleLeagueStartButton({
class BattleGoldenButton extends StatelessWidget {
const BattleGoldenButton({
super.key, super.key,
this.onTap, this.onTap,
this.title, this.title,

0
lib/features/topic/presentation/ui/widgets/battle_grey_button.dart → lib/features/battle_league/presentation/ui/widgets/button/battle_grey_button.dart

42
lib/features/battle_league/presentation/ui/widgets/button/battle_purple_button.dart

@ -0,0 +1,42 @@
import 'package:flutter/material.dart';
import 'package:shia_game_flutter/core/utils/screen_size.dart';
import 'package:shia_game_flutter/core/widgets/container/my_container.dart';
import 'package:shia_game_flutter/core/widgets/text/gradient_text.dart';
class BattlePurpleButton extends StatelessWidget {
const BattlePurpleButton({super.key, this.onTap, this.label});
final VoidCallback? onTap;
final String? label;
@override
Widget build(BuildContext context) {
return MyContainer(
onTap: onTap,
width: context.widthScreen,
height: 64.h,
borderRadius: const BorderRadius.all(Radius.circular(20)),
borderGradient: LinearGradient(
begin: AlignmentDirectional.topStart,
end: AlignmentDirectional.bottomEnd,
colors: [
const Color(0XFF7F4CD4),
const Color(0XFF7F4CD4).withValues(alpha: 0),
],
),
gradient: const RadialGradient(
radius: 5,
center: Alignment(-0.5, 0),
colors: [Color(0xFF6A36BF), Color(0xFF562A9E)],
),
child: GradientText(
text: label,
fontSize: 22.sp,
color: const Color(0xFFE1E1E1),
offset: const Offset(0, 1.04),
blurRadius: 1.9,
shadowColor: const Color(0xFF898989),
),
);
}
}

0
lib/features/topic/presentation/ui/widgets/topic_widget.dart → lib/features/battle_league/presentation/ui/widgets/topic_widget.dart

28
lib/features/topic/data/datasource/topic_datasource.dart

@ -1,28 +0,0 @@
import 'package:shia_game_flutter/core/constants/my_api.dart';
import 'package:shia_game_flutter/core/network/http_request.dart';
import 'package:shia_game_flutter/core/params/topic_params.dart';
import 'package:shia_game_flutter/core/response/base_response.dart';
import 'package:shia_game_flutter/features/topic/data/model/topic_model.dart';
import 'package:shia_game_flutter/features/topic/domain/entity/topic_entity.dart';
abstract class ITopicDatasource {
Future<TopicEntity> getData({required TopicParams params});
}
class TopicDatasourceImpl implements ITopicDatasource {
final IHttpRequest httpRequest;
const TopicDatasourceImpl(this.httpRequest);
@override
Future<TopicEntity> getData({required TopicParams params}) async {
final response = await httpRequest.get(
path: MyApi.baseUrl,
);
return BaseResponse.getData<TopicEntity>(
response?['data'],
(json) => TopicModel.fromJson(json),
);
}
}

13
lib/features/topic/data/model/topic_model.dart

@ -1,13 +0,0 @@
import 'package:shia_game_flutter/features/topic/domain/entity/topic_entity.dart';
class TopicModel extends TopicEntity {
const TopicModel({
super.id,
});
factory TopicModel.fromJson(Map<String, dynamic> json) {
return TopicModel(
id: json['id'],
);
}
}

29
lib/features/topic/data/repository_impl/topic_repository_impl.dart

@ -1,29 +0,0 @@
import 'package:flutter/foundation.dart';
import 'package:shia_game_flutter/core/error_handler/my_exception.dart';
import 'package:shia_game_flutter/core/params/topic_params.dart';
import 'package:shia_game_flutter/core/utils/data_state.dart';
import 'package:shia_game_flutter/features/topic/data/datasource/topic_datasource.dart';
import 'package:shia_game_flutter/features/topic/domain/entity/topic_entity.dart';
import 'package:shia_game_flutter/features/topic/domain/repository/topic_repository.dart';
class TopicRepositoryImpl implements ITopicRepository {
final ITopicDatasource datasource;
const TopicRepositoryImpl(this.datasource);
@override
Future<DataState<TopicEntity, MyException>> getData({required TopicParams params}) async {
try {
final TopicEntity response = await datasource.getData(params: params);
return DataState.success(response);
} on MyException catch (e) {
return DataState.error(e);
} catch (e) {
if (kDebugMode) {
rethrow;
} else {
return DataState.error(MyException(errorMessage: '$e'));
}
}
}
}

14
lib/features/topic/domain/entity/topic_entity.dart

@ -1,14 +0,0 @@
import 'package:equatable/equatable.dart';
class TopicEntity extends Equatable {
final int? id;
const TopicEntity({
this.id,
});
@override
List<Object?> get props => [
id,
];
}

8
lib/features/topic/domain/repository/topic_repository.dart

@ -1,8 +0,0 @@
import 'package:shia_game_flutter/core/error_handler/my_exception.dart';
import 'package:shia_game_flutter/core/params/topic_params.dart';
import 'package:shia_game_flutter/core/utils/data_state.dart';
import 'package:shia_game_flutter/features/topic/domain/entity/topic_entity.dart';
abstract class ITopicRepository {
Future<DataState<TopicEntity, MyException>> getData({required TopicParams params});
}

19
lib/features/topic/domain/usecases/get_topic_usecase.dart

@ -1,19 +0,0 @@
import 'package:shia_game_flutter/core/error_handler/my_exception.dart';
import 'package:shia_game_flutter/core/params/topic_params.dart';
import 'package:shia_game_flutter/core/usecase/usecase.dart';
import 'package:shia_game_flutter/core/utils/data_state.dart';
import 'package:shia_game_flutter/features/topic/domain/entity/topic_entity.dart';
import 'package:shia_game_flutter/features/topic/domain/repository/topic_repository.dart';
class GetTopicUseCase implements UseCase<TopicEntity, TopicParams> {
final ITopicRepository repository;
const GetTopicUseCase(this.repository);
@override
Future<DataState<TopicEntity, MyException>> call(TopicParams params) {
return repository.getData(params: params);
}
}

20
lib/features/topic/presentation/binding/topic_binding.dart

@ -1,20 +0,0 @@
import 'package:shia_game_flutter/features/topic/presentation/controller/topic_controller.dart';
import 'package:get/get.dart';
class TopicBinding extends Bindings {
@override
void dependencies() {
Get.put<TopicController>(TopicController(Get.find()));
}
Future<void> deleteBindings() async {
await Future.wait([
Get.delete<TopicController>(),
]);
}
Future<void> refreshBinding() async {
await deleteBindings();
dependencies();
}
}

54
lib/features/topic/presentation/controller/topic_controller.dart

@ -1,54 +0,0 @@
import 'package:flutter/cupertino.dart';
import 'package:shia_game_flutter/core/params/topic_params.dart';
import 'package:shia_game_flutter/core/status/base_status.dart';
import 'package:shia_game_flutter/features/topic/domain/entity/topic_entity.dart';
import 'package:shia_game_flutter/features/topic/domain/usecases/get_topic_usecase.dart';
import 'package:get/get.dart';
class TopicController extends GetxController with StateMixin {
/// ----- Constructor -----
TopicController(this.getTopicUseCase);
@override
void onInit() {
super.onInit();
change('', status: RxStatus.success());
}
@override
void onClose() {
textEditingController.dispose();
super.onClose();
}
/// ----- UseCases -----
final GetTopicUseCase getTopicUseCase;
/// ----- Variables -----
final Rx<TopicParams> topicParams = Rx(TopicParams());
final Rx<TopicEntity> topicEntity = Rx(const TopicEntity());
/// ------ Controllers ------
final TextEditingController textEditingController = TextEditingController();
/// ------ Statuses ------
final Rx<BaseStatus> getTopicStatus = Rx(const BaseInit());
/// ------ Functions ------
/// ------ Api Calls ------
Future<void> getTopic() async {
change('', status: RxStatus.loading());
await getTopicUseCase(topicParams.value).then(
(value) => value.fold(
(data) {
topicEntity.value = data;
change('', status: RxStatus.success());
},
(error) {
change('', status: RxStatus.error(error.errorMessage));
},
),
);
}
}

9
lib/init_bindings.dart

@ -33,10 +33,6 @@ import 'package:shia_game_flutter/features/shop/data/datasource/shop_datasource.
import 'package:shia_game_flutter/features/shop/data/repository_impl/shop_repository_impl.dart'; import 'package:shia_game_flutter/features/shop/data/repository_impl/shop_repository_impl.dart';
import 'package:shia_game_flutter/features/shop/domain/repository/shop_repository.dart'; import 'package:shia_game_flutter/features/shop/domain/repository/shop_repository.dart';
import 'package:shia_game_flutter/features/shop/domain/usecases/get_shop_usecase.dart'; import 'package:shia_game_flutter/features/shop/domain/usecases/get_shop_usecase.dart';
import 'package:shia_game_flutter/features/topic/data/datasource/topic_datasource.dart';
import 'package:shia_game_flutter/features/topic/data/repository_impl/topic_repository_impl.dart';
import 'package:shia_game_flutter/features/topic/domain/repository/topic_repository.dart';
import 'package:shia_game_flutter/features/topic/domain/usecases/get_topic_usecase.dart';
void initBindings() { void initBindings() {
/// ----- Classes ----- /// ----- Classes -----
@ -81,9 +77,4 @@ void initBindings() {
Get.lazyPut<IBattleLeagueDatasource>(() => BattleLeagueDatasourceImpl(Get.find()), fenix: true); Get.lazyPut<IBattleLeagueDatasource>(() => BattleLeagueDatasourceImpl(Get.find()), fenix: true);
Get.lazyPut<IBattleLeagueRepository>(() => BattleLeagueRepositoryImpl(Get.find()), fenix: true); Get.lazyPut<IBattleLeagueRepository>(() => BattleLeagueRepositoryImpl(Get.find()), fenix: true);
Get.lazyPut<GetBattleLeagueUseCase>(() => GetBattleLeagueUseCase(Get.find()), fenix: true); Get.lazyPut<GetBattleLeagueUseCase>(() => GetBattleLeagueUseCase(Get.find()), fenix: true);
/// ----- Topic Feature -----
Get.lazyPut<ITopicDatasource>(() => TopicDatasourceImpl(Get.find()), fenix: true);
Get.lazyPut<ITopicRepository>(() => TopicRepositoryImpl(Get.find()), fenix: true);
Get.lazyPut<GetTopicUseCase>(() => GetTopicUseCase(Get.find()), fenix: true);
} }
Loading…
Cancel
Save