Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
netrain_flutter_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
邹志胜
netrain_flutter_app
Commits
ecd62bc2
Commit
ecd62bc2
authored
Jul 09, 2021
by
xuehao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
车辆详情页提交
parent
0c56b7ac
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
0 deletions
+51
-0
car_details.dart
netrain_flutter_app/lib/xuehao/car_details.dart
+49
-0
list_page.dart
netrain_flutter_app/lib/xuehao/list_page.dart
+2
-0
No files found.
netrain_flutter_app/lib/xuehao/car_details.dart
0 → 100644
View file @
ecd62bc2
import
'package:flutter/material.dart'
;
/**
* @author xuehao
* on 2021/7/9
*/
class
CarDetailsPage
extends
StatefulWidget
{
String
name
,
imageUrl
;
CarDetailsPage
({
Key
key
,
@required
this
.
name
,
@required
this
.
imageUrl
})
:
super
(
key:
key
);
@override
_CarDetailsState
createState
()
=>
_CarDetailsState
(
name
,
imageUrl
);
}
class
_CarDetailsState
extends
State
<
CarDetailsPage
>
{
String
name
,
imageUrl
;
_CarDetailsState
(
this
.
name
,
this
.
imageUrl
);
@override
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
title:
"car_details"
,
home:
Scaffold
(
appBar:
AppBar
(
title:
Text
(
"汽车详情"
),
centerTitle:
true
,
leading:
new
IconButton
(
onPressed:
()
{
Navigator
.
pop
(
context
);
},
icon:
Icon
(
Icons
.
arrow_back_ios
)),
),
body:
Center
(
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
name
),
SizedBox
(
height:
40
),
Image
.
network
(
imageUrl
),
],
),
),
),
);
}
}
netrain_flutter_app/lib/xuehao/list_page.dart
View file @
ecd62bc2
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_easyrefresh/easy_refresh.dart'
;
import
'package:flutter_easyrefresh/easy_refresh.dart'
;
import
'package:fluttertoast/fluttertoast.dart'
;
import
'package:fluttertoast/fluttertoast.dart'
;
import
'package:netrain_flutter_app/xuehao/car_details.dart'
;
import
'Car.dart'
;
import
'Car.dart'
;
class
List_Page
extends
StatefulWidget
{
class
List_Page
extends
StatefulWidget
{
...
@@ -85,6 +86,7 @@ class _ListPageState extends State<List_Page> {
...
@@ -85,6 +86,7 @@ class _ListPageState extends State<List_Page> {
onTap:
()
{
onTap:
()
{
var
data
=
datas
[
position
];
var
data
=
datas
[
position
];
Fluttertoast
.
showToast
(
msg:
"我点击了
${data.name}
"
);
Fluttertoast
.
showToast
(
msg:
"我点击了
${data.name}
"
);
Navigator
.
push
(
context
,
new
MaterialPageRoute
(
builder:
(
context
)
=>
new
CarDetailsPage
(
name:
data
.
name
,
imageUrl:
data
.
imageUrl
,)));
},
},
));
));
}
}
...
...
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