Skip to content

Commit

Permalink
main: initial beta release
Browse files Browse the repository at this point in the history
Signed-off-by: Arjun-Ingole <arjuningole38@gmail.com>
  • Loading branch information
Arjun-Ingole committed May 21, 2023
1 parent 6cc5240 commit 374b59a
Show file tree
Hide file tree
Showing 24 changed files with 1,553 additions and 238 deletions.
25 changes: 25 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Osiris",
"request": "launch",
"type": "dart",
},
{
"name": "Osiris (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "Osiris (release mode)",
"request": "launch",
"type": "dart",
"flutterMode": "release"
}
]
}
Binary file removed assets/AuthDuck.gif
Binary file not shown.
1 change: 1 addition & 0 deletions assets/AuthDuck.json

Large diffs are not rendered by default.

Binary file removed assets/ErrorDuck.gif
Binary file not shown.
1 change: 1 addition & 0 deletions assets/ErrorDuck.json

Large diffs are not rendered by default.

Binary file removed assets/LoadingDuck.gif
Binary file not shown.
1 change: 1 addition & 0 deletions assets/LoadingDuck.json

Large diffs are not rendered by default.

Binary file added assets/profile_background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions lib/Screens/LoginScreen.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:gif_view/gif_view.dart';
import 'package:osiris/Services/auth.dart';
import 'package:osiris/Services/consts.dart';
import 'package:provider/provider.dart';
import 'package:lottie/lottie.dart';

class LoginScreen extends StatelessWidget {
const LoginScreen({super.key});
Expand All @@ -25,10 +25,10 @@ class LoginScreen extends StatelessWidget {
Container(
height: size.height * 0.3,
),
GifView.asset(
"assets/AuthDuck.gif",
Lottie.asset(
"assets/AuthDuck.json",
width: size.width * 0.60,
frameRate: 60,
frameRate: FrameRate(60),
),
Center(
child: Container(
Expand Down
70 changes: 46 additions & 24 deletions lib/Screens/MainScreen.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:osiris/Models/PopularMovies.dart';
import 'package:osiris/Models/TvShow.dart';
import 'package:osiris/Services/API.dart';
import 'package:osiris/Services/consts.dart';
import 'package:osiris/Widgets/BottomNavBar.dart';
Expand All @@ -19,9 +21,17 @@ class _MainScreenState extends State<MainScreen> {
ScrollController _scrollController = ScrollController();
bool isVisible = true;

late List<Results> popularMovie;
late List<Results> topRatedMovie;
late List<Results> nowPLayingMovie;
late List<TvShow> popularShows;
late List<TvShow> topRatedShows;
bool isLoading = true;

@override
void initState() {
super.initState();
fetchData();
_scrollController = ScrollController();
_scrollController.addListener(listen);
}
Expand Down Expand Up @@ -58,6 +68,17 @@ class _MainScreenState extends State<MainScreen> {
}
}

Future<void> fetchData() async {
topRatedShows = await APIService().getTopRatedShow();
popularMovie = await APIService().getPopularMovie();
topRatedMovie = await APIService().getTopRatedMovie();
popularShows = await APIService().getRecommendedTvShows("1396");
nowPLayingMovie = await APIService().getNowPLayingMovie();
setState(() {
isLoading = false;
});
}

Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
return Scaffold(
Expand All @@ -74,30 +95,31 @@ class _MainScreenState extends State<MainScreen> {
);
})),
extendBody: true,
body: Container(
height: size.height,
width: size.width,
color: background_primary,
child: ListView(
cacheExtent: 9999,
padding: EdgeInsets.zero,
scrollDirection: Axis.vertical,
physics: const BouncingScrollPhysics(),
controller: _scrollController,
shrinkWrap: true,
children: [
CustomCarouselSlider(APIService().getTopRatedShow()),
SectionText("Popular", "Movies"),
CustomListMovie(APIService().getPopularMovie()),
SectionText("TOP Rated", "Movies"),
CustomListMovie(APIService().getTopRatedMovie()),
SectionText("Popular", "Shows"),
CustomListTV(APIService().getPopularShow()),
SectionText("NoW PLAying", "Movies"),
CustomListMovie(APIService().getNowPLayingMovie()),
],
),
),
body: isLoading
? LoadingScreen()
: Container(
height: size.height,
width: size.width,
color: background_primary,
child: ListView(
padding: EdgeInsets.zero,
scrollDirection: Axis.vertical,
physics: const BouncingScrollPhysics(),
controller: _scrollController,
shrinkWrap: true,
children: [
CustomCarouselSlider(topRatedShows),
SectionText("Popular", "Movies"),
CustomListMovie(popularMovie),
SectionText("TOP Rated", "Movies"),
CustomListMovie(topRatedMovie),
SectionText("Popular", "Shows"),
CustomListTV(popularShows),
SectionText("NoW PLAying", "Movies"),
CustomListMovie(nowPLayingMovie),
],
),
),
);
}
}
219 changes: 217 additions & 2 deletions lib/Screens/MovieScreen.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,230 @@
import 'package:flutter/services.dart';
import 'package:intl/intl.dart';
import 'package:flutter/material.dart';
import 'package:osiris/Models/PopularMovies.dart';
import 'package:osiris/Services/API.dart';
import 'package:osiris/Services/consts.dart';
import 'package:osiris/Widgets/CustomLists.dart';
import 'package:osiris/Widgets/LoadingScreen.dart';
import 'package:unicons/unicons.dart';
import 'package:osiris/Services/extraServices.dart';
import 'package:osiris/Widgets/DetailScreenComponents.dart';

class MovieScreen extends StatefulWidget {
const MovieScreen({super.key});
MovieScreen(this.movieId, {super.key});
String movieId;

@override
State<MovieScreen> createState() => _MovieScreenState();
}

class _MovieScreenState extends State<MovieScreen> {
bool isLoading = true;
late List<Results> recommendedMovies;

Future<void> fetchData() async {
recommendedMovies = await APIService().getRecommendedMovie(widget.movieId);
setState(() {
isLoading = false;
});
}

@override
void initState() {
super.initState();
fetchData();
}

@override
Widget build(BuildContext context) {
return Container();
var size = MediaQuery.of(context).size;
return Scaffold(
backgroundColor: background_primary,
body: isLoading
? LoadingScreen()
: FutureBuilder(
future: APIService().getMovieDetail(widget.movieId),
builder: (context, AsyncSnapshot snapshot) {
if (snapshot.hasData) {
var status = snapshot.data!.status.toString();
var releaseDate = snapshot.data!.releaseDate.toString();
return ListView(
scrollDirection: Axis.vertical,
physics: const AlwaysScrollableScrollPhysics(
parent: BouncingScrollPhysics()),
padding: EdgeInsets.zero,
shrinkWrap: true,
children: [
Stack(
children: [
Container(
width: size.width,
height: size.height * 0.40 > 300
? size.height * 0.40
: 300,
decoration: BoxDecoration(
image: DecorationImage(
image: snapshot.data!.backdropPath == null
? const AssetImage(
"assets/LoadingImage.png")
as ImageProvider
: NetworkImage(
"https://image.tmdb.org/t/p/original${snapshot.data!.backdropPath}",
),
fit: BoxFit.cover,
),
),
),
Container(
width: size.width,
height: size.height * 0.40 > 300
? size.height * 0.40
: 300,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.transparent,
Colors.transparent,
background_primary.withOpacity(0.50),
background_primary.withOpacity(0.75),
background_primary.withOpacity(0.90),
background_primary.withOpacity(1.00),
]),
),
),
Container(
width: size.width,
height: size.height * 0.35 > 300
? size.height * 0.35
: 300,
margin: const EdgeInsets.all(8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
snapshot.data!.voteAverage
.toString()
.substring(0, 3),
style: const TextStyle(
fontSize: 40,
fontWeight: FontWeight.w500,
color: Colors.white),
),
Text(
snapshot.data!.title.toString(),
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: const TextStyle(
fontSize: 24,
fontWeight: FontWeight.w500,
color: Colors.white),
),
Row(
children: [
CircularButtons(
UniconsLine.play,
onTap: () {
HapticFeedback.lightImpact();
APIService()
.getTrailerLink(
snapshot.data!.id.toString(),
"movie")
.then(
(value) => LaunchUrl(value));
},
),
CircularButtons(
UniconsLine.plus,
onTap: () {
HapticFeedback.lightImpact();
pshowDialog(
context, widget.movieId, "movie");
},
),
Visibility(
visible: snapshot.data!.adult,
child: CircularButtons(
UniconsLine.eighteen_plus,
onTap: () {},
),
)
],
)
],
),
)
],
),
FutureBuilder(
future: APIService()
.getMovieGenres(widget.movieId, "movie"),
builder: (context, AsyncSnapshot snapshot) {
if (snapshot.hasData) {
return Container(
height: 36,
width: size.width,
margin: const EdgeInsets.only(left: 8),
child: ListView.builder(
scrollDirection: Axis.horizontal,
shrinkWrap: true,
physics: const BouncingScrollPhysics(),
itemCount: snapshot.data.length,
itemBuilder: (context, index) {
return TextContainer(
snapshot.data![index].name.toString(),
const EdgeInsets.only(right: 8),
const Color(0xFF14303B));
},
),
);
} else {
return TextContainer(
"Loading",
const EdgeInsets.all(8),
const Color(0xFF14303B));
}
},
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TitleText("Status"),
Row(
children: [
TextContainer(
status,
const EdgeInsets.only(
left: 8, right: 8, bottom: 8),
const Color(0xFF382E39)),
TextContainer(
"Release: ${DateFormat.yMMMMd().format(DateTime.parse(releaseDate))}",
const EdgeInsets.only(
left: 8, right: 8, bottom: 8),
const Color(0xFF545551)),
],
),
TitleText("Overview"),
TextContainer(
snapshot.data!.overview.toString().isEmpty ||
snapshot.data!.overview.toString() ==
"null"
? "No overview available"
: snapshot.data!.overview.toString(),
const EdgeInsets.all(8),
const Color(0xFF0F1D39)),
TitleText("Recommendations"),
CustomListMovie(recommendedMovies),
],
)
]);
} else {
return const LoadingScreen();
}
},
),
);
}
}
Loading

0 comments on commit 374b59a

Please sign in to comment.