For this tutorial, we will need some package that we will add to our pubspec.yaml file
carousel_slider: ^2.3.1
Source Code
for this project, we will create some custom widget in a separate file, so I advise you to create a new folder and call it components inside your lib folder.
import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/material.dart';
import 'package:netflix_clone_tut/components/list_item.dart';
import 'package:netflix_clone_tut/components/slider_item.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: NetflixApp(),
);
}
}
class NetflixApp extends StatefulWidget {
@override
_NetflixAppState createState() => _NetflixAppState();
}
class _NetflixAppState extends State<NetflixApp> {
//Here I'm going to place some dummy data for our movie images url and movie's titles
//You can found all then links and the source code in the link bellow in the description
//don't forget to subscribe
List<String> movieCarousselUrl = [
"https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcRbSLCEqIGEAzHkwd7SWUpIuJ4knEYcBx-wxg&usqp=CAU",
"https://uhdwallpapers.org/uploads/converted/19/09/21/joker-4k-poster-1600x900_666674-mm-90.jpg",
"https://financerewind.com/wp-content/uploads/2020/07/cursed-season-2-netflix-renewal-status-1200x675.png",
"https://miro.medium.com/max/2800/0*6dysw-Riawp4PO6u",
];
List<String> movieTitle = [
"Star Wars the Jedi Return",
"JOKER",
"Cursed",
"Kimetsu no yaiba : Mugen Train"
];
List<String> movieImageUrl = [
"https://lumiere-a.akamaihd.net/v1/images/p_mulan2020_20204_b005decc.jpeg?region=0,0,540,810",
"https://upload.wikimedia.org/wikipedia/en/2/21/Kimetsu_no_Yaiba_Mugen_Ressha_Hen_Poster.jpg",
"https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSa4t8Yz7dxTAWBZtbNhmpEYepiV_Yw8KMRf69NyjtPqbPm-LPr",
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcROKKn9ftbhxcRQf0NSSW4YfXPex6eyY95FrhEfU7OoTiDYRpky",
"https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTkZO-tgLmMFndFVdrFSetlssgOYf4M_i1kSfZ62vJRuBCtShRc",
];
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFF121212),
appBar: AppBar(
backgroundColor: Color(0xff212121),
centerTitle: true,
title: Text("Netflix",
style: TextStyle(
color: Colors.red,
)),
leading: IconButton(
onPressed: () {},
icon: Icon(Icons.menu),
),
actions: [
IconButton(
onPressed: () {},
icon: Icon(
Icons.search,
)),
],
),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
//let's start by building our carousel slider
children: [
Text(
"Recent Movie & Series",
style: TextStyle(
color: Colors.white,
fontSize: 24.0,
fontWeight: FontWeight.w500,
),
),
SizedBox(
height: 12.0,
),
CarouselSlider(
options: CarouselOptions(
enableInfiniteScroll: false,
aspectRatio: 16 / 9,
viewportFraction: 0.9,
height: 280.0,
enlargeCenterPage: true,
),
items: [
sliderItem(movieCarousselUrl[0], movieTitle[0]),
sliderItem(movieCarousselUrl[1], movieTitle[1]),
sliderItem(movieCarousselUrl[2], movieTitle[2]),
sliderItem(movieCarousselUrl[3], movieTitle[3]),
],
),
Text("Recomendation",
style: TextStyle(
color: Colors.white,
fontSize: 22.0,
fontWeight: FontWeight.w600,
)),
SizedBox(
height: 10.0,
),
Container(
height: 360.0,
width: double.infinity,
child: ListView(
scrollDirection: Axis.horizontal,
children: [
//let's create a new custom widget for our list item
listItem(movieImageUrl[0], "Mulan"),
listItem(movieImageUrl[1], "Demon Slyaer Infinite Train"),
listItem(movieImageUrl[2], "Ragnarok"),
listItem(movieImageUrl[3], "The Letter for the King"),
],
),
),
],
),
),
),
//Now let's create our bottom navigation menu
bottomNavigationBar: BottomNavigationBar(
selectedItemColor: Colors.red,
unselectedItemColor: Colors.white,
items: [
BottomNavigationBarItem(
backgroundColor: Color(0xff212121),
title: Text("Home"),
icon: Icon(Icons.home),
),
BottomNavigationBarItem(
title: Text("Downloaded"),
icon: Icon(Icons.file_download),
),
BottomNavigationBarItem(
title: Text("PlayList"),
icon: Icon(Icons.playlist_play),
),
BottomNavigationBarItem(
title: Text("account"),
icon: Icon(Icons.person),
),
],
),
);
}
}
slider_item.dart
import 'package:flutter/material.dart';
Widget sliderItem(String img, String movieName) {
return Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 200.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
image: DecorationImage(
image: NetworkImage(img),
fit: BoxFit.cover,
),
),
),
SizedBox(
height: 15.0,
),
Text(
movieName,
style: TextStyle(
color: Colors.white,
fontSize: 22.0,
fontWeight: FontWeight.w500,
),
),
],
),
);
}
list_item.dart
import 'package:flutter/material.dart';
Widget listItem(String img, String movieName) {
return Container(
margin: EdgeInsets.only(right: 12.0),
width: 180.0,
height: 300.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 280.0,
width: 180.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.0),
image: DecorationImage(
image: NetworkImage(img),
fit: BoxFit.cover,
)),
),
SizedBox(
height: 10.0,
),
Text(
movieName,
style: TextStyle(
color: Colors.white,
fontSize: 24.0,
),
),
],
),
);
}
Make a Netflix UI Clone Using Flutter
Reviewed by Medics
on
November 01, 2020
Rating:
ReplyDeleteWhat a piece of amazing and meaningful information you have written on Build an App Like Uber. I appreciate you and your precious time that you devoted to this blog. Additionally, I also want to clear some more doubts about Food Delivery App Development Companies in USA. Normally i don't leave comments on blogs, but i can't stop myself here to write a few words for you.
Once again you provide several doses of reality which explore the complete explanation of packing and moving companies in Bangalore . This article don't have to be that long. I simply couldn't leave your web site before suggesting that I actually loved the usual info on packing and movers services in Bangalore. I just want to know what is the best way to get real service.
ReplyDeleteThanks for this great and useful information. RisingMax is one of the leading IT consulting companies in NYC offering 7 phases of the System Development Life Cycle, and information about software development cost breakdown all over the world. Reduce your cost by up to 55-65% by outsourcing your software development with us.
ReplyDeleteI really appreciate everything that you wrote in this content! Play Now is a Netflix clone app that will guide you through the process of launching your own video streaming platform. Play Now is a comprehensive Netflix clone app development with a feature-rich and scalable website and mobile apps. capitalize on is a similar-to-Netflix video-on-demand service.
ReplyDeleteAnother great post on Blogspot.com. Thanks a lot, man!!!! All the tips given by you are extremely useful when it comes to blogging. I agree with you that not being able to write regularly is not a big problem. We're doing the same thing, and you can check out our blog to see what we're doing. Brief description of Slack Native App. I need to try new things and learn. Anyway, that was a great post; keep doing good work. Best wishes
ReplyDeleteThanks for your Blog, I Need Blogs on Premium social media apps. I also want to publish blog on same niche..and Explore More Ideas about How To Create A Subscription Based App. I have some Techniques to explore my ideas to be challenged. its best way to learn and grow.But saying all that I think it is considerably easier to engage commenters nowdays than when I firts started blogging. From this thing we will get some ideas on social media app. lets start blogging again and explore more How Did Netflix Improve Its Recommendation System Using Data Science.
ReplyDeleteThank you for all the hard work and effort you put into this blog. Netflix improves the recommendation system by using data science to provide you with relevant data. By using the Netflix clone app it grows its business and generates revenue. This is really a good article to guide the freshers who want to make a career in App Development. Thanks for this.
ReplyDeleteI love this blog ,this is very useful for us .
ReplyDeleteI have also some topics that will helpful for your blogs.
I can say that this blog is refective but also rxloring new techniques.Most of the user search query on google Netflix App So Important For Your Business I think this is also can be consideration. if we just want to start blogging on Budget friendly cab booking software.
so we are right track.
Great Read I love this Article especially like the content that you have shared I remembered the things that you covered last article
ReplyDeleteso I am also sharing some topics that are relevant to your blog
we covered topics like With a Netflix clone script, Enter the OTT space and Trends to Watch in Food Industry 2022
corona labs in north delhi
ReplyDeleteHi, I was wondering, how I can't use title in
ReplyDeleteBottomNavigationBarItem(
title: Text("account"),
icon: Icon(Icons.person),
),
it always shows an error, and untill now, I can't figure it out.
can you help me?
The blog post is fantastic. I'm blown away by the quality of the material and content on this blog. With the on-demand food delivery app development and services gaining momentum, you have to inject the digital adrenaline to put your business on the fast forward moving scale.
ReplyDelete