Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
Movie-app
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dio Maulana
Movie-app
Commits
3236cc49
Commit
3236cc49
authored
Feb 17, 2022
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
final
parent
60d56b7e
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
289 additions
and
123 deletions
+289
-123
AndroidManifest.xml
android/app/src/main/AndroidManifest.xml
+4
-1
apiMovie.dart
lib/apiMovie.dart
+100
-35
main.dart
lib/main.dart
+2
-0
movie_detail_api.dart
lib/models/movie_detail_api.dart
+16
-8
populars.dart
lib/models/populars.dart
+20
-0
post_rate_model.dart
lib/models/post_rate_model.dart
+3
-0
upComings.dart
lib/models/upComings.dart
+20
-0
main_page.dart
lib/pages/main_page.dart
+67
-37
movie_detail.dart
lib/pages/movie_detail.dart
+57
-42
No files found.
android/app/src/main/AndroidManifest.xml
View file @
3236cc49
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.example.movie_app"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<application
android:label=
"movie_app"
android:name=
"${applicationName}"
android:icon=
"@mipmap/ic_launcher"
>
android:icon=
"@mipmap/ic_launcher"
android:usesCleartextTraffic=
"true"
>
<activity
android:name=
".MainActivity"
android:exported=
"true"
...
...
lib/apiMovie.dart
View file @
3236cc49
...
...
@@ -3,20 +3,24 @@ import 'dart:convert';
import
'dart:async'
;
import
'package:movie_app/config.dart'
;
import
'package:movie_app/models/movie_detail_api.dart'
;
import
'package:movie_app/models/populars.dart'
;
import
'package:movie_app/models/post_rate_model.dart'
;
import
'package:movie_app/models/upComings.dart'
;
class
ApiPopular
{
final
String
vote_average
;
final
String
title
;
final
String
poster_path
;
final
String
id
;
ApiPopular
(
this
.
vote_average
,
this
.
title
,
this
.
poster_path
,
this
.
id
);
factory
ApiPopular
.
createPopular
(
Map
<
String
,
dynamic
>
json
)
{
return
ApiPopular
(
json
[
'vote_average'
].
toString
(),
json
[
'title'
],
json
[
'poster_path'
],
json
[
'id'
].
toString
());
class
Api
{
static
Future
<
movieDetail
>
getDetail
(
String
movieId
)
async
{
var
apiUrl
=
"https://api.themoviedb.org/3/movie/"
+
movieId
+
"?api_key="
+
apiKey
+
"&language=en-US"
;
var
response
=
await
http
.
get
(
Uri
.
parse
(
apiUrl
));
var
json
=
jsonDecode
(
response
.
body
);
return
movieDetail
.
fromJson
(
json
);
}
static
Future
<
List
<
ApiPopular
>>
getPopular
()
async
{
static
Future
<
List
<
Popular
>>
getPopular
()
async
{
String
apiUrl
=
"https://api.themoviedb.org/3/movie/popular?api_key="
+
apiKey
+
"&language=en-US&page=1"
;
...
...
@@ -25,40 +29,101 @@ class ApiPopular {
List
<
dynamic
>
listPopular
=
(
jsonObject
as
Map
<
String
,
dynamic
>)[
'results'
];
List
<
Api
Popular
>
populars
=
[];
List
<
Popular
>
populars
=
[];
for
(
int
i
=
0
;
i
<
listPopular
.
length
;
i
++)
populars
.
add
(
ApiPopular
.
createPopular
(
listPopular
[
i
]));
populars
.
add
(
Popular
.
createPopularComing
(
listPopular
[
i
]));
return
populars
;
}
}
class
ApiUpComing
{
final
String
vote_average
;
final
String
title
;
final
String
poster_path
;
final
String
id
;
ApiUpComing
(
this
.
vote_average
,
this
.
title
,
this
.
poster_path
,
this
.
id
);
factory
ApiUpComing
.
createUpComing
(
Map
<
String
,
dynamic
>
json
)
{
return
ApiUpComing
(
json
[
'vote_average'
].
toString
(),
json
[
'title'
],
json
[
'poster_path'
],
json
[
'id'
].
toString
());
}
static
Future
<
List
<
ApiUpComing
>>
getUpcoming
()
async
{
static
Future
<
List
<
Coming
>>
getComing
()
async
{
String
apiUrl
=
"https://api.themoviedb.org/3/movie/upcoming?api_key="
+
apiKey
+
"&language=en-US&page=1"
;
var
apiResult
=
await
http
.
get
(
Uri
.
parse
(
apiUrl
));
var
jsonObject
=
json
.
decode
(
apiResult
.
body
);
List
<
dynamic
>
listUpComing
=
(
jsonObject
as
Map
<
String
,
dynamic
>)[
'results'
];
List
<
dynamic
>
listPopular
=
(
jsonObject
as
Map
<
String
,
dynamic
>)[
'results'
];
List
<
Coming
>
populars
=
[];
for
(
int
i
=
0
;
i
<
listPopular
.
length
;
i
++)
{
populars
.
add
(
Coming
.
createComing
(
listPopular
[
i
]));
}
print
(
populars
);
return
populars
;
}
static
Future
<
PostRateResult
>
postReview
(
String
movieId
,
double
rating
)
async
{
String
apiUrl
=
"https://api.themoviedb.org/3/movie/"
+
movieId
+
"/rating?api_key="
+
apiKey
;
var
apiResult
=
await
http
.
post
(
Uri
.
parse
(
apiUrl
),
body:
{
"value"
:
rating
.
toString
(),
"guest_session_id"
:
"aa9837cfeac9f0f53b69d75fd11a001e"
});
var
jsonObject
=
json
.
decode
(
apiResult
.
body
);
List
<
ApiUpComing
>
upcomings
=
[];
for
(
int
i
=
0
;
i
<
listUpComing
.
length
;
i
++)
upcomings
.
add
(
ApiUpComing
.
createUpComing
(
listUpComing
[
i
]));
print
(
upcomings
);
return
upcomings
;
return
PostRateResult
.
fromJson
(
jsonObject
);
}
}
// class ApiPopular {
// final String vote_average;
// final String title;
// final String poster_path;
// final String id;
// ApiPopular(this.vote_average, this.title, this.poster_path, this.id);
// factory ApiPopular.createPopular(Map<String, dynamic> json) {
// return ApiPopular(json['vote_average'].toString(), json['title'],
// json['poster_path'], json['id'].toString());
// }
// static Future<List<ApiPopular>> getPopular() async {
// String apiUrl = "https://api.themoviedb.org/3/movie/popular?api_key=" +
// apiKey +
// "&language=en-US&page=1";
// var apiResult = await http.get(Uri.parse(apiUrl));
// var jsonObject = json.decode(apiResult.body);
// List<dynamic> listPopular = (jsonObject as Map<String, dynamic>)['results'];
// List<ApiPopular> populars = [];
// for (int i = 0; i < listPopular.length; i++)
// populars.add(ApiPopular.createPopular(listPopular[i]));
// return populars;
// }
// }
// class ApiUpComing {
// final String vote_average;
// final String title;
// final String poster_path;
// final String id;
// ApiUpComing(this.vote_average, this.title, this.poster_path, this.id);
// factory ApiUpComing.createUpComing(Map<String, dynamic> json) {
// return ApiUpComing(json['vote_average'].toString(), json['title'],
// json['poster_path'], json['id'].toString());
// }
// static Future<List<ApiUpComing>> getUpcoming() async {
// String apiUrl = "https://api.themoviedb.org/3/movie/upcoming?api_key=" +
// apiKey +
// "&language=en-US&page=1";
// var apiResult = await http.get(Uri.parse(apiUrl));
// var jsonObject = json.decode(apiResult.body);
// List<dynamic> listUpComing =
// (jsonObject as Map<String, dynamic>)['results'];
// List<ApiUpComing> upcomings = [];
// for (int i = 0; i < listUpComing.length; i++)
// upcomings.add(ApiUpComing.createUpComing(listUpComing[i]));
// print(upcomings);
// return upcomings;
// }
// }
lib/main.dart
View file @
3236cc49
import
'package:flutter/material.dart'
;
import
'package:movie_app/pages/account.dart'
;
import
'package:movie_app/pages/home.dart'
;
import
'package:movie_app/pages/main_page.dart'
;
import
'package:movie_app/pages/movie_detail.dart'
;
...
...
@@ -37,6 +38,7 @@ class _MyAppState extends State<MyApp> {
'/detail'
:
(
context
)
=>
detailMovie
(
// ModalRoute.of(context)!.settings.arguments as ScreenArguments),
ModalRoute
.
of
(
context
)!.
settings
.
arguments
as
String
),
'/account'
:
(
context
)
=>
AccountPage
(),
},
);
}
...
...
lib/models/movie_detail_api.dart
View file @
3236cc49
class
movieDetail
{
final
String
id
;
final
String
title
;
final
String
poster_path
;
final
String
overview
;
final
double
vote_average
;
List
<
dynamic
>
genre
=
[]
;
List
<
dynamic
>
genre
;
movieDetail
(
this
.
title
,
this
.
poster_path
,
this
.
overview
,
this
.
vote_average
,
this
.
genre
);
movieDetail
(
{
required
this
.
id
,
required
this
.
title
,
required
this
.
poster_path
,
required
this
.
overview
,
required
this
.
vote_average
,
required
this
.
genre
});
factory
movieDetail
.
fromJson
(
dynamic
json
)
{
var
nameGenre
=
[];
for
(
int
i
=
0
;
i
<
json
[
'genres'
].
length
;
i
++)
{
var
genreName
=
''
;
if
(
json
[
'genres'
][
i
][
'name'
]
==
null
)
{
...
...
@@ -20,10 +27,11 @@ class movieDetail {
nameGenre
.
add
(
genreName
);
}
return
movieDetail
(
json
[
'title'
]
as
String
,
json
[
'poster_path'
]
as
String
,
json
[
'overview'
]
as
String
,
json
[
'vote_average'
]
as
double
,
nameGenre
as
List
<
dynamic
>);
id:
json
[
'id'
].
toString
(),
title:
json
[
'title'
]
as
String
,
poster_path:
json
[
'poster_path'
]
as
String
,
overview:
json
[
'overview'
]
as
String
,
vote_average:
json
[
'vote_average'
]
as
double
,
genre:
nameGenre
as
List
<
dynamic
>);
}
}
lib/models/populars.dart
0 → 100644
View file @
3236cc49
class
Popular
{
final
String
id
;
final
String
vote_average
;
final
String
title
;
final
String
poster_path
;
Popular
(
{
required
this
.
id
,
required
this
.
vote_average
,
required
this
.
title
,
required
this
.
poster_path
});
factory
Popular
.
createPopularComing
(
Map
<
String
,
dynamic
>
json
)
{
return
Popular
(
id:
json
[
'id'
].
toString
(),
vote_average:
json
[
'vote_average'
].
toString
(),
title:
json
[
'title'
],
poster_path:
json
[
'poster_path'
]);
}
}
lib/models/post_rate_model.dart
View file @
3236cc49
import
'dart:convert'
;
import
'package:http/http.dart'
as
http
;
import
'package:movie_app/config.dart'
;
class
PostRateResult
{
final
int
status_code
;
...
...
lib/models/upComings.dart
0 → 100644
View file @
3236cc49
class
Coming
{
final
String
id
;
final
String
vote_average
;
final
String
title
;
final
String
poster_path
;
Coming
(
{
required
this
.
id
,
required
this
.
vote_average
,
required
this
.
title
,
required
this
.
poster_path
});
factory
Coming
.
createComing
(
Map
<
String
,
dynamic
>
json
)
{
return
Coming
(
id:
json
[
'id'
].
toString
(),
vote_average:
json
[
'vote_average'
].
toString
(),
title:
json
[
'title'
],
poster_path:
json
[
'poster_path'
]);
}
}
lib/pages/main_page.dart
View file @
3236cc49
...
...
@@ -19,7 +19,10 @@ class _MainPagesState extends State<MainPages> {
var
_populars
=
[];
var
_upComing
=
[];
bool
isLoading
=
true
;
var
nowDate
=
DateTime
.
now
().
toUtc
();
bool
isLoadingPopular
=
true
;
bool
isLoadingComing
=
true
;
// void getPopularData(String apiKey) async {
// var response = await http.get(Uri.parse(
...
...
@@ -36,39 +39,58 @@ class _MainPagesState extends State<MainPages> {
// }
void
getPopular
()
async
{
var
apiPopular
=
await
ApiPopular
.
getPopular
();
// var apiUpComing = await ApiUpComing.getUpcoming();
var
apiPopular
=
await
Api
.
getPopular
();
setState
(()
{
isLoadingPopular
=
false
;
_populars
=
apiPopular
;
// _upComing = apiUpComing;
});
}
void
getUpComingData
(
String
apiKey
)
async
{
var
response
=
await
http
.
get
(
Uri
.
parse
(
"https://api.themoviedb.org/3/movie/upcoming?api_key="
+
apiKey
+
"&language=en-US&page=1"
));
var
jsonObject
=
jsonDecode
(
response
.
body
);
List
<
dynamic
>
listUpComing
=
(
jsonObject
as
Map
<
String
,
dynamic
>)[
'results'
];
void
getComing
()
async
{
var
apiUpComing
=
await
Api
.
getComing
();
setState
(()
{
_upComing
=
listUpComing
;
isLoading
=
false
;
isLoadingComing
=
false
;
_upComing
=
apiUpComing
;
});
}
// void getComings() async {
// // var apiPopular = await Api.getPopular();
// var apiUpComing = await Api.getComing();
// setState(() {
// // _populars = apiPopular;
// isLoading = false;
// _upComing = apiUpComing;
// });
// }
// void getUpComingData(String apiKey) async {
// var response = await http.get(Uri.parse(
// "https://api.themoviedb.org/3/movie/upcoming?api_key=" +
// apiKey +
// "&language=en-US&page=1"));
// var jsonObject = jsonDecode(response.body);
// List<dynamic> listUpComing =
// (jsonObject as Map<String, dynamic>)['results'];
// setState(() {
// _upComing = listUpComing;
// isLoading = false;
// });
// }
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
getPopular
();
getUpComingData
(
apiKey
);
getComing
();
// getUpComingData(apiKey);
}
@override
Widget
build
(
BuildContext
context
)
{
print
(
nowDate
);
return
Scaffold
(
backgroundColor:
backgroundColor
,
body:
Stack
(
...
...
@@ -80,7 +102,7 @@ class _MainPagesState extends State<MainPages> {
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
const
Text
(
"Hi, Dio Maulana"
,
style:
TextStyle
(
color:
textColor
,
...
...
@@ -88,11 +110,19 @@ class _MainPagesState extends State<MainPages> {
fontWeight:
FontWeight
.
w800
),
),
ClipRRect
(
child:
Icon
(
child:
GestureDetector
(
onTap:
()
{
Navigator
.
pushNamed
(
context
,
'/account'
,
);
},
child:
const
Icon
(
Icons
.
person
,
color:
textColor
,
size:
30
,
),
),
)
],
),
...
...
@@ -108,8 +138,8 @@ class _MainPagesState extends State<MainPages> {
padding:
EdgeInsets
.
fromLTRB
(
10
,
5
,
5
,
5
),
// ignore: prefer_const_constructors
child:
TextField
(
style:
TextStyle
(
color:
textColor
),
decoration:
InputDecoration
(
style:
const
TextStyle
(
color:
textColor
),
decoration:
const
InputDecoration
(
border:
InputBorder
.
none
,
icon:
Icon
(
Icons
.
search
,
...
...
@@ -123,7 +153,7 @@ class _MainPagesState extends State<MainPages> {
Container
(
margin:
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
child:
Row
(
children:
[
children:
const
[
Text
(
"Popular"
,
style:
titleText
,
...
...
@@ -133,7 +163,7 @@ class _MainPagesState extends State<MainPages> {
],
),
),
isLoading
isLoading
Popular
?
Container
(
margin:
defaultCardPading
,
height:
400
,
...
...
@@ -169,7 +199,7 @@ class _MainPagesState extends State<MainPages> {
Container
(
margin:
defaultCardPading
,
child:
Row
(
children:
[
children:
const
[
Text
(
"Up coming"
,
style:
titleText
,
...
...
@@ -182,7 +212,7 @@ class _MainPagesState extends State<MainPages> {
],
),
),
isLoading
isLoading
Coming
?
Container
(
margin:
defaultCardPading
,
height:
400
,
...
...
@@ -208,10 +238,10 @@ class _MainPagesState extends State<MainPages> {
popularCard
(
context
,
"https://image.tmdb.org/t/p/w500"
+
_upComing
[
i
]
[
'poster_path'
]
,
_upComing
[
i
]
[
'title'
]
,
_upComing
[
i
]
[
'vote_average'
]
.
toString
(),
_upComing
[
i
]
[
'id'
]
.
toString
()),
_upComing
[
i
]
.
poster_path
,
_upComing
[
i
]
.
title
,
_upComing
[
i
]
.
vote_average
.
toString
(),
_upComing
[
i
]
.
id
.
toString
()),
],
),
),
...
...
@@ -278,7 +308,7 @@ class _MainPagesState extends State<MainPages> {
),
),
),
SizedBox
(
const
SizedBox
(
height:
10
,
),
Container
(
...
...
@@ -287,14 +317,14 @@ class _MainPagesState extends State<MainPages> {
title
,
textAlign:
TextAlign
.
center
,
maxLines:
1
,
style:
TextStyle
(
style:
const
TextStyle
(
fontSize:
14
,
color:
Colors
.
white
,
fontWeight:
FontWeight
.
w900
,
overflow:
TextOverflow
.
ellipsis
),
),
),
SizedBox
(
const
SizedBox
(
height:
5
,
),
Row
(
...
...
@@ -303,15 +333,15 @@ class _MainPagesState extends State<MainPages> {
rating
,
maxLines:
1
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
style:
const
TextStyle
(
color:
Colors
.
grey
,
fontSize:
12
,
fontWeight:
FontWeight
.
w500
),
),
SizedBox
(
const
SizedBox
(
width:
5
,
),
Icon
(
const
Icon
(
Icons
.
star
,
color:
Colors
.
yellow
,
size:
14
,
...
...
lib/pages/movie_detail.dart
View file @
3236cc49
...
...
@@ -3,6 +3,7 @@ import 'dart:async';
import
'package:flutter/material.dart'
;
import
'package:flutter_rating_bar/flutter_rating_bar.dart'
;
import
'package:movie_app/apiMovie.dart'
;
import
'package:movie_app/config.dart'
;
import
'package:http/http.dart'
as
http
;
...
...
@@ -23,26 +24,35 @@ class _detailMovieState extends State<detailMovie> {
double
rating
=
0
;
movieDetail
?
_movieDetail
;
PostRateResult
?
_postRateResult
;
void
postRate
(
double
rating
,
String
apiKey
,
String
movieId
)
async
{
var
response
=
await
http
.
post
(
Uri
.
parse
(
"https://api.themoviedb.org/3/movie/"
+
movieId
+
"/rating?api_key="
+
apiKey
),
body:
{
"value"
:
rating
.
toString
(),
"guest_session_id"
:
"aa9837cfeac9f0f53b69d75fd11a001e"
});
var
json
=
jsonDecode
(
response
.
body
);
void
postRate
(
double
rating
,
String
movieId
)
async
{
var
postReview
=
await
Api
.
postReview
(
movieId
,
rating
);
setState
(()
{
_postRateResult
=
PostRateResult
.
fromJson
(
json
)
;
_postRateResult
=
postReview
;
});
var
status_code
=
_postRateResult
==
null
?
''
:
_postRateResult
!.
status_code
.
toString
();
var
message
=
''
;
if
(
status_code
==
"1"
)
{
if
(
rating
==
10.0
)
{
message
=
"Wow!! kamu memberikan nilai sempurna ^.^"
;
}
else
{
message
=
"Kamu memberikan "
+
rating
.
toString
()
+
" bintang"
;
}
}
else
if
(
status_code
==
'12'
)
{
if
(
rating
==
10.0
)
{
message
=
"Wow!! kamu memberikan nilai update sempurna ^.^"
;
}
else
{
message
=
"Kamu update rating menjadi "
+
rating
.
toString
()
+
" bintang"
;
}
}
else
{
message
=
"Something went error"
;
}
final
snackBar
=
SnackBar
(
backgroundColor:
backgroundColor
,
content:
Text
(
_postRateResult
==
null
?
''
:
_postRateResult
!.
status_
message
,
style:
TextStyle
(
message
,
style:
const
TextStyle
(
color:
textColor
,
fontSize:
15
,
fontWeight:
FontWeight
.
w800
),
),
duration:
Duration
(
seconds:
2
),
...
...
@@ -50,17 +60,19 @@ class _detailMovieState extends State<detailMovie> {
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
snackBar
);
}
void
getDetailMovie
(
String
apiKey
,
String
movieId
)
async
{
var
response
=
await
http
.
get
(
Uri
.
parse
(
"https://api.themoviedb.org/3/movie/"
+
movieId
+
"?api_key="
+
apiKey
+
"&language=en-US"
));
var
json
=
jsonDecode
(
response
.
body
);
void
getDetailMovie
(
String
movieId
)
async
{
// var response = await http.get(Uri.parse(
// "https://api.themoviedb.org/3/movie/" +
// movieId +
// "?api_key=" +
// apiKey +
// "&language=en-US"));
// var json = jsonDecode(response.body);
var
response
=
await
Api
.
getDetail
(
movieId
);
setState
(()
{
_movieDetail
=
movieDetail
.
fromJson
(
json
)
;
_movieDetail
=
response
;
});
}
...
...
@@ -68,7 +80,7 @@ class _detailMovieState extends State<detailMovie> {
void
initState
()
{
// TODO: implement initState
super
.
initState
();
getDetailMovie
(
apiKey
,
widget
.
id
);
getDetailMovie
(
widget
.
id
);
}
@override
...
...
@@ -91,19 +103,19 @@ class _detailMovieState extends State<detailMovie> {
context
,
);
},
child:
Icon
(
child:
const
Icon
(
Icons
.
arrow_back_ios_new
,
color:
textColor
,
),
),
Text
(
const
Text
(
"Detail Movies"
,
style:
TextStyle
(
color:
textColor
,
fontSize:
20
,
fontWeight:
FontWeight
.
w800
),
),
Icon
(
const
Icon
(
Icons
.
bookmark_border_outlined
,
color:
textColor
,
),
...
...
@@ -124,7 +136,7 @@ class _detailMovieState extends State<detailMovie> {
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
40
),
child:
_movieDetail
==
null
?
SizedBox
(
?
const
SizedBox
(
width:
10
,
)
:
Image
(
...
...
@@ -147,7 +159,7 @@ class _detailMovieState extends State<detailMovie> {
child:
Text
(
_movieDetail
==
null
?
''
:
_movieDetail
!.
title
,
textAlign:
TextAlign
.
start
,
style:
TextStyle
(
style:
const
TextStyle
(
fontSize:
25
,
fontWeight:
FontWeight
.
w700
,
color:
textColor
),
...
...
@@ -157,7 +169,7 @@ class _detailMovieState extends State<detailMovie> {
margin:
EdgeInsets
.
fromLTRB
(
50
,
30
,
30
,
10
),
child:
Row
(
children:
[
Text
(
const
Text
(
'Director: Dio Maulana | '
,
style:
TextStyle
(
fontSize:
15
,
...
...
@@ -168,12 +180,12 @@ class _detailMovieState extends State<detailMovie> {
_movieDetail
==
null
?
''
:
_movieDetail
!.
vote_average
.
toString
(),
style:
TextStyle
(
style:
const
TextStyle
(
fontSize:
15
,
color:
textColor
,
fontWeight:
FontWeight
.
w400
),
),
Icon
(
const
Icon
(
Icons
.
star
,
color:
Colors
.
yellow
,
)
...
...
@@ -184,7 +196,7 @@ class _detailMovieState extends State<detailMovie> {
margin:
EdgeInsets
.
fromLTRB
(
50
,
0
,
30
,
10
),
height:
50
,
child:
_movieDetail
==
null
?
SizedBox
(
?
const
SizedBox
(
width:
1
,
)
:
ListView
(
...
...
@@ -212,7 +224,7 @@ class _detailMovieState extends State<detailMovie> {
Container
(
margin:
EdgeInsets
.
only
(
top:
10
),
width:
300
,
child:
Text
(
child:
const
Text
(
"Synopsis"
,
textAlign:
TextAlign
.
start
,
style:
TextStyle
(
...
...
@@ -226,12 +238,12 @@ class _detailMovieState extends State<detailMovie> {
child:
Text
(
_movieDetail
==
null
?
''
:
_movieDetail
!.
overview
,
textAlign:
TextAlign
.
start
,
style:
TextStyle
(
style:
const
TextStyle
(
color:
textColor
,
fontSize:
15
,
fontWeight:
FontWeight
.
w400
),
)),
SizedBox
(
const
SizedBox
(
height:
35
,
)
],
...
...
@@ -257,18 +269,21 @@ class _detailMovieState extends State<detailMovie> {
mainAxisAlignment:
MainAxisAlignment
.
center
,
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
Text
(
const
Text
(
"Rate this movie "
,
style:
TextStyle
(
color:
textColor
),
),
SizedBox
(
const
SizedBox
(
height:
10
,
),
RatingBar
.
builder
(
initialRating:
1
,
minRating:
1
,
itemSize:
46
,
itemPadding:
EdgeInsets
.
symmetric
(
horizontal:
5
),
allowHalfRating:
true
,
itemCount:
10
,
// itemPadding:
// EdgeInsets.symmetric(horizontal: 5),
itemBuilder:
(
context
,
_
)
=>
Icon
(
Icons
.
star
,
color:
Colors
.
yellow
),
updateOnDrag:
true
,
...
...
@@ -283,7 +298,7 @@ class _detailMovieState extends State<detailMovie> {
BorderRadius
.
circular
(
25
)),
color:
Colors
.
yellow
,
onPressed:
()
{
postRate
(
rating
,
apiKey
,
widget
.
id
);
postRate
(
rating
,
widget
.
id
);
Navigator
.
pop
(
context
);
})
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment