Skip to content

Commit 9ff6715

Browse files
committed
add the move file.
1 parent 82e866c commit 9ff6715

26 files changed

+680
-7
lines changed

assets/moves/ic_preview_1.png

114 KB
Loading

assets/moves/ic_preview_2.png

104 KB
Loading

assets/moves/ic_preview_3.png

103 KB
Loading

assets/moves/ic_preview_4.png

109 KB
Loading

assets/moves/ic_thumb_11.png

66.2 KB
Loading

assets/moves/ic_thumb_12.png

70.6 KB
Loading

assets/moves/ic_thumb_13.png

82 KB
Loading

assets/moves/ic_thumb_21.png

71.1 KB
Loading

assets/moves/ic_thumb_31.png

78.8 KB
Loading

assets/moves/ic_thumb_41.png

73.5 KB
Loading

assets/moves/movie_banner_1.png

154 KB
Loading

assets/moves/movie_banner_2.png

324 KB
Loading

assets/moves/movie_banner_3.png

439 KB
Loading

assets/moves/movie_banner_4.png

523 KB
Loading

lib/constant/main_const.dart

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ enum ItemType {
6262
hero,
6363
nested
6464
}
65+
const GRID_VIEW_NAME = "GridView";
6566

6667
ItemType convertItemType(index) {
6768
switch (index) {

lib/constant/move_data.dart

+183
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
///
2+
/// Created by NieBin on 18-12-8
3+
/// Github: https://github.com/nb312
4+
5+
///
6+
///
7+
import 'package:meta/meta.dart';
8+
//import "package:flutter/material.dart";
9+
10+
class MoveItem {
11+
int id;
12+
String name;
13+
String category;
14+
String releaseDate;
15+
String releaseDateDesc;
16+
String directors;
17+
String runtime;
18+
String desc;
19+
double rating;
20+
String imageUrl;
21+
String bannerUrl;
22+
String trailerImg1;
23+
String trailerImg2;
24+
String trailerImg3;
25+
26+
MoveItem({
27+
@required this.id,
28+
@required this.name,
29+
@required this.category,
30+
@required this.directors,
31+
@required this.releaseDate,
32+
@required this.releaseDateDesc,
33+
@required this.runtime,
34+
@required this.desc,
35+
@required this.rating,
36+
@required this.imageUrl,
37+
@required this.bannerUrl,
38+
@required this.trailerImg1,
39+
@required this.trailerImg2,
40+
@required this.trailerImg3,
41+
});
42+
}
43+
44+
List<MoveItem> getItemList() {
45+
return [
46+
MoveItem(
47+
id: 0,
48+
name: 'Avengers: Infinity War',
49+
category: 'Action, Adventure, Fantasy',
50+
desc: 'The Avengers and their allies must be willing '
51+
'to sacrifice all in an attempt to defeat '
52+
'the powerful Thanos before his blitz of '
53+
'devastation and ruin puts an end to the universe.'
54+
'\nAs the Avengers and their allies have continued '
55+
'to protect the world from threats too large for '
56+
'any one hero to handle, a danger has emerged '
57+
'from the cosmic shadows: Thanos.',
58+
rating: 8.7,
59+
directors: 'Directors: Anthony Russo, Joe Russo',
60+
releaseDate: '27 April 2018',
61+
releaseDateDesc: 'USA (2018), 2h 29min',
62+
runtime: '2h 29min',
63+
bannerUrl: 'assets/moves/movie_banner_1.png',
64+
imageUrl: 'assets/moves/ic_preview_1.png',
65+
trailerImg1: 'assets/moves/ic_thumb_11.png',
66+
trailerImg2: 'assets/moves/ic_thumb_12.png',
67+
trailerImg3: 'assets/moves/ic_thumb_13.png',
68+
),
69+
MoveItem(
70+
id: 1,
71+
name: 'Transformers: The Last Knight',
72+
category: 'Action, Adventure, Sci-Fi',
73+
desc: 'Autobots and Decepticons are at war, with humans '
74+
'on the sidelines. Optimus Prime is gone. The key to '
75+
'saving our future lies buried in the secrets of the past, '
76+
'in the hidden history of Transformers on Earth.',
77+
rating: 5.2,
78+
directors: 'Directors: Michael Bay',
79+
releaseDate: '21 June 2017',
80+
releaseDateDesc: 'USA (2017), 2h 34min',
81+
runtime: '2h 34min',
82+
bannerUrl: 'assets/moves/movie_banner_2.png',
83+
imageUrl: 'assets/moves/ic_preview_2.png',
84+
trailerImg1: 'assets/moves/ic_thumb_21.png',
85+
trailerImg2: 'assets/moves/ic_thumb_21.png',
86+
trailerImg3: 'assets/moves/ic_thumb_21.png',
87+
),
88+
MoveItem(
89+
id: 2,
90+
name: 'Pacific Rim: Uprising',
91+
category: 'Action, Adventure, Sci-Fi',
92+
desc: 'Jake Pentecost, son of Stacker Pentecost, reunites with '
93+
'Mako Mori to lead a new generation of Jaeger pilots, including '
94+
'rival Lambert and 15-year-old hacker Amara, against a new Kaiju threat.',
95+
rating: 5.7,
96+
directors: 'Directors: Steven S. DeKnight',
97+
releaseDate: '23 March 2018',
98+
releaseDateDesc: 'USA (2018), 1h 51min',
99+
runtime: '1h 51min',
100+
bannerUrl: 'assets/moves/movie_banner_3.png',
101+
imageUrl: 'assets/moves/ic_preview_3.png',
102+
trailerImg1: 'assets/moves/ic_thumb_31.png',
103+
trailerImg2: 'assets/moves/ic_thumb_31.png',
104+
trailerImg3: 'assets/moves/ic_thumb_31.png',
105+
),
106+
MoveItem(
107+
id: 3,
108+
name: 'Thor: Ragnarok',
109+
category: 'Action, Adventure, Comedy',
110+
desc: 'Thor is imprisoned on the planet Sakaar, and must '
111+
'race against time to return to Asgard and stop Ragnarök, '
112+
'the destruction of his world, at the hands of the powerful '
113+
'and ruthless villain Hela.',
114+
rating: 7.9,
115+
directors: 'Directors: Taika Waititi',
116+
releaseDate: '3 November 2017',
117+
releaseDateDesc: 'USA (2017), 2h 10min',
118+
runtime: '2h 10min',
119+
bannerUrl: 'assets/moves/movie_banner_4.png',
120+
imageUrl: 'assets/moves/ic_preview_4.png',
121+
trailerImg1: 'assets/moves/ic_thumb_41.png',
122+
trailerImg2: 'assets/moves/ic_thumb_41.png',
123+
trailerImg3: 'assets/moves/ic_thumb_41.png',
124+
),
125+
MoveItem(
126+
id: 4,
127+
name: 'Thor: Ragnarok',
128+
category: 'Action, Adventure, Comedy',
129+
desc: 'Thor is imprisoned on the planet Sakaar, and must '
130+
'race against time to return to Asgard and stop Ragnarök, '
131+
'the destruction of his world, at the hands of the powerful '
132+
'and ruthless villain Hela.',
133+
rating: 7.9,
134+
directors: 'Directors: Taika Waititi',
135+
releaseDate: '3 November 2017',
136+
releaseDateDesc: 'USA (2017), 2h 10min',
137+
runtime: '2h 10min',
138+
bannerUrl: 'assets/moves/movie_banner_4.png',
139+
imageUrl: 'assets/moves/ic_preview_4.png',
140+
trailerImg1: 'assets/moves/ic_thumb_41.png',
141+
trailerImg2: 'assets/moves/ic_thumb_41.png',
142+
trailerImg3: 'assets/moves/ic_thumb_41.png',
143+
),
144+
MoveItem(
145+
id: 5,
146+
name: 'Thor: Ragnarok',
147+
category: 'Action, Adventure, Comedy',
148+
desc: 'Thor is imprisoned on the planet Sakaar, and must '
149+
'race against time to return to Asgard and stop Ragnarök, '
150+
'the destruction of his world, at the hands of the powerful '
151+
'and ruthless villain Hela.',
152+
rating: 7.9,
153+
directors: 'Directors: Taika Waititi',
154+
releaseDate: '3 November 2017',
155+
releaseDateDesc: 'USA (2017), 2h 10min',
156+
runtime: '2h 10min',
157+
bannerUrl: 'assets/moves/movie_banner_4.png',
158+
imageUrl: 'assets/moves/ic_preview_4.png',
159+
trailerImg1: 'assets/moves/ic_thumb_41.png',
160+
trailerImg2: 'assets/moves/ic_thumb_41.png',
161+
trailerImg3: 'assets/moves/ic_thumb_41.png',
162+
),
163+
MoveItem(
164+
id: 6,
165+
name: 'Thor: Ragnarok',
166+
category: 'Action, Adventure, Comedy',
167+
desc: 'Thor is imprisoned on the planet Sakaar, and must '
168+
'race against time to return to Asgard and stop Ragnarök, '
169+
'the destruction of his world, at the hands of the powerful '
170+
'and ruthless villain Hela.',
171+
rating: 7.9,
172+
directors: 'Directors: Taika Waititi',
173+
releaseDate: '3 November 2017',
174+
releaseDateDesc: 'USA (2017), 2h 10min',
175+
runtime: '2h 10min',
176+
bannerUrl: 'assets/moves/movie_banner_4.png',
177+
imageUrl: 'assets/moves/ic_preview_4.png',
178+
trailerImg1: 'assets/moves/ic_thumb_41.png',
179+
trailerImg2: 'assets/moves/ic_thumb_41.png',
180+
trailerImg3: 'assets/moves/ic_thumb_41.png',
181+
),
182+
];
183+
}

lib/constant/size_const.dart

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const TEXT_HUGE_SIZE = 100.0;
88
const TEXT_LARGE_SIZE = 24.0;
99
const TEXT_NORMAL_SIZE = 16.0;
1010
const TEXT_SMALL_SIZE = 10.0;
11+
const TEXT_SMALL_SIZE_2 = 8.0;
1112

1213
const LINE_SMALL = 1.0;
1314
const LINE_NORMAL = 10.0;

lib/main.dart

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import 'package:flutter/material.dart';
22
import 'nbmain.dart';
3+
import 'package:flutter_layout/constant/main_const.dart';
4+
import 'package:flutter_layout/screen/move/GridViewPage.dart';
35

46
void main() => runApp(new MyApp());
57

@@ -9,12 +11,15 @@ class MyApp extends StatelessWidget {
911
return MaterialApp(
1012
title: 'Flutter layout',
1113
theme: ThemeData(
12-
primarySwatch: Colors.orange,
14+
primaryColor: Colors.grey[900],
1315
),
1416
home: Scaffold(
15-
backgroundColor: Colors.white,
17+
backgroundColor: Colors.grey,
1618
body: NBMain(),
1719
),
20+
routes: {
21+
GRID_VIEW_NAME: (context) => GridViewPage(),
22+
},
1823
);
1924
}
2025
}

lib/screen/ListScreen.dart

+22-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import '../view/app_bar.dart';
88
import '../constant/main_const.dart';
99
import '../view/list_selector.dart';
1010
import '../constant/size_const.dart';
11-
11+
import 'package:flutter_layout/constant/main_const.dart';
12+
import 'package:flutter_layout/screen/move/GridViewPage.dart';
1213
class User {
1314
User({this.name, this.email});
1415

@@ -60,7 +61,6 @@ const USER_EMAILS = [
6061
6162
6263
];
63-
const GRID_VIEW = "Grid View";
6464

6565
class ListScreen extends StatefulWidget {
6666
ListScreen({Key key, this.group, this.onClick}) : super(key: key);
@@ -101,7 +101,9 @@ class _ListState extends State<ListScreen> {
101101
leading: CircleAvatar(
102102
child: Text(
103103
user.name[0],
104-
style: TextStyle(color: Colors.white),
104+
style: TextStyle(
105+
color: Colors.white,
106+
),
105107
),
106108
backgroundColor: BAR_BACK_COLORS[widget.group.index],
107109
),
@@ -134,11 +136,26 @@ class _ListState extends State<ListScreen> {
134136

135137
Widget _topRight() {
136138
return InkWell(
139+
onTap: () {
140+
print("click");
141+
Navigator.push(
142+
context,
143+
MaterialPageRoute(
144+
builder: (context) =>GridViewPage()));
145+
// Navigator.of(context).pushNamed(GRID_VIEW_NAME);
146+
},
137147
child: Container(
148+
padding: EdgeInsets.only(right: 10.0),
138149
child: Center(
139150
child: Text(
140-
GRID_VIEW,
141-
style: TextStyle(color: Colors.white),
151+
GRID_VIEW_NAME,
152+
style: TextStyle(
153+
color: Colors.white,
154+
fontWeight: FontWeight.w700,
155+
fontSize: TEXT_NORMAL_SIZE,
156+
shadows: [
157+
Shadow(color: Colors.grey[800], offset: Offset(0.0, 1.0))
158+
]),
142159
),
143160
),
144161
),

0 commit comments

Comments
 (0)