1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
| import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:netflix_clone_lecture_note/model/model_movie.dart';
class DetailScreen extends StatefulWidget { final Movie movie; DetailScreen({this.movie}); _DetailScreenState createState() => _DetailScreenState(); }
class _DetailScreenState extends State<DetailScreen> { bool like = false; @override void initState() { super.initState(); like = widget.movie.like; }
@override Widget build(BuildContext context) { return Scaffold( body: Container( child: SafeArea( child: ListView( children: <Widget>[ Stack( children: <Widget>[ Container( width: double.maxFinite, decoration: BoxDecoration( image: DecorationImage( image: NetworkImage(widget.movie.poster), fit: BoxFit.cover, ), ), child: ClipRect( child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), child: Container( alignment: Alignment.center, color: Colors.black.withOpacity(0.1), child: Container( child: Column( children: <Widget>[ Container( padding: EdgeInsets.fromLTRB(0, 45, 0, 10), child: Image.network(widget.movie.poster), height: 300, ), Container( padding: EdgeInsets.all(7), child: Text( '99% 일치 2019 15+ 시즌 1개', textAlign: TextAlign.center, style: TextStyle(fontSize: 13), ), ), Container( padding: EdgeInsets.all(7), child: Text( widget.movie.title, textAlign: TextAlign.center, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 16), ), ), Container( padding: EdgeInsets.all(3), child: FlatButton( onPressed: () {}, color: Colors.red, child: Row( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Icon(Icons.play_arrow), Text('재생'), ], ), ), ), Container( padding: EdgeInsets.all(5), child: Text(widget.movie.toString()), ), Container( padding: EdgeInsets.all(5), alignment: Alignment.centerLeft, child: Text( '출연: 현빈, 손예진, 서지혜\n제작자: 이정효, 박지은', style: TextStyle( color: Colors.white60, fontSize: 12, ), ), ) ], ), ), ), ), ), ), Positioned( child: AppBar( backgroundColor: Colors.transparent, elevation: 0, ), ), ], ), Container( color: Colors.black26, child: Row( mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[ Container( padding: EdgeInsets.fromLTRB(20, 10, 20, 10), child: InkWell( onTap: () { setState(() { like = !like; widget.movie.reference.updateData({'like': like}); }); }, child: Column( children: <Widget>[ like ? Icon(Icons.check) : Icon(Icons.add), Padding( padding: EdgeInsets.all(5), ), Text( '내가 찜한 콘텐츠', style: TextStyle( fontSize: 11, color: Colors.white60, ), ) ], ), ), ), Container( padding: EdgeInsets.fromLTRB(20, 10, 20, 10), child: Container( child: Column( children: <Widget>[ Icon(Icons.thumb_up), Padding( padding: EdgeInsets.all(5), ), Text( '평가', style: TextStyle( fontSize: 11, color: Colors.white60), ) ], ), ), ), Container( padding: EdgeInsets.fromLTRB(20, 10, 20, 10), child: Container( child: Column( children: <Widget>[ Icon(Icons.send), Padding(padding: EdgeInsets.all(5)), Text( '공유', style: TextStyle( fontSize: 11, color: Colors.white60), ), ], ), ), ) ], ), ) ], ), ), ), ); } }
|