diff --git a/assets/images/current_mission.svg b/assets/images/current_mission.svg new file mode 100644 index 0000000..12ddce8 --- /dev/null +++ b/assets/images/current_mission.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/finished_mission.svg b/assets/images/finished_mission.svg new file mode 100644 index 0000000..c960a44 --- /dev/null +++ b/assets/images/finished_mission.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/location.svg b/assets/images/location.svg new file mode 100644 index 0000000..09f09b4 --- /dev/null +++ b/assets/images/location.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/assets/images/map_background.png b/assets/images/map_background.png new file mode 100644 index 0000000..e033ac9 Binary files /dev/null and b/assets/images/map_background.png differ diff --git a/assets/images/mission.svg b/assets/images/mission.svg new file mode 100644 index 0000000..7bf70a1 --- /dev/null +++ b/assets/images/mission.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/common_ui/resources/my_assets.dart b/lib/common_ui/resources/my_assets.dart index aafeaa3..9ad30c0 100644 --- a/lib/common_ui/resources/my_assets.dart +++ b/lib/common_ui/resources/my_assets.dart @@ -28,4 +28,9 @@ class MyAssets { static const String correct = 'assets/images/correct.svg'; static const String wrong = 'assets/images/wrong.svg'; static const String handPoint = 'assets/images/hand_point.svg'; + static const String mapBackground = 'assets/images/map_background.png'; + static const String mission = 'assets/images/mission.svg'; + static const String finishedMission = 'assets/images/finished_mission.svg'; + static const String currentMission = 'assets/images/current_mission.svg'; + static const String location = 'assets/images/location.svg'; } \ No newline at end of file diff --git a/lib/core/params/home_params.dart b/lib/core/params/home_params.dart new file mode 100644 index 0000000..fdd3091 --- /dev/null +++ b/lib/core/params/home_params.dart @@ -0,0 +1,13 @@ +class HomeParams { + int? id; + + HomeParams({this.id}); + + HomeParams copyWith({ + int? id, + }) { + return HomeParams( + id: id ?? this.id, + ); + } +} diff --git a/lib/features/home/data/datasource/home_datasource.dart b/lib/features/home/data/datasource/home_datasource.dart new file mode 100644 index 0000000..17db1cf --- /dev/null +++ b/lib/features/home/data/datasource/home_datasource.dart @@ -0,0 +1,28 @@ +import 'package:hadi_hoda_flutter/core/constants/my_api.dart'; +import 'package:hadi_hoda_flutter/core/network/http_request.dart'; +import 'package:hadi_hoda_flutter/core/params/home_params.dart'; +import 'package:hadi_hoda_flutter/core/response/base_response.dart'; +import 'package:hadi_hoda_flutter/features/home/data/model/home_model.dart'; +import 'package:hadi_hoda_flutter/features/home/domain/entity/home_entity.dart'; + +abstract class IHomeDatasource { + Future getData({required HomeParams params}); +} + +class HomeDatasourceImpl implements IHomeDatasource { + final IHttpRequest httpRequest; + + const HomeDatasourceImpl(this.httpRequest); + + @override + Future getData({required HomeParams params}) async { + final response = await httpRequest.get( + path: MyApi.baseUrl, + ); + + return BaseResponse.getData( + response?['data'], + (json) => HomeModel.fromJson(json), + ); + } +} diff --git a/lib/features/home/data/model/home_model.dart b/lib/features/home/data/model/home_model.dart new file mode 100644 index 0000000..c63431f --- /dev/null +++ b/lib/features/home/data/model/home_model.dart @@ -0,0 +1,13 @@ +import 'package:hadi_hoda_flutter/features/home/domain/entity/home_entity.dart'; + +class HomeModel extends HomeEntity { + const HomeModel({ + super.id, + }); + + factory HomeModel.fromJson(Map json) { + return HomeModel( + id: json['id'], + ); + } +} diff --git a/lib/features/home/data/repository_impl/home_repository_impl.dart b/lib/features/home/data/repository_impl/home_repository_impl.dart new file mode 100644 index 0000000..594969b --- /dev/null +++ b/lib/features/home/data/repository_impl/home_repository_impl.dart @@ -0,0 +1,29 @@ +import 'package:hadi_hoda_flutter/core/params/home_params.dart'; +import 'package:flutter/foundation.dart'; +import 'package:hadi_hoda_flutter/core/error_handler/my_exception.dart'; +import 'package:hadi_hoda_flutter/core/utils/data_state.dart'; +import 'package:hadi_hoda_flutter/features/home/data/datasource/home_datasource.dart'; +import 'package:hadi_hoda_flutter/features/home/domain/entity/home_entity.dart'; +import 'package:hadi_hoda_flutter/features/home/domain/repository/home_repository.dart'; + +class HomeRepositoryImpl implements IHomeRepository { + final IHomeDatasource datasource; + + const HomeRepositoryImpl(this.datasource); + + @override + Future> getData({required HomeParams params}) async { + try { + final HomeEntity 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')); + } + } + } +} diff --git a/lib/features/home/domain/entity/home_entity.dart b/lib/features/home/domain/entity/home_entity.dart new file mode 100644 index 0000000..582723c --- /dev/null +++ b/lib/features/home/domain/entity/home_entity.dart @@ -0,0 +1,14 @@ +import 'package:equatable/equatable.dart'; + +class HomeEntity extends Equatable { + final int? id; + + const HomeEntity({ + this.id, + }); + + @override + List get props => [ + id, + ]; +} diff --git a/lib/features/home/domain/repository/home_repository.dart b/lib/features/home/domain/repository/home_repository.dart new file mode 100644 index 0000000..81ad27c --- /dev/null +++ b/lib/features/home/domain/repository/home_repository.dart @@ -0,0 +1,8 @@ +import 'package:hadi_hoda_flutter/core/error_handler/my_exception.dart'; +import 'package:hadi_hoda_flutter/core/params/home_params.dart'; +import 'package:hadi_hoda_flutter/core/utils/data_state.dart'; +import 'package:hadi_hoda_flutter/features/home/domain/entity/home_entity.dart'; + +abstract class IHomeRepository { + Future> getData({required HomeParams params}); +} diff --git a/lib/features/home/domain/usecases/get_home_usecase.dart b/lib/features/home/domain/usecases/get_home_usecase.dart new file mode 100644 index 0000000..cbb629d --- /dev/null +++ b/lib/features/home/domain/usecases/get_home_usecase.dart @@ -0,0 +1,17 @@ +import 'package:hadi_hoda_flutter/core/error_handler/my_exception.dart'; +import 'package:hadi_hoda_flutter/core/params/home_params.dart'; +import 'package:hadi_hoda_flutter/core/usecase/usecase.dart'; +import 'package:hadi_hoda_flutter/core/utils/data_state.dart'; +import 'package:hadi_hoda_flutter/features/home/domain/entity/home_entity.dart'; +import 'package:hadi_hoda_flutter/features/home/domain/repository/home_repository.dart'; + +class GetHomeUseCase implements UseCase { + final IHomeRepository repository; + + const GetHomeUseCase(this.repository); + + @override + Future> call(HomeParams params) { + return repository.getData(params: params); + } +} diff --git a/lib/features/home/presentation/bloc/home_bloc.dart b/lib/features/home/presentation/bloc/home_bloc.dart new file mode 100644 index 0000000..ae5f8ec --- /dev/null +++ b/lib/features/home/presentation/bloc/home_bloc.dart @@ -0,0 +1,41 @@ +import 'dart:async'; +import 'package:bloc/bloc.dart'; +import 'package:hadi_hoda_flutter/core/status/base_status.dart'; +import 'package:hadi_hoda_flutter/features/home/domain/entity/home_entity.dart'; +import 'package:hadi_hoda_flutter/features/home/domain/usecases/get_home_usecase.dart'; +import 'package:hadi_hoda_flutter/features/home/presentation/bloc/home_event.dart'; +import 'package:hadi_hoda_flutter/features/home/presentation/bloc/home_state.dart'; + +class HomeBloc extends Bloc { + /// ------------constructor------------ + HomeBloc( + this._getHomeUseCase, + ) : super(const HomeState()) { + on(_getHomeEvent); + } + + /// ------------UseCases------------ + final GetHomeUseCase _getHomeUseCase; + + /// ------------Variables------------ + + /// ------------Controllers------------ + + /// ------------Functions------------ + + /// ------------Api Calls------------ + FutureOr _getHomeEvent(event, emit) async { + await _getHomeUseCase(event.homeParams).then( + (value) { + value.fold( + (data) { + emit(state.copyWith(getHomeStatus: BaseComplete(data))); + }, + (error) { + emit(state.copyWith(getHomeStatus: BaseError(error.errorMessage))); + }, + ); + }, + ); + } +} diff --git a/lib/features/home/presentation/bloc/home_event.dart b/lib/features/home/presentation/bloc/home_event.dart new file mode 100644 index 0000000..2dc9c2f --- /dev/null +++ b/lib/features/home/presentation/bloc/home_event.dart @@ -0,0 +1,5 @@ +sealed class HomeEvent { + const HomeEvent(); +} + +class GetHomeEvent extends HomeEvent {} diff --git a/lib/features/home/presentation/bloc/home_state.dart b/lib/features/home/presentation/bloc/home_state.dart new file mode 100644 index 0000000..97a1646 --- /dev/null +++ b/lib/features/home/presentation/bloc/home_state.dart @@ -0,0 +1,15 @@ +import 'package:hadi_hoda_flutter/core/status/base_status.dart'; + +class HomeState { + final BaseStatus getHomeStatus; + + const HomeState({this.getHomeStatus = const BaseInit()}); + + HomeState copyWith({ + BaseStatus? getHomeStatus, + }) { + return HomeState( + getHomeStatus: getHomeStatus ?? this.getHomeStatus, + ); + } +} diff --git a/lib/features/home/presentation/ui/home_page.dart b/lib/features/home/presentation/ui/home_page.dart new file mode 100644 index 0000000..82f7ef8 --- /dev/null +++ b/lib/features/home/presentation/ui/home_page.dart @@ -0,0 +1,601 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hadi_hoda_flutter/common_ui/resources/my_assets.dart'; +import 'package:hadi_hoda_flutter/core/utils/my_image.dart'; +import 'package:hadi_hoda_flutter/core/utils/screen_size.dart'; +import 'package:path_drawing/path_drawing.dart'; + +class HomePage extends StatefulWidget { + const HomePage({super.key}); + + @override + State createState() => _HomePageState(); +} + +class _HomePageState extends State { + final ScrollController scrollController = ScrollController(); + + @override + Widget build(BuildContext context) { + return Scaffold( + body: SingleChildScrollView( + controller: scrollController, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mapBackground, fit: BoxFit.cover), + Positioned( + top: context.heightScreen * 0.16, + left: context.widthScreen * 0.15, + child: Stack( + children: [ + CurvyDashedPathPD( + height: 950, + width: context.widthScreen * 0.6, + ), + Positioned( + bottom: 30, + right: 80, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '9', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + bottom: 70, + left: 20, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '10', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + bottom: 150, + left: 50, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '11', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + bottom: 180, + left: 140, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '12', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + bottom: 260, + right: 20, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '13', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + bottom: 370, + right: 30, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '14', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + bottom: 420, + left: 40, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '15', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + top: 410, + left: 0, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '16', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + top: 320, + left: 60, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '17', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + top: 220, + left: 80, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '18', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + top: 130, + left: 20, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '19', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + top: 50, + left: 70, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '20', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + ], + ), + ), + Positioned( + bottom: context.heightScreen * 0.12, + left: context.widthScreen * 0.2, + child: Stack( + clipBehavior: Clip.none, + children: [ + DottedRoute( + width: context.widthScreen * 0.75, + height: context.heightScreen * 0.65, + ), + Positioned( + bottom: -30, + left: 30, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '1', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + bottom: 50, + left: 100, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '2', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + bottom: 150, + left: 50, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '3', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + bottom: 250, + left: 130, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '4', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + bottom: 300, + right: 50, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '5', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + top: 170, + right: 40, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '6', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + top: 70, + right: 70, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '7', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + Positioned( + top: -20, + right: 60, + child: Stack( + alignment: Alignment.center, + children: [ + MyImage(image: MyAssets.mission, size: 43), + Text( + '8', + style: GoogleFonts.marhey( + fontSize: 28, + fontWeight: FontWeight.w400, + color: Colors.white, + ), + ), + ], + ), + ), + ], + ), + ), + ], + ), + ), + ); + } +} + +class DottedRoute extends StatelessWidget { + const DottedRoute({ + super.key, + this.width = 500, + this.height = 1523, + this.color = Colors.white, + }); + + final double width; + final double height; + final Color color; + + @override + Widget build(BuildContext context) { + return CustomPaint( + painter: _DottedRoutePainter(color), + size: Size( + width, + height, + ), // or Size.infinite inside a parent with constraints + ); + } +} + +class _DottedRoutePainter extends CustomPainter { + _DottedRoutePainter(this.color); + + final Color color; + + // SVG viewBox + static const double _vbW = 500; + static const double _vbH = 1523; + + // Your SVG path data (unchanged) + static const String _svgPath = + 'M1.95892 1520.75C1.95892 1520.75 199.206 1423.63 169.156 1328.9C143.058 1246.63 30.8103 1281.9 15.4421 1225.27C-11.9488 1124.33 48.5736 1164.01 42.795 1033.8C38.5466 938.07 154.913 925.725 219.623 855.048C286.233 782.296 385.022 821.209 446.532 744.097C516.262 656.681 493.917 461.712 493.917 461.712C493.917 461.712 440.122 333.473 428.04 246.36C414.846 151.222 436.901 0.572754 436.901 0.572754'; + + @override + void paint(Canvas canvas, Size size) { + // Scale SVG viewBox -> current canvas while preserving aspect + final scale = _scaleToFit( + srcW: _vbW, + srcH: _vbH, + dstW: size.width, + dstH: size.height, + ); + canvas.translate( + (size.width - _vbW * scale) / 2, + (size.height - _vbH * scale) / 2, + ); + canvas.scale(scale); + + // Parse and dash the path + final path = parseSvgPathData(_svgPath); + final dashed = dashPath( + path, + dashArray: CircularIntervalList(const [3.08, 13.1]), + ); + + // Stroke paint + final paint = Paint() + ..style = PaintingStyle.stroke + ..strokeWidth = 4.62295 + ..color = color + ..strokeCap = StrokeCap.butt + ..strokeJoin = StrokeJoin.miter; + + canvas.drawPath(dashed, paint); + } + + double _scaleToFit({ + required double srcW, + required double srcH, + required double dstW, + required double dstH, + }) { + final sx = dstW / srcW; + final sy = dstH / srcH; + return sx < sy ? sx : sy; // contain + } + + @override + bool shouldRepaint(covariant _DottedRoutePainter oldDelegate) => + oldDelegate.color != color; +} + +class CurvyDashedPathPD extends StatelessWidget { + const CurvyDashedPathPD({ + super.key, + this.width = 604, + this.height = 2651, + this.color = Colors.white, + }); + + final double width; + final double height; + final Color color; + + @override + Widget build(BuildContext context) { + return CustomPaint( + size: Size(width, height), + painter: _CurvyDashedPathPDPainter(color: color), + isComplex: true, + willChange: false, + ); + } +} + +class _CurvyDashedPathPDPainter extends CustomPainter { + _CurvyDashedPathPDPainter({required this.color}); + + final Color color; + + // SVG viewBox + static const double _vbW = 604.0; + static const double _vbH = 2651.0; + + // SVG stroke styling + static const double _strokeWidth = 4.62295; + static const List _dashPattern = [3.08, 13.1]; + + // The original SVG "d" attribute: + static const String _d = ''' +M323.844 1.5163 +C323.844 1.5163 254.064 132.635 209.041 216.483 +C167.229 294.353 105.588 327.363 101.557 415.655 +C96.6703 522.7 235.238 655.278 235.238 655.278 +C235.238 655.278 284.393 748.372 277.229 810.918 +C270.331 871.151 205.959 948.836 205.959 948.836 +C205.959 948.836 31.3055 963.687 11.4099 1046.3 +C-1.94798 1101.77 54.9427 1185.76 54.9427 1185.76 +C54.9427 1185.76 -32.6228 1326.5 19.8853 1386.09 +C63.1414 1435.18 185.541 1411.13 185.541 1411.13 +C185.541 1411.13 427.654 1354.52 472.164 1458.9 +C492.877 1507.48 472.164 1594.12 472.164 1594.12 +C472.164 1594.12 454.029 1680.13 464.844 1733.58 +C476.306 1790.23 531.492 1865.72 531.492 1865.72 +C531.492 1865.72 515.799 1970.22 472.164 2015.58 +C437.994 2051.1 361.598 2076.45 361.598 2076.45 +C361.598 2076.45 304.217 2117.23 262.59 2133.08 +C221.475 2148.74 152.41 2156.58 152.41 2156.58 +C152.41 2156.58 60.2151 2199.32 47.623 2253.66 +C34.196 2311.61 108.877 2393.12 108.877 2393.12 +C108.877 2393.12 201.293 2437.1 262.59 2460.15 +C315.761 2480.15 400.893 2505.23 400.893 2505.23 +C400.893 2505.23 509.508 2505.09 553.451 2548.76 +C584.574 2579.7 601.221 2650.47 601.221 2650.47 +'''; + + @override + void paint(Canvas canvas, Size size) { + // Scale to widget size + final sx = size.width / _vbW; + final sy = size.height / _vbH; + canvas.save(); + canvas.scale(sx, sy); + + // Parse SVG path data to a Path + final Path original = parseSvgPathData(_d); + + // Apply dash pattern + final Path dashed = dashPath( + original, + dashArray: CircularIntervalList(_dashPattern), + ); + + // Stroke paint + final paint = Paint() + ..style = PaintingStyle.stroke + ..strokeWidth = _strokeWidth + ..strokeCap = StrokeCap.butt + ..strokeJoin = StrokeJoin.miter + ..color = color; + + canvas.drawPath(dashed, paint); + canvas.restore(); + } + + @override + bool shouldRepaint(covariant CustomPainter oldDelegate) => false; +} + diff --git a/lib/init_bindings.dart b/lib/init_bindings.dart index 8bb826b..ee8f953 100644 --- a/lib/init_bindings.dart +++ b/lib/init_bindings.dart @@ -1,5 +1,9 @@ import 'package:hadi_hoda_flutter/core/network/http_request.dart'; import 'package:hadi_hoda_flutter/core/network/http_request_impl.dart'; +import 'package:hadi_hoda_flutter/features/home/data/datasource/home_datasource.dart'; +import 'package:hadi_hoda_flutter/features/home/data/repository_impl/home_repository_impl.dart'; +import 'package:hadi_hoda_flutter/features/home/domain/repository/home_repository.dart'; +import 'package:hadi_hoda_flutter/features/home/domain/usecases/get_home_usecase.dart'; import 'package:hadi_hoda_flutter/features/intro/data/datasource/intro_datasource.dart'; import 'package:hadi_hoda_flutter/features/intro/data/repository_impl/intro_repository_impl.dart'; import 'package:hadi_hoda_flutter/features/intro/domain/repository/intro_repository.dart'; @@ -34,4 +38,9 @@ void initBindings() { locator.registerLazySingleton(() => QuestionDatasourceImpl(locator())); locator.registerLazySingleton(() => QuestionRepositoryImpl(locator())); locator.registerLazySingleton(() => GetQuestionUseCase(locator())); + + /// Home Feature + locator.registerLazySingleton(() => HomeDatasourceImpl(locator())); + locator.registerLazySingleton(() => HomeRepositoryImpl(locator())); + locator.registerLazySingleton(() => GetHomeUseCase(locator())); } diff --git a/pubspec.lock b/pubspec.lock index b9bc647..0a9a3de 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -29,10 +29,10 @@ packages: dependency: "direct main" description: name: bloc - sha256: "52c10575f4445c61dd9e0cafcc6356fdd827c4c64dd7945ef3c4105f6b6ac189" + sha256: e18b8e7825e9921d67a6d256dba0b6015ece8a577eb0a411845c46a352994d78 url: "https://pub.dev" source: hosted - version: "9.0.0" + version: "9.0.1" boolean_selector: dependency: transitive description: @@ -317,6 +317,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.1" + path_drawing: + dependency: "direct main" + description: + name: path_drawing + sha256: bbb1934c0cbb03091af082a6389ca2080345291ef07a5fa6d6e078ba8682f977 + url: "https://pub.dev" + source: hosted + version: "1.0.1" path_parsing: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 7b50df4..4cd4cfc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -21,6 +21,7 @@ dependencies: go_router: ^16.1.0 google_fonts: ^6.3.2 intl: ^0.20.2 + path_drawing: ^1.0.1 pretty_dio_logger: ^1.4.0 shared_preferences: ^2.5.3 showcaseview: ^4.0.1