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
fca140a3
Commit
fca140a3
authored
Feb 15, 2022
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
home page done
parent
517cf4ad
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
525 additions
and
272 deletions
+525
-272
launch.json
.vscode/launch.json
+15
-0
config.dart
lib/config.dart
+12
-0
main.dart
lib/main.dart
+9
-4
main_page.dart
lib/pages/main_page.dart
+267
-245
movie_detail.dart
lib/pages/movie_detail.dart
+201
-0
pubspec.lock
pubspec.lock
+15
-8
pubspec.yaml
pubspec.yaml
+5
-14
widget_test.dart
test/widget_test.dart
+1
-1
No files found.
.vscode/launch.json
0 → 100644
View file @
fca140a3
{
//
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"
:
[
{
"type"
:
"pwa-chrome"
,
"request"
:
"launch"
,
"name"
:
"Launch Chrome against localhost"
,
"url"
:
"http://localhost:8080"
,
"webRoot"
:
"${workspaceFolder}"
}
]
}
\ No newline at end of file
lib/config.dart
0 → 100644
View file @
fca140a3
import
'package:flutter/material.dart'
;
const
String
apiKey
=
"7bd732568db90a2ce0b095777844cdb9"
;
// apikey tmbd
const
Color
backgroundColor
=
Color
(
0xFF070D2D
);
const
Color
textColor
=
Color
(
0xFFD2D3D8
);
const
TextStyle
litleText
=
TextStyle
(
fontSize:
10
,
color:
textColor
,
fontWeight:
FontWeight
.
w500
);
const
TextStyle
titleText
=
TextStyle
(
fontSize:
20
,
color:
textColor
,
fontWeight:
FontWeight
.
w700
);
const
EdgeInsets
defaultCardPading
=
EdgeInsets
.
fromLTRB
(
0
,
10
,
0
,
0
);
lib/main.dart
View file @
fca140a3
import
'package:flutter/material.dart'
;
import
'package:movie_app/pages/main_page.dart'
;
import
'package:movie_app/pages/movie_detail.dart'
;
void
main
(
)
{
runApp
(
const
MyApp
());
runApp
(
MyApp
());
}
class
MyApp
extends
StatefulWidget
{
const
MyApp
({
Key
?
key
})
:
super
(
key:
key
);
@override
_MyAppState
createState
()
=>
_MyAppState
();
}
...
...
@@ -15,6 +14,12 @@ class MyApp extends StatefulWidget {
class
_MyAppState
extends
State
<
MyApp
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
MainPages
();
return
MaterialApp
(
initialRoute:
'/'
,
routes:
{
'/'
:
(
context
)
=>
MainPages
(),
'/detail'
:
(
context
)
=>
detailMovie
(),
},
);
}
}
lib/pages/main_page.dart
View file @
fca140a3
This diff is collapsed.
Click to expand it.
lib/pages/movie_detail.dart
0 → 100644
View file @
fca140a3
import
'dart:convert'
;
import
'dart:async'
;
import
'package:flutter/material.dart'
;
import
'package:movie_app/config.dart'
;
import
'package:http/http.dart'
as
http
;
class
detailMovie
extends
StatefulWidget
{
@override
_detailMovieState
createState
()
=>
_detailMovieState
();
}
class
_detailMovieState
extends
State
<
detailMovie
>
{
@override
Widget
build
(
BuildContext
context
)
{
final
arguments
=
ModalRoute
.
of
(
context
)!.
settings
.
arguments
as
String
;
var
_populars
=
[];
void
getPopularData
(
String
apiKey
,
String
arguments
)
async
{
var
response
=
await
http
.
get
(
Uri
.
parse
(
"https://api.themoviedb.org/3/movie/"
+
arguments
+
"?api_key="
+
apiKey
+
"&language=en-US"
));
var
jsonObject
=
jsonDecode
(
response
.
body
);
List
<
dynamic
>
listPopular
=
(
jsonObject
as
Map
<
String
,
dynamic
>)[
''
];
setState
(()
{
_populars
=
listPopular
;
});
}
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
getPopularData
(
apiKey
,
arguments
);
}
print
(
_populars
);
return
Scaffold
(
backgroundColor:
backgroundColor
,
body:
Stack
(
children:
[
ListView
(
children:
[
Container
(
margin:
EdgeInsets
.
fromLTRB
(
20
,
20
,
20
,
10
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
GestureDetector
(
onTap:
()
{
Navigator
.
pop
(
context
,
);
},
child:
Icon
(
Icons
.
arrow_back_ios_new
,
color:
textColor
,
),
),
Text
(
"Detail Movies"
,
style:
TextStyle
(
color:
textColor
,
fontSize:
20
,
fontWeight:
FontWeight
.
w800
),
),
Icon
(
Icons
.
bookmark_border_outlined
,
color:
textColor
,
),
],
),
),
Center
(
child:
Container
(
height:
500
,
width:
300
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
40
)),
margin:
EdgeInsets
.
fromLTRB
(
30
,
30
,
30
,
10
),
child:
Material
(
elevation:
10
,
borderRadius:
BorderRadius
.
circular
(
40
),
color:
Colors
.
transparent
,
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
40
),
child:
Image
(
image:
NetworkImage
(
"https://cdn.dribbble.com/users/6881751/screenshots/15130805/media/abdbb24b44fe7217de410073d279dc25.png"
),
fit:
BoxFit
.
cover
,
height:
500
,
width:
300
,
),
),
),
),
),
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
10
),
width:
300
,
child:
Text
(
arguments
,
textAlign:
TextAlign
.
start
,
style:
TextStyle
(
fontSize:
25
,
fontWeight:
FontWeight
.
w700
,
color:
textColor
),
),
),
Container
(
margin:
EdgeInsets
.
fromLTRB
(
50
,
30
,
30
,
10
),
child:
Row
(
children:
[
Text
(
'Director: Dio Maulana | '
,
style:
TextStyle
(
fontSize:
15
,
color:
textColor
,
fontWeight:
FontWeight
.
w400
),
),
Text
(
'4.8 '
,
style:
TextStyle
(
fontSize:
15
,
color:
textColor
,
fontWeight:
FontWeight
.
w400
),
),
Icon
(
Icons
.
star
,
color:
Colors
.
yellow
,
)
],
),
),
Container
(
margin:
EdgeInsets
.
fromLTRB
(
50
,
0
,
30
,
10
),
child:
Row
(
children:
[
RaisedButton
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
25
)),
color:
Color
(
0xFF05104f
),
child:
Text
(
"Crime"
,
style:
TextStyle
(
color:
textColor
),
),
onPressed:
()
{},
),
SizedBox
(
width:
10
,
),
RaisedButton
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
25
)),
color:
Color
(
0xFF05104f
),
child:
Text
(
"Thriler"
,
style:
TextStyle
(
color:
textColor
),
),
onPressed:
()
{},
),
],
),
),
Container
(
margin:
EdgeInsets
.
only
(
top:
10
),
width:
300
,
child:
Text
(
"Synopsis"
,
textAlign:
TextAlign
.
start
,
style:
TextStyle
(
fontSize:
20
,
fontWeight:
FontWeight
.
w500
,
color:
textColor
),
),
),
Container
(
margin:
EdgeInsets
.
fromLTRB
(
50
,
30
,
30
,
10
),
child:
Text
(
"ini isi sssssssssssssssssssssa aslaskasa kasmdasldka sdasdkjasd asdkasa sdapsdasd as dapsdjasd asdasld asd["
,
textAlign:
TextAlign
.
start
,
style:
TextStyle
(
color:
textColor
,
fontSize:
15
,
fontWeight:
FontWeight
.
w300
),
))
],
)
],
)
],
),
);
}
}
pubspec.lock
View file @
fca140a3
...
...
@@ -15,13 +15,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
carousel_slider:
dependency: "direct main"
description:
name: carousel_slider
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.4"
characters:
dependency: transitive
description:
...
...
@@ -81,6 +74,20 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
http:
dependency: "direct main"
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.4"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
lints:
dependency: transitive
description:
...
...
@@ -178,4 +185,4 @@ packages:
source: hosted
version: "2.1.1"
sdks:
dart: ">=2.16.
1
<3.0.0"
dart: ">=2.16.
0
<3.0.0"
pubspec.yaml
View file @
fca140a3
...
...
@@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version
:
1.0.0+1
environment
:
sdk
:
"
>=2.16.
1
<3.0.0"
sdk
:
"
>=2.16.
0
<3.0.0"
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
...
...
@@ -27,18 +27,12 @@ environment:
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies
:
cupertino_icons
:
^1.0.2
flutter
:
sdk
:
flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons
:
^1.0.2
carousel_slider
:
^2.3.1
http
:
^0.13.4
dev_dependencies
:
flutter_test
:
sdk
:
flutter
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
...
...
@@ -46,10 +40,11 @@ dev_dependencies:
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints
:
^1.0.0
flutter_test
:
sdk
:
flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter
:
...
...
@@ -57,18 +52,14 @@ flutter:
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design
:
true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
...
...
test/widget_test.dart
View file @
fca140a3
...
...
@@ -13,7 +13,7 @@ import 'package:movie_app/main.dart';
void
main
(
)
{
testWidgets
(
'Counter increments smoke test'
,
(
WidgetTester
tester
)
async
{
// Build our app and trigger a frame.
await
tester
.
pumpWidget
(
const
MyApp
());
await
tester
.
pumpWidget
(
MyApp
());
// Verify that our counter starts at 0.
expect
(
find
.
text
(
'0'
),
findsOneWidget
);
...
...
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