Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
F
flutter_clx_base
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
flutter_clx_base
Commits
5ff3495c
提交
5ff3495c
authored
3月 14, 2023
作者:
shixiaochen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、设置SafeArea
上级
d170917d
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
24 行增加
和
28 行删除
+24
-28
my_refresh_list_public.dart
lib/widget/my_refresh_list_public.dart
+12
-12
my_scaffold.dart
lib/widget/my_scaffold.dart
+11
-15
my_scroll_view.dart
lib/widget/my_scroll_view.dart
+1
-1
没有找到文件。
lib/widget/my_refresh_list_public.dart
浏览文件 @
5ff3495c
import
'dart:io'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'state_layout.dart'
;
/// 封装下拉刷新与加载更多
...
...
@@ -146,18 +148,16 @@ class _MyListViewPublicState extends State<MyListViewPublic> {
),
),
);
return
SafeArea
(
child:
NotificationListener
(
onNotification:
(
ScrollNotification
note
)
{
/// 确保是垂直方向滚动,且滑动至底部
if
(
note
.
metrics
.
pixels
==
note
.
metrics
.
maxScrollExtent
&&
note
.
metrics
.
axis
==
Axis
.
vertical
)
{
_loadMore
();
}
return
true
;
},
child:
child
,
),
return
NotificationListener
(
onNotification:
(
ScrollNotification
note
)
{
/// 确保是垂直方向滚动,且滑动至底部
if
(
note
.
metrics
.
pixels
==
note
.
metrics
.
maxScrollExtent
&&
note
.
metrics
.
axis
==
Axis
.
vertical
)
{
_loadMore
();
}
return
true
;
},
child:
child
,
);
}
...
...
lib/widget/my_scaffold.dart
浏览文件 @
5ff3495c
import
'package:flutter/material.dart'
;
import
'package:keyboard_actions/keyboard_actions.dart'
;
import
'my_app_bar.dart'
;
import
'my_scroll_view.dart'
;
...
...
@@ -34,23 +35,18 @@ class MyScaffold extends StatelessWidget {
return
Scaffold
(
appBar:
appBar
??
MyPageAppBar
(
title:
title
),
backgroundColor:
backgroundColor
??
const
Color
(
0xFFf2f3f3
),
body:
_getBodyWidget
(),
body:
SafeArea
(
child:
body
??
MyScrollView
(
padding:
padding
,
bottomButton:
bottomButton
,
crossAxisAlignment:
crossAxisAlignment
,
keyboardConfig:
keyboardConfig
,
children:
children
??
[],
),
),
floatingActionButton:
floatingActionButton
,
);
}
_getBodyWidget
()
{
if
(
body
!=
null
)
{
return
SafeArea
(
child:
body
!);
}
else
{
return
MyScrollView
(
padding:
padding
,
bottomButton:
bottomButton
,
crossAxisAlignment:
crossAxisAlignment
,
keyboardConfig:
keyboardConfig
,
children:
children
??
[],
);
}
}
}
lib/widget/my_scroll_view.dart
浏览文件 @
5ff3495c
...
...
@@ -71,7 +71,7 @@ class MyScrollView extends StatelessWidget {
contents
=
Column
(
children:
<
Widget
>[
Expanded
(
child:
contents
),
SafeArea
(
child:
bottomButton
!)
bottomButton
!
],
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论