Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mo7amedaliEbaid committed Nov 7, 2023
1 parent 02bd48a commit e630a28
Show file tree
Hide file tree
Showing 64 changed files with 54 additions and 53 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:dartz/dartz.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

abstract class BookmarkLocalDataSource {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:dartz/dartz.dart';
import 'package:movies_riverpod/features/bookmarks/data/datasource/local/bookmark_local_datasource.dart';
import 'package:movies_riverpod/features/notifications/data/models/notification.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';
import 'package:movies_riverpod/shared/local/cache/local_db.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';
import 'package:isar/isar.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:dartz/dartz.dart';
import 'package:movies_riverpod/features/bookmarks/data/datasource/local/bookmark_local_datasource.dart';
import 'package:movies_riverpod/features/bookmarks/domain/repositories/bookmark_repository.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

interface class BookmarkRepositoryImpl extends BookmarkRepository {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:dartz/dartz.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

abstract class BookmarkRepository {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:dartz/dartz.dart';
import 'package:movies_riverpod/features/bookmarks/domain/repositories/bookmark_repository.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

interface class GetBookmarksUseCase {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:movies_riverpod/features/bookmarks/domain/repositories/bookmark_repository.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';

interface class RemoveBookmarkUseCase {
final BookmarkRepository bookmarkRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:movies_riverpod/features/bookmarks/domain/use_cases/get_bookmark
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:movies_riverpod/di/Injector.dart';
import 'package:movies_riverpod/features/bookmarks/presentation/providers/state/bookmark_state.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

import '../../../../movie_detail/domain/use_cases/remove_bookmark_use_case.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:equatable/equatable.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';

enum BookmarkConcreteState { initial, loading, loaded, failure }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:movies_riverpod/app/app_configs.dart';
import 'package:movies_riverpod/app/app_dimensions.dart';
import 'package:movies_riverpod/features/bookmarks/presentation/providers/bookmark_notifier_provider.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';
import 'package:movies_riverpod/shared/extensions/build_context_extensions.dart';
import 'package:movies_riverpod/shared/widgets/rating_bar.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';

abstract class MovieDetailLocalDataSource {
Future<int> bookmarkMovie(MovieDetail movieDetail);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:movies_riverpod/features/movie_detail/data/datasource/local/movie_detail_local_datasource.dart';
import 'package:movies_riverpod/features/notifications/data/models/notification.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';
import 'package:movies_riverpod/shared/local/cache/local_db.dart';
import 'package:isar/isar.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:dartz/dartz.dart';
import 'package:movies_riverpod/features/movie_detail/data/datasource/remote/movie_detail_remote_datasource.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';
import 'package:movies_riverpod/models/response/casts_response.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';
import 'package:movies_riverpod/shared/network/network_service.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:dartz/dartz.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';
import 'package:movies_riverpod/models/response/casts_response.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:dartz/dartz.dart';
import 'package:movies_riverpod/features/movie_detail/data/datasource/local/movie_detail_local_datasource.dart';
import 'package:movies_riverpod/features/movie_detail/data/datasource/remote/movie_detail_remote_datasource.dart';
import 'package:movies_riverpod/features/movie_detail/domain/repositories/movie_detail_repository.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';
import 'package:movies_riverpod/models/response/casts_response.dart';

import 'package:movies_riverpod/shared/util/app_exception.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:dartz/dartz.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';
import 'package:movies_riverpod/models/response/casts_response.dart';

import 'package:movies_riverpod/shared/util/app_exception.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:movies_riverpod/features/movie_detail/domain/repositories/movie_detail_repository.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';

interface class AddBookmarkUseCase {
final MovieDetailRepository movieDetailRepository;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:dartz/dartz.dart';
import 'package:movies_riverpod/features/movie_detail/domain/repositories/movie_detail_repository.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

interface class GetMovieDetailsUseCase {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:movies_riverpod/features/movie_detail/domain/repositories/movie_detail_repository.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';

interface class RemoveBookmarkUseCase {
final MovieDetailRepository movieDetailRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:movies_riverpod/features/movie_detail/domain/use_cases/get_casts
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:movies_riverpod/di/Injector.dart';
import 'package:movies_riverpod/features/movie_detail/presentation/provider/state/casts_state.dart';
import 'package:movies_riverpod/models/cast.dart';
import 'package:movies_riverpod/models/cast/cast.dart';
import 'package:movies_riverpod/models/response/casts_response.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:equatable/equatable.dart';
import 'package:movies_riverpod/models/cast.dart';
import 'package:movies_riverpod/models/cast/cast.dart';

enum CastConcreteState { initial, loading, loaded, failure }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:movies_riverpod/features/movie_detail/domain/use_cases/remove_bo
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:movies_riverpod/di/Injector.dart';
import 'package:movies_riverpod/features/movie_detail/presentation/provider/state/movie_detail_state.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

interface class MovieDetailNotifier extends StateNotifier<MovieDetailState> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:equatable/equatable.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';

enum MovieDetailConcreteState {
initial,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:movies_riverpod/app/app_configs.dart';
import 'package:movies_riverpod/app/app_dimensions.dart';
import 'package:movies_riverpod/models/cast.dart';
import 'package:movies_riverpod/models/cast/cast.dart';
import 'package:movies_riverpod/shared/extensions/build_context_extensions.dart';

class CastItem extends StatelessWidget {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:movies_riverpod/app/app_constants.dart';
import 'package:movies_riverpod/app/app_dimensions.dart';
import 'package:movies_riverpod/features/movie_detail/presentation/provider/movie_detail_state_notifier.dart';
import 'package:movies_riverpod/features/movie_detail/presentation/widget/casts_list.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';
import 'package:movies_riverpod/shared/extensions/build_context_extensions.dart';
import 'package:movies_riverpod/shared/widgets/genre_chip.dart';
import 'package:movies_riverpod/shared/widgets/rating_bar.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:movies_riverpod/app/app_colors.dart';
import 'package:movies_riverpod/app/app_configs.dart';
import 'package:movies_riverpod/app/app_dimensions.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';

class MovieDetailHeader extends StatelessWidget {
final MovieDetail movieDetail;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:dartz/dartz.dart';
import 'package:movies_riverpod/models/domain/movies.dart';
import 'package:movies_riverpod/models/genres.dart';
import 'package:movies_riverpod/models/movies/movies.dart';
import 'package:movies_riverpod/models/genres/genres.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

abstract class HomeLocalDataSource {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:dartz/dartz.dart';
import 'package:movies_riverpod/models/domain/movies.dart';
import 'package:movies_riverpod/models/genres.dart';
import 'package:movies_riverpod/models/movies/movies.dart';
import 'package:movies_riverpod/models/genres/genres.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';
import 'package:isar/isar.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import 'package:movies_riverpod/app/app_configs.dart';
import 'package:movies_riverpod/features/movies/data/datasource/local/home_local_datasource.dart';
import 'package:movies_riverpod/features/movies/data/datasource/remote/home_remote_data_source.dart';
import 'package:movies_riverpod/features/movies/domain/repositories/home_repository.dart';
import 'package:movies_riverpod/models/domain/movies.dart';
import 'package:movies_riverpod/models/genres.dart';
import 'package:movies_riverpod/models/movie.dart';
import 'package:movies_riverpod/models/movies/movies.dart';
import 'package:movies_riverpod/models/genres/genres.dart';
import 'package:movies_riverpod/models/movie/movie.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

import 'package:movies_riverpod/models/genre.dart';
import 'package:movies_riverpod/models/genre/genre.dart';

interface class HomeRepoImpl extends HomeRepository {
final HomeRemoteDataSource homeRemoteDataSource;
Expand Down
4 changes: 2 additions & 2 deletions lib/features/movies/domain/repositories/home_repository.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:dartz/dartz.dart';
import 'package:movies_riverpod/models/domain/movies.dart';
import 'package:movies_riverpod/models/genres.dart';
import 'package:movies_riverpod/models/movies/movies.dart';
import 'package:movies_riverpod/models/genres/genres.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

abstract class HomeRepository {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:dartz/dartz.dart';
import 'package:movies_riverpod/features/movies/domain/repositories/home_repository.dart';
import 'package:movies_riverpod/models/genres.dart';
import 'package:movies_riverpod/models/genres/genres.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

interface class FetchAndCacheGenreUseCase {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:dartz/dartz.dart';
import 'package:movies_riverpod/features/movies/domain/repositories/home_repository.dart';
import 'package:movies_riverpod/models/domain/movies.dart';
import 'package:movies_riverpod/models/movies/movies.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

interface class FetchAndCacheMoviesUseCase {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:dartz/dartz.dart';
import 'package:movies_riverpod/features/movies/domain/repositories/home_repository.dart';
import 'package:movies_riverpod/models/genres.dart';
import 'package:movies_riverpod/models/genres/genres.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

interface class FetchCacheGenresUseCase {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:dartz/dartz.dart';
import 'package:movies_riverpod/features/movies/domain/repositories/home_repository.dart';
import 'package:movies_riverpod/models/domain/movies.dart';
import 'package:movies_riverpod/models/movies/movies.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

interface class FetchCachedMoviesUseCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:movies_riverpod/features/movies/domain/use_cases/fetch_and_cache
import 'package:movies_riverpod/features/movies/domain/use_cases/fetch_cached_genre_use_case.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:movies_riverpod/di/Injector.dart';
import 'package:movies_riverpod/models/genres.dart';
import 'package:movies_riverpod/models/genres/genres.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

import 'genre_state.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:equatable/equatable.dart';

import 'package:movies_riverpod/models/genre.dart';
import 'package:movies_riverpod/models/genre/genre.dart';

enum GenreConcreteState { initial, loading, loaded, failure }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:movies_riverpod/features/movies/domain/use_cases/fetch_cached_mo
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:movies_riverpod/di/Injector.dart';
import 'package:movies_riverpod/features/movies/presentation/providers/state/movie_state.dart';
import 'package:movies_riverpod/models/domain/movies.dart';
import 'package:movies_riverpod/models/movies/movies.dart';
import 'package:movies_riverpod/shared/util/app_exception.dart';

interface class MovieNotifier extends StateNotifier<MovieState> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:equatable/equatable.dart';

import 'package:movies_riverpod/models/movie.dart';
import 'package:movies_riverpod/models/movie/movie.dart';

enum MoviesConcreteState {
initial,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:movies_riverpod/app/app_configs.dart';
import 'package:movies_riverpod/app/app_dimensions.dart';

import 'package:movies_riverpod/models/movie.dart';

import 'package:movies_riverpod/shared/widgets/rating_bar.dart';

import '../../../../models/movie/movie.dart';

class NowShowingMovieCard extends StatelessWidget {
final Movie movie;

Expand Down
2 changes: 1 addition & 1 deletion lib/features/movies/presentation/widgets/popular_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:movies_riverpod/app/app_configs.dart';
import 'package:movies_riverpod/app/app_dimensions.dart';
import 'package:movies_riverpod/features/movies/presentation/providers/movies_state_notifier_provider.dart';
import 'package:movies_riverpod/models/movie.dart';
import 'package:movies_riverpod/shared/extensions/build_context_extensions.dart';
import 'package:movies_riverpod/shared/widgets/genre_chip.dart';

import 'package:movies_riverpod/shared/widgets/rating_bar.dart';

import '../../../../models/movie/movie.dart';
import '../providers/state/genre_state.dart';


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import 'package:movies_riverpod/app/app_configs.dart';
import 'package:movies_riverpod/app/app_dimensions.dart';
import 'package:movies_riverpod/app/app_text_styles.dart';
import 'package:movies_riverpod/features/movies/presentation/providers/movies_state_notifier_provider.dart';
import 'package:movies_riverpod/models/movie.dart';
import 'package:movies_riverpod/shared/extensions/build_context_extensions.dart';
import 'package:movies_riverpod/shared/widgets/genre_chip.dart';

import 'package:movies_riverpod/shared/widgets/rating_bar.dart';

import '../../../../models/movie/movie.dart';
import '../providers/state/genre_state.dart';

class UpcomingMovie extends ConsumerWidget {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/models/casts.dart → lib/models/casts/casts.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:movies_riverpod/models/cast.dart';
import 'package:movies_riverpod/models/cast/cast.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:isar/isar.dart';

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/models/genres.dart → lib/models/genres/genres.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:movies_riverpod/models/genre.dart';
import 'package:movies_riverpod/models/genre/genre.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:isar/isar.dart';

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:movies_riverpod/models/genre.dart';
import 'package:movies_riverpod/models/genre/genre.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:isar/isar.dart';

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:movies_riverpod/models/movie.dart';
import 'package:movies_riverpod/models/movie/movie.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:isar/isar.dart';

Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions lib/shared/local/cache/local_db_impl.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:movies_riverpod/features/notifications/data/models/notification.dart';
import 'package:movies_riverpod/models/domain/movies.dart';
import 'package:movies_riverpod/models/genres.dart';
import 'package:movies_riverpod/models/movie_detail.dart';
import 'package:movies_riverpod/models/movies/movies.dart';
import 'package:movies_riverpod/models/genres/genres.dart';
import 'package:movies_riverpod/models/movie_details/movie_detail.dart';
import 'package:isar/isar.dart';
import 'package:path_provider/path_provider.dart';

Expand Down

0 comments on commit e630a28

Please sign in to comment.