Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
F
Flutter_app
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
梁佳霖
Flutter_app
Commits
974179c3
提交
974179c3
authored
3月 14, 2020
作者:
杨俊磊
浏览文件
操作
浏览文件
下载
差异文件
Container容器、Scaffold、TabBar、剪裁学习代码提交
上级
bae5664c
8ee3be51
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
154 行增加
和
8 行删除
+154
-8
liangjialin.dart
lib/liangjialin/liangjialin.dart
+12
-0
liangjialin_router_widget.dart
lib/liangjialin/liangjialin_router_widget.dart
+120
-0
main.dart
lib/main.dart
+9
-7
router_path.dart
lib/router_path.dart
+4
-1
pubspec.lock
pubspec.lock
+8
-0
pubspec.yaml
pubspec.yaml
+1
-0
没有找到文件。
lib/liangjialin/liangjialin.dart
浏览文件 @
974179c3
import
'package:flutter/material.dart'
;
import
'package:flutterpro/liangjialin/liangjialin_container.dart'
;
import
'package:flutterpro/liangjialin/liangjialin_router_widget.dart'
;
import
'liangjialin_image.dart'
;
import
'liangjialin_image_local.dart'
;
...
...
@@ -55,6 +56,17 @@ class LiangjialinHome extends StatelessWidget {
));
},
child:
Text
(
"Scaffold、Container、padding演示"
),
),
RaisedButton
(
color:
Theme
.
of
(
context
).
primaryColor
,
textColor:
Colors
.
white
,
onPressed:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
liangjialin_router_widget
(),
));
},
child:
Text
(
"底部导航、TabBar演示"
),
),
],
),
...
...
lib/liangjialin/liangjialin_router_widget.dart
0 → 100644
浏览文件 @
974179c3
import
'package:flutter/material.dart'
;
import
'package:oktoast/oktoast.dart'
;
class
liangjialin_router_widget
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
new
Scaffold
(
appBar:
AppBar
(
title:
Text
(
"底部导航、TabBar演示"
),
centerTitle:
true
,
actions:
<
Widget
>[
//导航栏右侧菜单
IconButton
(
icon:
Icon
(
Icons
.
four_k
),
onPressed:
()
{
showDialog
(
context:
context
,
builder:
(
ctx
)
{
return
Center
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
buildButton
(
"分享到QQ"
,
()
{
showToast
(
"已分享至QQ"
);
Navigator
.
pop
(
context
,
false
);
//关闭Dialog
}),
buildButton
(
"分享到微信"
,
()
{
showToast
(
"已分享至微信"
);
Navigator
.
pop
(
context
,
false
);
//关闭Dialog
}),
],
),
);
},
);
}),
// 新增分享按钮
],
),
drawer:
MyDrawer
(),
body:
ImageDemoSection
(),
);
}
}
class
ImageDemoSection
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
new
Center
(
child:
new
Container
(
// transform: Matrix4.skewY(0.3),
padding:
EdgeInsets
.
all
(
50
),
width:
300
,
height:
300
,
decoration:
BoxDecoration
(
color:
Colors
.
red
,
),
child:
new
Text
(
"左上角是抽屉菜单,右上角是分享菜单,点点试试。"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
20
,
color:
Colors
.
white
),
),
));
}
}
Widget
buildButton
(
String
text
,
Function
onPressed
,
{
Color
color
=
Colors
.
white
,
})
{
return
FlatButton
(
color:
color
,
child:
Text
(
text
),
onPressed:
onPressed
,
);
}
class
MyDrawer
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
// TODO: implement build
return
new
Drawer
(
child:
new
Container
(
padding:
EdgeInsets
.
fromLTRB
(
0
,
150
,
0
,
0
),
child:
new
Column
(
children:
<
Widget
>[
new
RaisedButton
(
onPressed:
(){
showToast
(
"选项一"
);
Navigator
.
pop
(
context
);
},
child:
new
Text
(
"选项一"
,
style:
TextStyle
(
color:
Colors
.
white
,
),
),
color:
Colors
.
blue
,
),
new
RaisedButton
(
onPressed:
(){
showToast
(
"选项二"
);
Navigator
.
pop
(
context
);
},
child:
new
Text
(
"选项二"
,
style:
TextStyle
(
color:
Colors
.
white
,
),
),
color:
Colors
.
blue
,
),
],
),
)
);
}
}
lib/main.dart
浏览文件 @
974179c3
import
'package:flutter/material.dart'
;
import
'package:flutterpro/router_path.dart'
;
import
'package:flutterpro/yangjunlei/yangjunlei.dart'
;
import
'package:oktoast/oktoast.dart'
;
import
'dingbaojie/FirstDay/DbjMain.dart'
;
import
'jiexifeng/jiexifeng.dart'
;
...
...
@@ -14,14 +15,16 @@ class MyApp extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
// TODO: implement build
return
new
MaterialApp
(
return
OKToast
(
child:
new
MaterialApp
(
home:
new
Scaffold
(
appBar:
AppBar
(
title:
Text
(
"原生开发组Flutter学习成果展示"
),
),
body:
MyAppBody
(),
),
routes:
Router
.
generateRoute
(),
routes:
RouterPath
.
generateRoute
(),
),
);
}
}
...
...
@@ -75,11 +78,10 @@ class MyAppBody extends StatelessWidget {
color:
Theme
.
of
(
context
).
primaryColor
,
textColor:
Colors
.
white
,
onPressed:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
liangjialin
(),
));
Navigator
.
pushNamed
(
context
,
RouterName
.
liangjialin
,
arguments:
<
String
,
String
>{
'city'
:
'Berlin'
,
'country'
:
'Germany'
,
});
},
child:
Text
(
"梁佳霖"
),
),
...
...
lib/router_path.dart
浏览文件 @
974179c3
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutterpro/liangjialin/liangjialin_container.dart'
;
import
'package:flutterpro/liangjialin/liangjialin_router_widget.dart'
;
import
'package:flutterpro/yangjunlei/yangjunlei.dart'
;
import
'dingbaojie/FirstDay/PaddingDemo.dart'
;
...
...
@@ -17,9 +18,10 @@ class RouterName {
static
const
String
image_liangjialin
=
'liangjialin/image'
;
static
const
String
image_liangjialin_local
=
'liangjialin/image_local'
;
static
const
String
liangjialin_container
=
'liangjialin/container'
;
static
const
String
liangjialin_router_widget
=
'liangjialin/liangjialin_router_widget'
;
}
class
Router
{
class
Router
Path
{
static
Map
<
String
,
WidgetBuilder
>
generateRoute
()
{
Map
<
String
,
WidgetBuilder
>
routes
=
{
RouterName
.
dingbaojie
:
(
context
)
=>
new
PaddingDemo
(),
...
...
@@ -29,6 +31,7 @@ class Router {
RouterName
.
image_liangjialin
:
(
context
)
=>
new
liangjialin_image
(),
RouterName
.
image_liangjialin_local
:
(
context
)
=>
new
liangjialin_image_local
(),
RouterName
.
liangjialin_container
:
(
context
)
=>
new
liangjialin_container
(),
RouterName
.
liangjialin_router_widget
:
(
context
)
=>
new
liangjialin_router_widget
(),
};
return
routes
;
}
...
...
pubspec.lock
浏览文件 @
974179c3
...
...
@@ -95,6 +95,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.8"
oktoast:
dependency: "direct main"
description:
name: oktoast
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.3.1+1"
path:
dependency: transitive
description:
...
...
@@ -193,3 +200,4 @@ packages:
version: "3.5.0"
sdks:
dart: ">=2.4.0 <3.0.0"
flutter: ">=0.3.0 <2.0.0"
pubspec.yaml
浏览文件 @
974179c3
...
...
@@ -19,6 +19,7 @@ environment:
dependencies
:
flutter
:
sdk
:
flutter
oktoast
:
^2.1.7
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论