Commit fca140a3 authored by Dio Maulana's avatar Dio Maulana

home page done

parent 517cf4ad
{
// 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
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);
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:movie_app/pages/main_page.dart'; import 'package:movie_app/pages/main_page.dart';
import 'package:movie_app/pages/movie_detail.dart';
void main() { void main() {
runApp(const MyApp()); runApp(MyApp());
} }
class MyApp extends StatefulWidget { class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override @override
_MyAppState createState() => _MyAppState(); _MyAppState createState() => _MyAppState();
} }
...@@ -15,6 +14,12 @@ class MyApp extends StatefulWidget { ...@@ -15,6 +14,12 @@ class MyApp extends StatefulWidget {
class _MyAppState extends State<MyApp> { class _MyAppState extends State<MyApp> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MainPages(); return MaterialApp(
initialRoute: '/',
routes: {
'/': (context) => MainPages(),
'/detail': (context) => detailMovie(),
},
);
} }
} }
This diff is collapsed.
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),
))
],
)
],
)
],
),
);
}
}
...@@ -15,13 +15,6 @@ packages: ...@@ -15,13 +15,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" 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: characters:
dependency: transitive dependency: transitive
description: description:
...@@ -81,6 +74,20 @@ packages: ...@@ -81,6 +74,20 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" 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: lints:
dependency: transitive dependency: transitive
description: description:
...@@ -178,4 +185,4 @@ packages: ...@@ -178,4 +185,4 @@ packages:
source: hosted source: hosted
version: "2.1.1" version: "2.1.1"
sdks: sdks:
dart: ">=2.16.1 <3.0.0" dart: ">=2.16.0 <3.0.0"
...@@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev ...@@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1 version: 1.0.0+1
environment: 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. # Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions # To automatically upgrade your package dependencies to the latest versions
...@@ -27,18 +27,12 @@ environment: ...@@ -27,18 +27,12 @@ environment:
# the latest version available on pub.dev. To see which dependencies have newer # the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`. # versions available, run `flutter pub outdated`.
dependencies: dependencies:
cupertino_icons: ^1.0.2
flutter: flutter:
sdk: flutter sdk: flutter
http: ^0.13.4
# 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
dev_dependencies: dev_dependencies:
flutter_test:
sdk: flutter
# The "flutter_lints" package below contains a set of recommended lints to # The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is # encourage good coding practices. The lint set provided by the package is
...@@ -46,10 +40,11 @@ dev_dependencies: ...@@ -46,10 +40,11 @@ dev_dependencies:
# package. See that file for information about deactivating specific lint # package. See that file for information about deactivating specific lint
# rules and activating additional ones. # rules and activating additional ones.
flutter_lints: ^1.0.0 flutter_lints: ^1.0.0
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter. # The following section is specific to Flutter.
flutter: flutter:
...@@ -57,18 +52,14 @@ flutter: ...@@ -57,18 +52,14 @@ flutter:
# included with your application, so that you can use the icons in # included with your application, so that you can use the icons in
# the material Icons class. # the material Icons class.
uses-material-design: true uses-material-design: true
# To add assets to your application, add an assets section, like this: # To add assets to your application, add an assets section, like this:
# assets: # assets:
# - images/a_dot_burr.jpeg # - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg # - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see # An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware. # https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see # For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages # https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here, # To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a # 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 # "family" key with the font family name, and a "fonts" key with a
......
...@@ -13,7 +13,7 @@ import 'package:movie_app/main.dart'; ...@@ -13,7 +13,7 @@ import 'package:movie_app/main.dart';
void main() { void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async { testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame. // Build our app and trigger a frame.
await tester.pumpWidget(const MyApp()); await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0. // Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget); expect(find.text('0'), findsOneWidget);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment