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
5728f0a5
Commit
5728f0a5
authored
Jul 08, 2021
by
xuehao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
listview
parent
c53ccd34
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
134 additions
and
4 deletions
+134
-4
AppFrameworkInfo.plist
netrain_flutter_app/ios/Flutter/AppFrameworkInfo.plist
+1
-1
project.pbxproj
netrain_flutter_app/ios/Runner.xcodeproj/project.pbxproj
+3
-3
main.dart
netrain_flutter_app/lib/main.dart
+3
-0
list_page.dart
netrain_flutter_app/lib/xuehao/list_page.dart
+127
-0
No files found.
netrain_flutter_app/ios/Flutter/AppFrameworkInfo.plist
View file @
5728f0a5
...
...
@@ -21,6 +21,6 @@
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
1.0
<
/string
>
<
k
e
y
>
MinimumOSVersion
<
/k
e
y
>
<
string
>
8
.0
<
/string
>
<
string
>
9
.0
<
/string
>
<
/
d
i
c
t
>
<
/plist
>
netrain_flutter_app/ios/Runner.xcodeproj/project.pbxproj
View file @
5728f0a5
...
...
@@ -339,7 +339,7 @@
GCC_WARN_UNINITIALIZED_AUTOS
=
YES_AGGRESSIVE
;
GCC_WARN_UNUSED_FUNCTION
=
YES
;
GCC_WARN_UNUSED_VARIABLE
=
YES
;
IPHONEOS_DEPLOYMENT_TARGET
=
8
.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
9
.0
;
MTL_ENABLE_DEBUG_INFO
=
NO
;
SDKROOT
=
iphoneos
;
SUPPORTED_PLATFORMS
=
iphoneos
;
...
...
@@ -426,7 +426,7 @@
GCC_WARN_UNINITIALIZED_AUTOS
=
YES_AGGRESSIVE
;
GCC_WARN_UNUSED_FUNCTION
=
YES
;
GCC_WARN_UNUSED_VARIABLE
=
YES
;
IPHONEOS_DEPLOYMENT_TARGET
=
8
.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
9
.0
;
MTL_ENABLE_DEBUG_INFO
=
YES
;
ONLY_ACTIVE_ARCH
=
YES
;
SDKROOT
=
iphoneos
;
...
...
@@ -475,7 +475,7 @@
GCC_WARN_UNINITIALIZED_AUTOS
=
YES_AGGRESSIVE
;
GCC_WARN_UNUSED_FUNCTION
=
YES
;
GCC_WARN_UNUSED_VARIABLE
=
YES
;
IPHONEOS_DEPLOYMENT_TARGET
=
8
.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
9
.0
;
MTL_ENABLE_DEBUG_INFO
=
NO
;
SDKROOT
=
iphoneos
;
SUPPORTED_PLATFORMS
=
iphoneos
;
...
...
netrain_flutter_app/lib/main.dart
View file @
5728f0a5
import
'package:flutter/material.dart'
;
import
'package:fluttertoast/fluttertoast.dart'
;
import
'package:netrain_flutter_app/xuehao/list_page.dart'
;
import
'laishanqi/Stateful_page.dart'
;
import
'laishanqi/Stateless_page.dart'
;
...
...
@@ -41,6 +42,7 @@ class MyApp extends StatelessWidget {
"layout"
:
(
context
)
=>
LayoutPage
(),
"photo"
:
(
context
)
=>
PhotoApp
(),
"register"
:
(
context
)
=>
RegisterPage
(),
"listPage"
:(
context
)
=>
List_Page
(),
},
),
onWillPop:
()
async
{
Fluttertoast
.
showToast
(
msg:
"退出"
);
...
...
@@ -80,6 +82,7 @@ class _RouterNavigatorState extends State<RouterNavigator> {
_item
(
"拍照页面"
,
PhotoApp
(),
'photo'
),
_item
(
"登陆"
,
LoginPage
(),
'login'
),
_item
(
"登录网络请求"
,
LoginRequestPage
(),
'loginRequest'
),
_item
(
"listview页面"
,
List_Page
(),
'listPage'
),
],
),
);
...
...
netrain_flutter_app/lib/xuehao/list_page.dart
0 → 100644
View file @
5728f0a5
import
'package:flutter/material.dart'
;
import
'package:fluttertoast/fluttertoast.dart'
;
class
List_Page
extends
StatefulWidget
{
@override
State
<
StatefulWidget
>
createState
()
=>
_ListPageState
();
}
class
_ListPageState
extends
State
<
List_Page
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
new
MaterialApp
(
title:
"listPage"
,
theme:
ThemeData
(
primarySwatch:
Colors
.
blue
,
),
home:
Scaffold
(
appBar:
AppBar
(
title:
Text
(
"ListView"
),
centerTitle:
true
,
leading:
GestureDetector
(
onTap:
()
{
Navigator
.
pop
(
context
);
},
child:
Icon
(
Icons
.
arrow_back_ios
),
),
),
body:
ListView
.
builder
(
itemCount:
datas
.
length
,
itemBuilder:
_getDatas
,
)),
);
}
Widget
_getDatas
(
BuildContext
context
,
int
position
)
{
return
Container
(
child:
GestureDetector
(
child:
Card
(
elevation:
6
,
shadowColor:
Colors
.
redAccent
,
margin:
EdgeInsets
.
fromLTRB
(
16
,
20
,
16
,
20
),
child:
Column
(
children:
[
SizedBox
(
height:
20
),
Text
(
datas
[
position
].
name
),
SizedBox
(
height:
10
),
Image
.
network
(
datas
[
position
].
imageUrl
,
width:
340
,
height:
200
,
),
SizedBox
(
height:
20
),
],
),
),
onTap:
()
{
var
data
=
datas
[
position
];
Fluttertoast
.
showToast
(
msg:
"我点击了"
+
data
.
name
);
},
));
}
}
//定义一个全局的变量:模型数组
final
List
<
Car
>
datas
=
[
Car
(
name:
'保时捷918 Spyder'
,
imageUrl:
'https://upload-images.jianshu.io/upload_images/2990730-7d8be6ebc4c7c95b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240'
,
),
Car
(
name:
'兰博基尼Aventador'
,
imageUrl:
'https://upload-images.jianshu.io/upload_images/2990730-e3bfd824f30afaac?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240'
,
),
Car
(
name:
'法拉利Enzo'
,
imageUrl:
'https://upload-images.jianshu.io/upload_images/2990730-a1d64cf5da2d9d99?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240'
,
),
Car
(
name:
'Zenvo ST1'
,
imageUrl:
'https://upload-images.jianshu.io/upload_images/2990730-bf883b46690f93ce?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240'
,
),
Car
(
name:
'迈凯伦F1'
,
imageUrl:
'https://upload-images.jianshu.io/upload_images/2990730-5a7b5550a19b8342?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240'
,
),
Car
(
name:
'萨林S7'
,
imageUrl:
'https://upload-images.jianshu.io/upload_images/2990730-2e128d18144ad5b8?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240'
,
),
Car
(
name:
'科尼赛克CCR'
,
imageUrl:
'https://upload-images.jianshu.io/upload_images/2990730-01ced8f6f95219ec?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240'
,
),
Car
(
name:
'布加迪Chiron'
,
imageUrl:
'https://upload-images.jianshu.io/upload_images/2990730-7fc8359eb61adac0?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240'
,
),
Car
(
name:
'轩尼诗Venom GT'
,
imageUrl:
'https://upload-images.jianshu.io/upload_images/2990730-d332bf510d61bbc2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240'
,
),
Car
(
name:
'西贝尔Tuatara'
,
imageUrl:
'https://upload-images.jianshu.io/upload_images/2990730-3dd9a70b25ae6bc9?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240'
,
)
];
class
Car
{
//构造函数
const
Car
({
this
.
name
,
this
.
imageUrl
,
});
final
String
name
;
final
String
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