Skip to content

Commit a9c73ff

Browse files
committed
Added description feature movieApp
1 parent 48c6498 commit a9c73ff

File tree

7 files changed

+285
-31
lines changed

7 files changed

+285
-31
lines changed

movie_app/lib/moviescreen.dart

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:firebase_auth/firebase_auth.dart';
22
import 'package:flutter/material.dart';
33
import 'package:flutter_dotenv/flutter_dotenv.dart';
44
import 'package:movie_app/screens/login.dart';
5+
import 'package:movie_app/screens/sidemenu.dart';
56
import 'package:movie_app/utils/text.dart';
67
import 'package:movie_app/widgets_ui/nowPlaying.dart';
78
import 'package:movie_app/widgets_ui/topRated.dart';
@@ -44,8 +45,8 @@ class _MoviescreenState extends State<Moviescreen> {
4445
topRatedMovies = topratedResults['results'];
4546
nowPlaying = nowResults['results'];
4647
});
47-
print(trendingMovies);
48-
print(nowPlaying);
48+
// print(trendingMovies);
49+
// print(nowPlaying);
4950
print(topRatedMovies);
5051
}
5152

@@ -54,13 +55,15 @@ class _MoviescreenState extends State<Moviescreen> {
5455
return Scaffold(
5556
backgroundColor: Color.fromARGB(255,30,38,50),
5657
appBar: AppBar(
57-
leading: IconButton(icon: Icon(Icons.logout_outlined), onPressed: ()async{
58-
await FirebaseAuth.instance.signOut().then((value) => {
59-
Navigator.push(context, MaterialPageRoute(builder: (context)=>LoginScreen() ))
60-
});
61-
}),
58+
// leading: IconButton(icon: Icon(Icons.logout_outlined), onPressed: ()async{
59+
// await FirebaseAuth.instance.signOut().then((value) => {
60+
// Navigator.push(context, MaterialPageRoute(builder: (context)=>LoginScreen() ))
61+
// });
62+
// }),
6263
backgroundColor: Colors.transparent,
63-
title: custom_text(text: 'Movie App'),),
64+
title: custom_text(text: 'Movie App'),
65+
),
66+
drawer: MenuDrawer(),
6467
body: ListView(
6568

6669
children: [
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:movie_app/utils/text.dart';
3+
4+
class Description extends StatelessWidget {
5+
final String? movieName,
6+
description,
7+
bannerurl,
8+
posterurl,
9+
releaseDate,
10+
votes;
11+
12+
const Description(
13+
{super.key,
14+
this.movieName,
15+
this.description,
16+
this.bannerurl,
17+
this.posterurl,
18+
this.releaseDate,
19+
this.votes});
20+
// const Description({Key? key}) : super(key: key);
21+
22+
@override
23+
Widget build(BuildContext context) {
24+
return Scaffold(
25+
backgroundColor: Colors.black,
26+
// appBar: AppBar(
27+
// backgroundColor: Colors.transparent.withOpacity(0.2),
28+
// elevation:0,
29+
// leading: IconButton(onPressed: (){
30+
// Navigator.of(context).pop(context);
31+
// }, icon: Icon(Icons.arrow_back_ios)),
32+
// ),
33+
body: Container(
34+
35+
child: ListView(children: [
36+
Container(
37+
height: 250,
38+
child: Stack(children: [
39+
Positioned(
40+
child: Container(
41+
height: 250,
42+
width: MediaQuery.of(context).size.width,
43+
child: Image.network(
44+
bannerurl!,
45+
fit: BoxFit.cover,
46+
),
47+
),
48+
),
49+
Positioned(child: IconButton(onPressed: (){
50+
Navigator.of(context).pop(context);
51+
}, icon: Icon(Icons.arrow_back_ios)),)
52+
])),
53+
// SizedBox(height: 15),
54+
Row(
55+
children: [
56+
Container(
57+
padding: EdgeInsets.all(10),
58+
59+
height: 220,
60+
width: 150,
61+
decoration: BoxDecoration(
62+
borderRadius: BorderRadius.circular(30)
63+
),
64+
child: Image.network(posterurl!,
65+
fit: BoxFit.contain,
66+
),
67+
),
68+
Flexible(child: Column(
69+
children: [
70+
Container(
71+
padding: EdgeInsets.all(10),
72+
child: Text(
73+
movieName != null ? movieName! : 'Not Loaded',
74+
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 24 ),
75+
)),
76+
Column(
77+
78+
children: [
79+
Container(
80+
padding: EdgeInsets.only(left: 10),
81+
child: custom_text(
82+
text: 'Release Date - ' + releaseDate!, size: 14),alignment: Alignment.topLeft),
83+
84+
SizedBox(height: 10,),
85+
Container(
86+
padding: EdgeInsets.only(left: 10),
87+
child: custom_text(text: 'Average Rating - ' + votes!), alignment: Alignment.topLeft),
88+
],
89+
),
90+
91+
],
92+
), )
93+
],
94+
),
95+
96+
Row(
97+
children: [
98+
// Container(
99+
// height: 200,
100+
// width: 100,
101+
// child: Image.network(posterurl!),
102+
// ),
103+
Flexible(
104+
child: Container(
105+
padding: EdgeInsets.all(10),
106+
child: Column(
107+
children: [
108+
Container(child: Text("Overview", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 24, )), alignment: Alignment.topLeft,),
109+
SizedBox(height:10),
110+
custom_text(text: description, size: 14),
111+
],
112+
)),
113+
),
114+
],
115+
)
116+
]),
117+
),
118+
);
119+
}
120+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import 'package:firebase_auth/firebase_auth.dart';
2+
import 'package:flutter/material.dart';
3+
4+
import 'login.dart';
5+
6+
class MenuDrawer extends StatelessWidget {
7+
const MenuDrawer({Key? key}) : super(key: key);
8+
9+
@override
10+
Widget build(BuildContext context) {
11+
return Drawer(
12+
child: Column(
13+
children: <Widget>[
14+
Container(
15+
width: MediaQuery.of(context).size.width,
16+
padding: EdgeInsets.all(30),
17+
color: Colors.cyan,
18+
child: Center(
19+
child: Column(
20+
children: [
21+
Container(
22+
width: 100,
23+
height: 100,
24+
margin: EdgeInsets.only(top: 40, bottom: 15),
25+
decoration: BoxDecoration(
26+
shape: BoxShape.circle,
27+
image: DecorationImage(
28+
image: NetworkImage("https://cdn-icons-png.flaticon.com/512/64/64572.png"),
29+
fit: BoxFit.fill),
30+
31+
),
32+
)
33+
],
34+
),
35+
),
36+
),
37+
ListTile(
38+
leading: Icon(Icons.person),
39+
title: Text('Profile',
40+
style: TextStyle(
41+
fontSize: 18
42+
),
43+
),
44+
),
45+
ListTile(
46+
leading: Icon(Icons.settings),
47+
title: Text('Settings',
48+
style: TextStyle(
49+
fontSize: 18
50+
),
51+
),
52+
),
53+
ListTile(
54+
leading: Icon(Icons.logout_rounded),
55+
title: Text('Sign Out',
56+
style: TextStyle(
57+
fontSize: 18
58+
),
59+
),
60+
onTap: ()async {
61+
await FirebaseAuth.instance.signOut().then((value) =>
62+
{
63+
Navigator.push(context,
64+
MaterialPageRoute(builder: (context) => LoginScreen()))
65+
});
66+
})
67+
],
68+
),
69+
);
70+
}
71+
}

movie_app/lib/utils/text.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class custom_text extends StatelessWidget {
1515
@override
1616
Widget build(BuildContext context) {
1717
return Text(
18-
text!, style: GoogleFonts.montserrat(
18+
text!, style: GoogleFonts.poppins(
1919
color: color, fontSize: size,
2020
),
2121
);

movie_app/lib/widgets_ui/nowPlaying.dart

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import 'package:flutter/material.dart';
22
import 'package:movie_app/utils/text.dart';
33

4+
import '../screens/description.dart';
5+
46
class NowPlaying extends StatelessWidget {
57

68
final List nowPlaying;
@@ -29,7 +31,24 @@ class NowPlaying extends StatelessWidget {
2931
itemBuilder: (context, index){
3032
return InkWell(
3133

32-
onTap: (){},
34+
onTap: (){
35+
Navigator.of(context).push(MaterialPageRoute(builder: (context)=>Description(
36+
movieName: nowPlaying[index]['title'],
37+
releaseDate: nowPlaying[index]
38+
['release_date'],
39+
votes: nowPlaying[index]['vote_average']
40+
.toString(),
41+
bannerurl:
42+
'https://image.tmdb.org/t/p/w500' +
43+
nowPlaying[index]['backdrop_path'],
44+
posterurl:
45+
'https://image.tmdb.org/t/p/w500' +
46+
nowPlaying[index]['poster_path'],
47+
description: nowPlaying[index]['overview'],
48+
49+
50+
)));
51+
},
3352
child: Container(
3453

3554
width: 155,

movie_app/lib/widgets_ui/topRated.dart

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import 'package:flutter/material.dart';
22
import 'package:movie_app/utils/text.dart';
33

4+
import '../screens/description.dart';
5+
46
class TopRatedMovies extends StatelessWidget {
57

68
final List topRated;
@@ -29,7 +31,24 @@ class TopRatedMovies extends StatelessWidget {
2931
itemBuilder: (context, index){
3032
return InkWell(
3133

32-
onTap: (){},
34+
onTap: (){
35+
Navigator.of(context).push(MaterialPageRoute(builder: (context)=>Description(
36+
movieName: topRated[index]['title'],
37+
releaseDate: topRated[index]
38+
['release_date'],
39+
votes: topRated[index]['vote_average']
40+
.toString(),
41+
bannerurl:
42+
'https://image.tmdb.org/t/p/w500' +
43+
topRated[index]['backdrop_path'],
44+
posterurl:
45+
'https://image.tmdb.org/t/p/w500' +
46+
topRated[index]['poster_path'],
47+
description: topRated[index]['overview'],
48+
49+
50+
)));
51+
},
3352
child: Container(
3453

3554
width: 155,

0 commit comments

Comments
 (0)