Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
浙江兰德纵横网络技术股份有限公司
o2oa-flutter
提交
c91f5a22
O
o2oa-flutter
项目概览
浙江兰德纵横网络技术股份有限公司
/
o2oa-flutter
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
o2oa-flutter
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c91f5a22
编写于
11月 01, 2023
作者:
F
fancy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
应用角标位置调整
上级
67362900
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
55 addition
and
68 deletion
+55
-68
lib/pages/home/apps/view.dart
lib/pages/home/apps/view.dart
+35
-24
lib/pages/home/default_index/widgets/banner_apps.dart
lib/pages/home/default_index/widgets/banner_apps.dart
+20
-44
未找到文件。
lib/pages/home/apps/view.dart
浏览文件 @
c91f5a22
...
...
@@ -169,41 +169,52 @@ class AppsPage extends GetView<AppsController> {
))
:
GestureDetector
(
onTap:
()
=>
controller
.
openApp
(
element
),
child:
badges
.
Badge
(
badgeContent:
Text
(
'
${element.showNumber}
'
,
style:
const
TextStyle
(
color:
Colors
.
white
)),
showBadge:
(
element
.
showNumber
??
0
)
>
0
,
child:
_appItemView
(
context
,
element
),
)));
child:
_appItemView
(
context
,
element
),
));
}
/// 应用 Item
Widget
_appItemView
(
BuildContext
context
,
AppFrontData
element
)
{
Map
<
String
,
String
>
headers
=
{};
headers
[
O2ApiManager
.
instance
.
tokenName
]
=
O2ApiManager
.
instance
.
o2User
?.
token
??
''
;
return
Column
(
children:
[
// Icon图标,原生应用是本地图标,门户应用是url
(
element
.
type
==
O2AppTypeEnum
.
native
)
?
AssetsImageView
(
element
.
nativeEnum
?.
assetPath
??
'app_task.png'
,
width:
36
.
w
,
height:
36
.
w
,
)
:
Image
(
image:
NetworkImage
(
element
.
portalIconUrl
!,
headers:
headers
),
alignment:
Alignment
.
center
,
width:
36
.
w
,
height:
36
.
w
,
fit:
BoxFit
.
fill
),
_appItemImageWithBadges
(
element
),
Expanded
(
flex:
1
,
child:
Center
(
child:
Text
(
element
.
name
??
''
,
softWrap:
true
,
// textAlign: TextAlign.left,
// overflow: TextOverflow.clip,
// maxLines: 1,
style:
Theme
.
of
(
context
).
textTheme
.
bodyMedium
)))
]);
}
/// 应用图标 加上角标
/// 编辑的时候不显示角标
Widget
_appItemImageWithBadges
(
AppFrontData
element
)
{
return
Obx
(()
=>
controller
.
state
.
isEdit
?
_appItemImage
(
element
)
:
badges
.
Badge
(
badgeContent:
Text
(
'
${element.showNumber}
'
,
style:
const
TextStyle
(
color:
Colors
.
white
)),
showBadge:
(
element
.
showNumber
??
0
)
>
0
,
child:
_appItemImage
(
element
)));
}
/// 应用图标
Widget
_appItemImage
(
AppFrontData
element
)
{
Map
<
String
,
String
>
headers
=
{};
headers
[
O2ApiManager
.
instance
.
tokenName
]
=
O2ApiManager
.
instance
.
o2User
?.
token
??
''
;
return
(
element
.
type
==
O2AppTypeEnum
.
native
)
?
AssetsImageView
(
element
.
nativeEnum
?.
assetPath
??
'app_task.png'
,
width:
36
.
w
,
height:
36
.
w
,
)
:
Image
(
image:
NetworkImage
(
element
.
portalIconUrl
!,
headers:
headers
),
alignment:
Alignment
.
center
,
width:
36
.
w
,
height:
36
.
w
,
fit:
BoxFit
.
fill
);
}
}
lib/pages/home/default_index/widgets/banner_apps.dart
浏览文件 @
c91f5a22
...
...
@@ -53,35 +53,10 @@ class BannerAndAppsWidget extends GetView<DefaultIndexController> {
childAspectRatio:
0.8
,
),
itemBuilder:
(
context
,
index
)
{
// if (index == controller.state.myAppList.length) {
// return GestureDetector(
// onTap: () => controller.openMoreApps(),
// child: Column(children: [
// AssetsImageView(
// 'app_more.png',
// width: 36.w,
// height: 36.w,
// ),
// Expanded(
// flex: 1,
// child: Center(
// child: Text('home_index_more_apps'.tr,
// softWrap: true,
// textAlign: TextAlign.left,
// overflow: TextOverflow.ellipsis,
// maxLines: 1,
// style: Theme.of(context).textTheme.bodyMedium)))
// ]));
// } else {
var
app
=
controller
.
state
.
myAppList
[
index
];
return
GestureDetector
(
onTap:
()
=>
controller
.
openApp
(
app
),
child:
badges
.
Badge
(
badgeContent:
Text
(
'
${app?.showNumber}
'
,
style:
const
TextStyle
(
color:
Colors
.
white
)),
showBadge:
(
app
?.
showNumber
??
0
)
>
0
,
child:
_appItemView
(
context
,
app
!)));
// }
var
app
=
controller
.
state
.
myAppList
[
index
];
return
GestureDetector
(
onTap:
()
=>
controller
.
openApp
(
app
),
child:
_appItemView
(
context
,
app
!));
}));
}
...
...
@@ -91,26 +66,27 @@ class BannerAndAppsWidget extends GetView<DefaultIndexController> {
O2ApiManager
.
instance
.
o2User
?.
token
??
''
;
return
Column
(
children:
[
// Icon图标,原生应用是本地图标,门户应用是url
(
element
.
type
==
O2AppTypeEnum
.
native
)
?
AssetsImageView
(
element
.
nativeEnum
?.
assetPath
??
'app_task.png'
,
width:
36
.
w
,
height:
36
.
w
,
)
:
Image
(
image:
NetworkImage
(
element
.
portalIconUrl
!,
headers:
headers
),
alignment:
Alignment
.
center
,
width:
36
.
w
,
height:
36
.
w
,
fit:
BoxFit
.
fill
),
badges
.
Badge
(
badgeContent:
Text
(
'
${element.showNumber}
'
,
style:
const
TextStyle
(
color:
Colors
.
white
)),
showBadge:
(
element
.
showNumber
??
0
)
>
0
,
child:
(
element
.
type
==
O2AppTypeEnum
.
native
)
?
AssetsImageView
(
element
.
nativeEnum
?.
assetPath
??
'app_task.png'
,
width:
36
.
w
,
height:
36
.
w
,
)
:
Image
(
image:
NetworkImage
(
element
.
portalIconUrl
!,
headers:
headers
),
alignment:
Alignment
.
center
,
width:
36
.
w
,
height:
36
.
w
,
fit:
BoxFit
.
fill
)),
Expanded
(
flex:
1
,
child:
Center
(
child:
Text
(
element
.
name
??
''
,
softWrap:
true
,
// textAlign: TextAlign.left,
// overflow: TextOverflow.clip,
// maxLines: 1,
style:
Theme
.
of
(
context
).
textTheme
.
bodyMedium
)))
]);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录