-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a004421
commit bf8a1d4
Showing
47 changed files
with
604 additions
and
18 deletions.
There are no files selected for viewing
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.
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.
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.
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.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
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.
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.
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.
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.
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,29 @@ | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
class AppBlocObserver extends BlocObserver { | ||
const AppBlocObserver(); | ||
|
||
@override | ||
void onEvent(Bloc bloc, Object? event) { | ||
super.onEvent(bloc, event); | ||
print(event); | ||
} | ||
|
||
@override | ||
void onError(BlocBase bloc, Object error, StackTrace stackTrace) { | ||
super.onError(bloc, error, stackTrace); | ||
print(error); | ||
} | ||
|
||
@override | ||
void onChange(BlocBase bloc, Change change) { | ||
super.onChange(bloc, change); | ||
print(change); | ||
} | ||
|
||
@override | ||
void onTransition(Bloc bloc, Transition transition) { | ||
super.onTransition(bloc, transition); | ||
print(transition); | ||
} | ||
} |
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,10 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class CategoriesScreen extends StatelessWidget { | ||
const CategoriesScreen({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Center(child: Text("Categories"),); | ||
} | ||
} |
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,10 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class DownloadsScreen extends StatelessWidget { | ||
const DownloadsScreen({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Center(child: Text("Download"),); | ||
} | ||
} |
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,6 @@ | ||
export '/categories/categories.dart'; | ||
export '/downloads/downloads.dart'; | ||
export '/home/home_page.dart'; | ||
export '/more/more.dart'; | ||
export '/moviedetails/movie_details.dart'; | ||
export '/onboarding/on_boarding.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,50 @@ | ||
import 'package:carousel_slider/carousel_slider.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class CarouselSliderShaderWidget extends StatelessWidget { | ||
const CarouselSliderShaderWidget({ | ||
super.key, | ||
required List<String> paths, | ||
}) : _paths = paths; | ||
|
||
final Gradient _maskingGradient = const LinearGradient( | ||
colors: [ | ||
Colors.black, | ||
Colors.transparent, | ||
], | ||
stops: [0.0, 0.4], | ||
tileMode: TileMode.mirror, | ||
begin: Alignment.centerLeft, | ||
end: Alignment.center, | ||
); | ||
final List<String> _paths; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ShaderMask( | ||
shaderCallback: (bounds) => _maskingGradient.createShader(bounds), | ||
blendMode: BlendMode.darken, | ||
child: CarouselSlider( | ||
options: CarouselOptions( | ||
height: 173.0, | ||
enlargeFactor: 0.2, | ||
viewportFraction: 0.7, | ||
enlargeCenterPage: true, | ||
), | ||
items: _paths.map((seriesPath) { | ||
return Builder(builder: (BuildContext context) { | ||
return GestureDetector( | ||
child: Container( | ||
width: MediaQuery.of(context).size.width, | ||
margin: const EdgeInsets.symmetric(horizontal: 6.0), | ||
decoration: const BoxDecoration(color: Colors.amber), | ||
child: Image.asset(seriesPath, fit: BoxFit.fill), | ||
), | ||
onTap: () {}, | ||
); | ||
}); | ||
}).toList(), | ||
), | ||
); | ||
} | ||
} |
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,34 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class HorizontalMoviesListView extends StatelessWidget { | ||
const HorizontalMoviesListView({ | ||
super.key, | ||
required List<String> paths, | ||
}) : _paths = paths; | ||
|
||
final List<String> _paths; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ListView.builder( | ||
physics: const ClampingScrollPhysics(), | ||
shrinkWrap: true, | ||
scrollDirection: Axis.horizontal, | ||
itemCount: _paths.length, | ||
itemBuilder: (BuildContext context, int index) => Padding( | ||
padding: const EdgeInsets.only( | ||
left: 12.0, | ||
), | ||
child: GestureDetector( | ||
child: Image.asset( | ||
_paths.elementAt(index), | ||
fit: BoxFit.fill, | ||
width: 100.0, | ||
height: 150.0, | ||
), | ||
onTap: () => {}, | ||
), | ||
), | ||
); | ||
} | ||
} |
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,6 @@ | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:flutter_movie_clean/home/cubit/home_state.dart'; | ||
|
||
class HomeCubit extends Cubit<HomeState> { | ||
HomeCubit() : super(HomeState()); | ||
} |
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,28 @@ | ||
import '../../generated/assets.gen.dart'; | ||
|
||
class HomeState { | ||
HomeState(); | ||
|
||
final List<String> moviesPaths = [ | ||
Assets.images.movies.movies1.path, | ||
Assets.images.movies.movies2.path, | ||
Assets.images.movies.movies3.path, | ||
]; | ||
|
||
final List<String> seriesPaths = [ | ||
Assets.images.series.series1.path, | ||
Assets.images.series.series2.path, | ||
Assets.images.series.series3.path, | ||
]; | ||
|
||
final List<String> trendingPaths = [ | ||
Assets.images.trendings.trending1.path, | ||
Assets.images.trendings.trending2.path, | ||
Assets.images.trendings.trending3.path, | ||
Assets.images.trendings.trending4.path, | ||
Assets.images.trendings.trending1.path, | ||
Assets.images.trendings.trending2.path, | ||
Assets.images.trendings.trending3.path, | ||
Assets.images.trendings.trending4.path, | ||
]; | ||
} |
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,17 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
import 'cubit/home_cubit.dart'; | ||
import 'home_view.dart'; | ||
|
||
class HomeScreen extends StatelessWidget { | ||
const HomeScreen({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return BlocProvider( | ||
create: (_) => HomeCubit(), | ||
child: const HomeView(), | ||
); | ||
} | ||
} |
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,58 @@ | ||
import 'package:easy_localization/easy_localization.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:flutter_movie_clean/widgets/header_widget.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
|
||
import '../generated/locale_keys.g.dart'; | ||
import 'components/carousel_slider_shader.dart'; | ||
import 'components/horizontal_movie_list_view.dart'; | ||
import 'cubit/home_cubit.dart'; | ||
|
||
class HomeView extends StatelessWidget { | ||
const HomeView({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final state = BlocProvider.of<HomeCubit>(context, listen: false).state; | ||
return SingleChildScrollView( | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
const SizedBox(height: 16.0), | ||
HeaderWidget(onProfileTapped: () { | ||
context.go(context.namedLocation('movie_details')); | ||
}), | ||
Padding( | ||
padding: const EdgeInsets.only(left: 12.0, bottom: 14.0), | ||
child: Text( | ||
LocaleKeys.latest_movies.tr(), | ||
style: Theme.of(context).textTheme.titleLarge, | ||
), | ||
), | ||
CarouselSliderShaderWidget(paths: state.moviesPaths), | ||
Padding( | ||
padding: const EdgeInsets.only(top: 24.0, left: 12.0, bottom: 14.0), | ||
child: Text( | ||
LocaleKeys.latest_series.tr(), | ||
style: Theme.of(context).textTheme.titleLarge, | ||
), | ||
), | ||
CarouselSliderShaderWidget(paths: state.seriesPaths), | ||
Padding( | ||
padding: const EdgeInsets.only(top: 24.0, left: 12.0, bottom: 14.0), | ||
child: Text( | ||
LocaleKeys.trending_today.tr(), | ||
style: Theme.of(context).textTheme.titleLarge, | ||
), | ||
), | ||
SizedBox( | ||
height: 150.0, | ||
child: HorizontalMoviesListView(paths: state.trendingPaths), | ||
), | ||
const SizedBox(height: 55.0), | ||
], | ||
), | ||
); | ||
} | ||
} |
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,10 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class MoreScreen extends StatelessWidget { | ||
const MoreScreen({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Center(child: Text("More"),); | ||
} | ||
} |
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,10 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class MovieDetailsScreen extends StatelessWidget { | ||
const MovieDetailsScreen({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Center(child: Text('Movie details'),); | ||
} | ||
} |
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
File renamed without changes.
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.