Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
F
Flutter_app
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
梁佳霖
Flutter_app
Commits
8ee3be51
提交
8ee3be51
authored
3月 14, 2020
作者:
liangjialin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增Demo、Toask工具类
上级
90444998
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
184 行增加
和
38 行删除
+184
-38
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
+14
-12
router_path.dart
lib/router_path.dart
+4
-1
pubspec.lock
pubspec.lock
+33
-25
pubspec.yaml
pubspec.yaml
+1
-0
没有找到文件。
lib/liangjialin/liangjialin.dart
浏览文件 @
8ee3be51
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutterpro/liangjialin/liangjialin_container.dart'
;
import
'package:flutterpro/liangjialin/liangjialin_container.dart'
;
import
'package:flutterpro/liangjialin/liangjialin_router_widget.dart'
;
import
'liangjialin_image.dart'
;
import
'liangjialin_image.dart'
;
import
'liangjialin_image_local.dart'
;
import
'liangjialin_image_local.dart'
;
...
@@ -55,6 +56,17 @@ class LiangjialinHome extends StatelessWidget {
...
@@ -55,6 +56,17 @@ class LiangjialinHome extends StatelessWidget {
));
));
},
},
child:
Text
(
"Scaffold、Container、padding演示"
),
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
浏览文件 @
8ee3be51
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
浏览文件 @
8ee3be51
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutterpro/router_path.dart'
;
import
'package:flutterpro/router_path.dart'
;
import
'package:flutterpro/yangjunlei/yangjunlei.dart'
;
import
'package:flutterpro/yangjunlei/yangjunlei.dart'
;
import
'package:oktoast/oktoast.dart'
;
import
'dingbaojie/FirstDay/DbjMain.dart'
;
import
'dingbaojie/FirstDay/DbjMain.dart'
;
import
'jiexifeng/jiexifeng.dart'
;
import
'jiexifeng/jiexifeng.dart'
;
...
@@ -14,14 +15,16 @@ class MyApp extends StatelessWidget {
...
@@ -14,14 +15,16 @@ class MyApp extends StatelessWidget {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
// TODO: implement build
// TODO: implement build
return
new
MaterialApp
(
return
OKToast
(
home:
new
Scaffold
(
child:
new
MaterialApp
(
appBar:
AppBar
(
home:
new
Scaffold
(
title:
Text
(
"原生开发组Flutter学习成果展示"
),
appBar:
AppBar
(
title:
Text
(
"原生开发组Flutter学习成果展示"
),
),
body:
MyAppBody
(),
),
routes:
RouterPath
.
generateRoute
(),
),
),
body:
MyAppBody
(),
),
routes:
Router
.
generateRoute
(),
);
);
}
}
}
}
...
@@ -75,11 +78,10 @@ class MyAppBody extends StatelessWidget {
...
@@ -75,11 +78,10 @@ class MyAppBody extends StatelessWidget {
color:
Theme
.
of
(
context
).
primaryColor
,
color:
Theme
.
of
(
context
).
primaryColor
,
textColor:
Colors
.
white
,
textColor:
Colors
.
white
,
onPressed:
()
{
onPressed:
()
{
Navigator
.
push
(
Navigator
.
pushNamed
(
context
,
RouterName
.
liangjialin
,
arguments:
<
String
,
String
>{
context
,
'city'
:
'Berlin'
,
MaterialPageRoute
(
'country'
:
'Germany'
,
builder:
(
context
)
=>
liangjialin
(),
});
));
},
},
child:
Text
(
"梁佳霖"
),
child:
Text
(
"梁佳霖"
),
),
),
...
...
lib/router_path.dart
浏览文件 @
8ee3be51
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutterpro/liangjialin/liangjialin_container.dart'
;
import
'package:flutterpro/liangjialin/liangjialin_container.dart'
;
import
'package:flutterpro/liangjialin/liangjialin_router_widget.dart'
;
import
'package:flutterpro/yangjunlei/yangjunlei.dart'
;
import
'package:flutterpro/yangjunlei/yangjunlei.dart'
;
import
'dingbaojie/FirstDay/PaddingDemo.dart'
;
import
'dingbaojie/FirstDay/PaddingDemo.dart'
;
...
@@ -17,9 +18,10 @@ class RouterName {
...
@@ -17,9 +18,10 @@ class RouterName {
static
const
String
image_liangjialin
=
'liangjialin/image'
;
static
const
String
image_liangjialin
=
'liangjialin/image'
;
static
const
String
image_liangjialin_local
=
'liangjialin/image_local'
;
static
const
String
image_liangjialin_local
=
'liangjialin/image_local'
;
static
const
String
liangjialin_container
=
'liangjialin/container'
;
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
()
{
static
Map
<
String
,
WidgetBuilder
>
generateRoute
()
{
Map
<
String
,
WidgetBuilder
>
routes
=
{
Map
<
String
,
WidgetBuilder
>
routes
=
{
RouterName
.
dingbaojie
:
(
context
)
=>
new
PaddingDemo
(),
RouterName
.
dingbaojie
:
(
context
)
=>
new
PaddingDemo
(),
...
@@ -29,6 +31,7 @@ class Router {
...
@@ -29,6 +31,7 @@ class Router {
RouterName
.
image_liangjialin
:
(
context
)
=>
new
liangjialin_image
(),
RouterName
.
image_liangjialin
:
(
context
)
=>
new
liangjialin_image
(),
RouterName
.
image_liangjialin_local
:
(
context
)
=>
new
liangjialin_image_local
(),
RouterName
.
image_liangjialin_local
:
(
context
)
=>
new
liangjialin_image_local
(),
RouterName
.
liangjialin_container
:
(
context
)
=>
new
liangjialin_container
(),
RouterName
.
liangjialin_container
:
(
context
)
=>
new
liangjialin_container
(),
RouterName
.
liangjialin_router_widget
:
(
context
)
=>
new
liangjialin_router_widget
(),
};
};
return
routes
;
return
routes
;
}
}
...
...
pubspec.lock
浏览文件 @
8ee3be51
...
@@ -5,63 +5,63 @@ packages:
...
@@ -5,63 +5,63 @@ packages:
dependency: transitive
dependency: transitive
description:
description:
name: archive
name: archive
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "2.0.11"
version: "2.0.11"
args:
args:
dependency: transitive
dependency: transitive
description:
description:
name: args
name: args
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.5.2"
version: "1.5.2"
async:
async:
dependency: transitive
dependency: transitive
description:
description:
name: async
name: async
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "2.4.0"
version: "2.4.0"
boolean_selector:
boolean_selector:
dependency: transitive
dependency: transitive
description:
description:
name: boolean_selector
name: boolean_selector
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.0.5"
version: "1.0.5"
charcode:
charcode:
dependency: transitive
dependency: transitive
description:
description:
name: charcode
name: charcode
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.1.2"
version: "1.1.2"
collection:
collection:
dependency: transitive
dependency: transitive
description:
description:
name: collection
name: collection
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.14.11"
version: "1.14.11"
convert:
convert:
dependency: transitive
dependency: transitive
description:
description:
name: convert
name: convert
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "2.1.1"
version: "2.1.1"
crypto:
crypto:
dependency: transitive
dependency: transitive
description:
description:
name: crypto
name: crypto
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "2.1.3"
version: "2.1.3"
cupertino_icons:
cupertino_icons:
dependency: "direct main"
dependency: "direct main"
description:
description:
name: cupertino_icons
name: cupertino_icons
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "0.1.3"
version: "0.1.3"
flutter:
flutter:
...
@@ -78,49 +78,56 @@ packages:
...
@@ -78,49 +78,56 @@ packages:
dependency: transitive
dependency: transitive
description:
description:
name: image
name: image
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "2.1.4"
version: "2.1.4"
matcher:
matcher:
dependency: transitive
dependency: transitive
description:
description:
name: matcher
name: matcher
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "0.12.6"
version: "0.12.6"
meta:
meta:
dependency: transitive
dependency: transitive
description:
description:
name: meta
name: meta
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.1.8"
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:
path:
dependency: transitive
dependency: transitive
description:
description:
name: path
name: path
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.6.4"
version: "1.6.4"
pedantic:
pedantic:
dependency: transitive
dependency: transitive
description:
description:
name: pedantic
name: pedantic
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.8.0+1"
version: "1.8.0+1"
petitparser:
petitparser:
dependency: transitive
dependency: transitive
description:
description:
name: petitparser
name: petitparser
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "2.4.0"
version: "2.4.0"
quiver:
quiver:
dependency: transitive
dependency: transitive
description:
description:
name: quiver
name: quiver
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "2.0.5"
version: "2.0.5"
sky_engine:
sky_engine:
...
@@ -132,64 +139,65 @@ packages:
...
@@ -132,64 +139,65 @@ packages:
dependency: transitive
dependency: transitive
description:
description:
name: source_span
name: source_span
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.5.5"
version: "1.5.5"
stack_trace:
stack_trace:
dependency: transitive
dependency: transitive
description:
description:
name: stack_trace
name: stack_trace
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.9.3"
version: "1.9.3"
stream_channel:
stream_channel:
dependency: transitive
dependency: transitive
description:
description:
name: stream_channel
name: stream_channel
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "2.0.0"
version: "2.0.0"
string_scanner:
string_scanner:
dependency: transitive
dependency: transitive
description:
description:
name: string_scanner
name: string_scanner
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.0.5"
version: "1.0.5"
term_glyph:
term_glyph:
dependency: transitive
dependency: transitive
description:
description:
name: term_glyph
name: term_glyph
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.1.0"
version: "1.1.0"
test_api:
test_api:
dependency: transitive
dependency: transitive
description:
description:
name: test_api
name: test_api
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "0.2.11"
version: "0.2.11"
typed_data:
typed_data:
dependency: transitive
dependency: transitive
description:
description:
name: typed_data
name: typed_data
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.1.6"
version: "1.1.6"
vector_math:
vector_math:
dependency: transitive
dependency: transitive
description:
description:
name: vector_math
name: vector_math
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "2.0.8"
version: "2.0.8"
xml:
xml:
dependency: transitive
dependency: transitive
description:
description:
name: xml
name: xml
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "3.5.0"
version: "3.5.0"
sdks:
sdks:
dart: ">=2.4.0 <3.0.0"
dart: ">=2.4.0 <3.0.0"
flutter: ">=0.3.0 <2.0.0"
pubspec.yaml
浏览文件 @
8ee3be51
...
@@ -19,6 +19,7 @@ environment:
...
@@ -19,6 +19,7 @@ environment:
dependencies
:
dependencies
:
flutter
:
flutter
:
sdk
:
flutter
sdk
:
flutter
oktoast
:
^2.1.7
# The following adds the Cupertino Icons font to your application.
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
# Use with the CupertinoIcons class for iOS style icons.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论