Skip to content

Commit 2fb1fb3

Browse files
authored
Add files via upload
1 parent d7abfc8 commit 2fb1fb3

100 files changed

Lines changed: 10137 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# MovieDB
2+
3+
Note: App is updated to version 1.0.1 you can find other versions by changing branch or in release.
4+
5+
# Changelog
6+
7+
- removed cloud firestore as database.
8+
- added hive_flutter as local database to store favorites for fast data fetching.
9+
- added proxy server to hide Api-key and get all data in one single request(backend folder -You can deploy it to heroku).
10+
- migrated old flutter code base (2.2.3) to latest 2.8.0 app.
11+
- added youtube_player_flutter library to watch trailers.
12+
- removed dynamic theming.
13+
- added new glassy effect to each page and new theme for home page.
14+
- added data caching for movies and tv shows.
15+
- added image download feature. (backdrops, logos, posters)
16+
- new animations.
17+
- removed palette_generator package.
18+
19+
## App Features.
20+
21+
- Search Functionality
22+
- Onboarding-Screen
23+
- Select favourite movie
24+
- Home Screen
25+
- Tranding movie
26+
- Movies different category
27+
- Popular movie
28+
- Upcomming movie
29+
- Tranding person of week
30+
- Top rated movie
31+
- Movies detail
32+
- Movies trailer and poster
33+
- Movie cast
34+
- Cast member detail
35+
- Movies on bases of keyword
36+
- Recommendation and similar movie
37+
38+
**Packages used:**
39+
40+
- cupertino_icons: ^1.0.2
41+
- intl: ^0.17.0
42+
- http: ^0.13.4
43+
- hive_flutter: ^1.1.0
44+
- flutter_bloc: ^8.0.0
45+
- font_awesome_flutter: ^9.2.0
46+
- google_fonts: ^2.1.0
47+
- url_launcher: ^6.0.17
48+
- readmore: ^2.1.0
49+
- cached_network_image: ^3.2.0
50+
- equatable: ^2.0.3
51+
- uni_links: ^0.5.1
52+
- shimmer: ^2.0.0
53+
- fluttertoast: ^8.0.8
54+
- photo_view: ^0.13.0
55+
- carousel_slider: ^4.0.0
56+
- youtube_player_flutter:
57+
- git:
58+
- url: https://github.com/anshrathod-blog/youtube_player_flutter
59+
60+
<p align="center">
61+
<img src="screenshots/1640179162978.png" width="30%">
62+
<img src="screenshots/1640179148024.png" width="30%">
63+
<img src="screenshots/1640179172631.png" width="30%">
64+
<img src="screenshots/1640179179700.png" width="30%">
65+
<img src="screenshots/1640179186128.png" width="30%">
66+
<img src="screenshots/1640179193240.png" width="30%">
67+
<img src="screenshots/1640179202803.png" width="30%">
68+
<img src="screenshots/1640179207829.png" width="30%">
69+
<img src="screenshots/1640179366140.png" width="30%">
70+
71+
</p>
72+
73+
## How to use
74+
75+
To clone and run this application, you'll need [Git](https://git-scm.com/downloads) and [Flutter](https://flutter.dev/docs/get-started/install) installed on your computer. From your command line:
76+
77+
```
78+
# Clone this repository
79+
$ git clone https://github.com/Appii00/Flutter-Bloc-MovieDB-App.git
80+
```
81+
82+
```
83+
# Go into the repository
84+
$ cd Flutter-Bloc-MovieDB-App
85+
```
86+
87+
```
88+
# Install dependencies
89+
$ flutter packages get
90+
```
91+
92+
```
93+
# Run the app
94+
$ flutter run
95+
```
96+
97+
This project is just for fun, but if you have any crazy idea for this app feel free to contribute, or create request for the features. Any contributions you make are greatly appreciated.
98+
99+
# Contact me
100+
101+
<a href="mailto: anshrathod29@gmail.com">
102+
<img src="https://img.shields.io/badge/Gmail-D14836?style=for-the-badge&logo=gmail&logoColor=white"/>
103+
</a>
104+
<a href="https://twitter.com/appiirathod">
105+
<img src="https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white"/>
106+
</a>
107+
<a href="https://www.linkedin.com/in/ansh-rathod-478a81210/">
108+
<img src="https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white"/>
109+
</a>

analysis_options.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at
17+
# https://dart-lang.github.io/linter/lints/index.html.
18+
#
19+
# Instead of disabling a lint rule for the entire project in the
20+
# section below, it can also be suppressed for a single line of code
21+
# or a specific dart file by using the `// ignore: name_of_lint` and
22+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23+
# producing the lint.
24+
rules:
25+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27+
28+
# Additional information about this file can be found at
29+
# https://dart.dev/guides/language/analysis-options

ios/Flutter/AppFrameworkInfo.plist

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>App</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>io.flutter.flutter.app</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>App</string>
15+
<key>CFBundlePackageType</key>
16+
<string>FMWK</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>1.0</string>
23+
<key>MinimumOSVersion</key>
24+
<string>9.0</string>
25+
</dict>
26+
</plist>

ios/Flutter/Debug.xcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "Generated.xcconfig"

ios/Flutter/Release.xcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "Generated.xcconfig"

lib/animation.dart

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
import 'dart:async';
2+
3+
import 'package:flutter/material.dart';
4+
5+
class DelayedDisplay extends StatefulWidget {
6+
final Widget child;
7+
final Duration delay;
8+
final Duration fadingDuration;
9+
final Curve slidingCurve;
10+
final Offset slidingBeginOffset;
11+
12+
final bool fadeIn;
13+
14+
const DelayedDisplay({
15+
Key? key,
16+
required this.child,
17+
this.delay = Duration.zero,
18+
this.fadingDuration = const Duration(milliseconds: 800),
19+
this.slidingCurve = Curves.decelerate,
20+
this.slidingBeginOffset = const Offset(0.0, 0.10),
21+
this.fadeIn = true,
22+
}) : super(key: key);
23+
24+
@override
25+
_DelayedDisplayState createState() => _DelayedDisplayState();
26+
}
27+
28+
class _DelayedDisplayState extends State<DelayedDisplay>
29+
with TickerProviderStateMixin {
30+
late AnimationController _opacityController;
31+
32+
late Animation<Offset> _slideAnimationOffset;
33+
34+
Timer? _timer;
35+
36+
Duration get delay => widget.delay;
37+
38+
Duration get opacityTransitionDuration => widget.fadingDuration;
39+
40+
Curve get slidingCurve => widget.slidingCurve;
41+
42+
Offset get beginOffset => widget.slidingBeginOffset;
43+
44+
bool get fadeIn => widget.fadeIn;
45+
46+
@override
47+
void initState() {
48+
super.initState();
49+
50+
_opacityController = AnimationController(
51+
vsync: this,
52+
duration: opacityTransitionDuration,
53+
);
54+
55+
final CurvedAnimation curvedAnimation = CurvedAnimation(
56+
curve: slidingCurve,
57+
parent: _opacityController,
58+
);
59+
60+
_slideAnimationOffset = Tween<Offset>(
61+
begin: beginOffset,
62+
end: Offset.zero,
63+
).animate(curvedAnimation);
64+
65+
_runFadeAnimation();
66+
}
67+
68+
@override
69+
void dispose() {
70+
_opacityController.dispose();
71+
_timer?.cancel();
72+
super.dispose();
73+
}
74+
75+
@override
76+
void didUpdateWidget(DelayedDisplay oldWidget) {
77+
super.didUpdateWidget(oldWidget);
78+
if (oldWidget.fadeIn == fadeIn) {
79+
return;
80+
}
81+
_runFadeAnimation();
82+
}
83+
84+
void _runFadeAnimation() {
85+
_timer = Timer(delay, () {
86+
fadeIn ? _opacityController.forward() : _opacityController.reverse();
87+
});
88+
}
89+
90+
@override
91+
Widget build(BuildContext context) {
92+
return SlideTransition(
93+
position: _slideAnimationOffset,
94+
child: widget.child,
95+
);
96+
}
97+
}
98+
99+
pushNewScreen(BuildContext context, Widget page) {
100+
Navigator.push(
101+
context,
102+
createRoute(page),
103+
);
104+
}
105+
106+
Route createRoute(Widget page) {
107+
return PageRouteBuilder(
108+
transitionDuration: const Duration(microseconds: 800),
109+
pageBuilder: (context, animation, secondaryAnimation) => page,
110+
transitionsBuilder: (context, animation, secondaryAnimation, child) {
111+
return SlideTransition(
112+
position: animation.drive(Tween<Offset>(
113+
begin: const Offset(1.0, 0.0),
114+
end: Offset.zero,
115+
)),
116+
child: child,
117+
);
118+
},
119+
);
120+
}

lib/api/key.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// ignore: constant_identifier_names
2+
const String BASE_URL = "https://mysterious-plateau-22499.herokuapp.com/api/v1";

lib/constants.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:google_fonts/google_fonts.dart';
3+
4+
const Color scaffoldColor = Colors.black;
5+
final TextStyle normalText = GoogleFonts.poppins(
6+
textStyle: const TextStyle(fontSize: 16, letterSpacing: 0.8));
7+
final TextStyle heading = GoogleFonts.poppins(
8+
textStyle: const TextStyle(
9+
fontWeight: FontWeight.bold,
10+
fontSize: 20,
11+
),
12+
);

lib/data/fetch_cast_details.dart

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import 'dart:convert';
2+
3+
import 'package:http/http.dart' as http;
4+
import '../api/key.dart';
5+
import '../models/cast_info_model.dart';
6+
import '../models/error_model.dart';
7+
import '../models/movie_model.dart';
8+
import '../models/tv_model.dart';
9+
10+
class FetchCastInfoById {
11+
Future<List<dynamic>> getCastDetails(String id) async {
12+
CastPersonalInfo prinfo;
13+
SocialMediaInfo socialMedia;
14+
ImageBackdropList backdrops;
15+
MovieModelList movies;
16+
TvModelList tv;
17+
var response = await http.get(Uri.parse('$BASE_URL/person/$id'));
18+
19+
if (response.statusCode == 200) {
20+
var data = jsonDecode(response.body);
21+
prinfo = CastPersonalInfo.fromJson(data['data']);
22+
socialMedia = SocialMediaInfo.fromJson(data['socialmedia']);
23+
backdrops = ImageBackdropList.fromJson(data['images']['profiles']);
24+
25+
movies = MovieModelList.fromJson(data['movies']['cast']);
26+
tv = TvModelList.fromJson(data['tv']['cast']);
27+
28+
return [
29+
prinfo,
30+
socialMedia,
31+
backdrops.backdrops,
32+
movies.movies,
33+
tv.movies,
34+
];
35+
} else {
36+
throw FetchDataError('Failure to fetch data');
37+
}
38+
}
39+
}

lib/data/fetch_genre_data.dart

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import 'dart:convert';
2+
3+
import 'package:http/http.dart' as http;
4+
5+
import '../api/key.dart';
6+
import '../models/error_model.dart';
7+
import '../models/movie_model.dart';
8+
import '../models/tv_model.dart';
9+
10+
class GenreResultsRepo {
11+
Future<List<dynamic>> getmovies(String query, int page) async {
12+
var res = await http.get(
13+
Uri.parse(BASE_URL + '/genre/movie?id=$query&page=${page.toString()}'));
14+
if (res.statusCode == 200) {
15+
return [
16+
(jsonDecode(res.body)['data'] as List)
17+
.map((list) => MovieModel.fromJson(list))
18+
.toList(),
19+
jsonDecode(res.body)['total_pages'],
20+
];
21+
} else {
22+
throw FetchDataError("Something went wrong!");
23+
}
24+
}
25+
26+
Future<List<dynamic>> gettvShows(String query, int page) async {
27+
var res = await http.get(
28+
Uri.parse(BASE_URL + '/genre/tv?id=$query&page=${page.toString()}'));
29+
if (res.statusCode == 200) {
30+
return [
31+
(jsonDecode(res.body)['data'] as List)
32+
.map((list) => TvModel.fromJson(list))
33+
.toList(),
34+
jsonDecode(res.body)['total_pages'],
35+
];
36+
} else {
37+
throw FetchDataError("Something went wrong!");
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)