Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
DoraemonKit
提交
65fe89b8
D
DoraemonKit
项目概览
DiDi
/
DoraemonKit
12 个月 前同步成功
通知
166
Star
19623
Fork
3062
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DoraemonKit
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
65fe89b8
编写于
5月 12, 2021
作者:
L
linusflow
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
适配flutter2.0新的api
上级
50d27691
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
90 addition
and
74 deletion
+90
-74
Flutter/example/lib/main.dart
Flutter/example/lib/main.dart
+26
-8
Flutter/example/pubspec.yaml
Flutter/example/pubspec.yaml
+1
-1
Flutter/lib/dokit.dart
Flutter/lib/dokit.dart
+10
-9
Flutter/lib/engine/dokit_binding.dart
Flutter/lib/engine/dokit_binding.dart
+1
-2
Flutter/lib/engine/dokit_http.dart
Flutter/lib/engine/dokit_http.dart
+9
-16
Flutter/lib/kit/apm/apm.dart
Flutter/lib/kit/apm/apm.dart
+1
-1
Flutter/lib/kit/apm/http_kit.dart
Flutter/lib/kit/apm/http_kit.dart
+1
-1
Flutter/lib/kit/apm/log_kit.dart
Flutter/lib/kit/apm/log_kit.dart
+5
-7
Flutter/lib/kit/apm/memory_kit.dart
Flutter/lib/kit/apm/memory_kit.dart
+7
-7
Flutter/lib/kit/apm/method_channel_kit.dart
Flutter/lib/kit/apm/method_channel_kit.dart
+0
-1
Flutter/lib/kit/apm/route_kit.dart
Flutter/lib/kit/apm/route_kit.dart
+1
-1
Flutter/lib/kit/common/common.dart
Flutter/lib/kit/common/common.dart
+2
-2
Flutter/lib/kit/visual/visual.dart
Flutter/lib/kit/visual/visual.dart
+0
-2
Flutter/lib/ui/dokit_app.dart
Flutter/lib/ui/dokit_app.dart
+10
-6
Flutter/lib/ui/dokit_btn.dart
Flutter/lib/ui/dokit_btn.dart
+8
-4
Flutter/lib/ui/kit_page.dart
Flutter/lib/ui/kit_page.dart
+0
-1
Flutter/lib/widget/dash_decoration.dart
Flutter/lib/widget/dash_decoration.dart
+8
-5
未找到文件。
Flutter/example/lib/main.dart
浏览文件 @
65fe89b8
...
...
@@ -29,7 +29,7 @@ void main() {
app:
DoKitApp
(
MyApp
()),
useInRelease:
true
,
logCallback:
(
log
)
{
String
i
=
log
;
//
String i = log;
},
methodChannelBlackList:
blackList
,
exceptionCallback:
(
dynamic
obj
,
StackTrace
trace
)
{
...
...
@@ -106,7 +106,7 @@ class _DoKitTestPageState extends State<DoKitTestPage> {
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
4
)),
color:
Color
(
0xffcccccc
)),
margin:
EdgeInsets
.
only
(
bottom:
30
),
child:
Fla
tButton
(
child:
Tex
tButton
(
child:
Text
(
'Mock Http Post'
,
style:
TextStyle
(
color:
Color
(
0xff000000
),
...
...
@@ -120,7 +120,10 @@ class _DoKitTestPageState extends State<DoKitTestPage> {
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
4
)),
color:
Color
(
0xffcccccc
)),
margin:
EdgeInsets
.
only
(
bottom:
30
),
child:
FlatButton
(
child:
TextButton
(
style:
ButtonStyle
(
padding:
MaterialStateProperty
.
all
(
EdgeInsets
.
all
(
0
)),
),
child:
Text
(
'Mock Http Get'
,
style:
TextStyle
(
color:
Color
(
0xff000000
),
...
...
@@ -134,7 +137,10 @@ class _DoKitTestPageState extends State<DoKitTestPage> {
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
4
)),
color:
Color
(
0xffcccccc
)),
margin:
EdgeInsets
.
only
(
bottom:
30
),
child:
FlatButton
(
child:
TextButton
(
style:
ButtonStyle
(
padding:
MaterialStateProperty
.
all
(
EdgeInsets
.
all
(
0
)),
),
child:
Text
(
'Test Download'
,
style:
TextStyle
(
color:
Color
(
0xff000000
),
...
...
@@ -148,7 +154,10 @@ class _DoKitTestPageState extends State<DoKitTestPage> {
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
4
)),
color:
Color
(
0xffcccccc
)),
margin:
EdgeInsets
.
only
(
bottom:
30
),
child:
FlatButton
(
child:
TextButton
(
style:
ButtonStyle
(
padding:
MaterialStateProperty
.
all
(
EdgeInsets
.
all
(
0
)),
),
child:
Text
(
'Test Method Channel'
,
style:
TextStyle
(
color:
Color
(
0xff000000
),
...
...
@@ -164,7 +173,10 @@ class _DoKitTestPageState extends State<DoKitTestPage> {
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
4
)),
color:
Color
(
0xffcccccc
)),
margin:
EdgeInsets
.
only
(
bottom:
30
),
child:
FlatButton
(
child:
TextButton
(
style:
ButtonStyle
(
padding:
MaterialStateProperty
.
all
(
EdgeInsets
.
all
(
0
)),
),
child:
Text
(
'Open Route Page'
,
style:
TextStyle
(
color:
Color
(
0xff000000
),
...
...
@@ -187,7 +199,10 @@ class _DoKitTestPageState extends State<DoKitTestPage> {
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
4
)),
color:
Color
(
0xffcccccc
)),
margin:
EdgeInsets
.
only
(
bottom:
30
),
child:
FlatButton
(
child:
TextButton
(
style:
ButtonStyle
(
padding:
MaterialStateProperty
.
all
(
EdgeInsets
.
all
(
0
)),
),
child:
Text
(
'Test Get Page Script'
,
style:
TextStyle
(
color:
Color
(
0xff000000
),
...
...
@@ -203,7 +218,10 @@ class _DoKitTestPageState extends State<DoKitTestPage> {
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
4
)),
color:
Color
(
0xffcccccc
)),
margin:
EdgeInsets
.
only
(
bottom:
30
),
child:
FlatButton
(
child:
TextButton
(
style:
ButtonStyle
(
padding:
MaterialStateProperty
.
all
(
EdgeInsets
.
all
(
0
)),
),
child:
Text
(
'Stop Timer'
,
style:
TextStyle
(
color:
Color
(
0xff000000
),
...
...
Flutter/example/pubspec.yaml
浏览文件 @
65fe89b8
name
:
dokit_demo
description
:
dokit测试工程
version
:
0.
0.1
version
:
0.
8.0
homepage
:
http://flutter.intra.xiaojukeji.com/index.php
environment
:
...
...
Flutter/lib/dokit.dart
浏览文件 @
65fe89b8
// Copyright© Dokit for Flutter.
// Copyright© Dokit for Flutter.
All rights reserved.
//
// dokit.dart
// Flutter
//
// Created by linusflow on 2021/3/05
// Modified by linusflow on 2021/5/12 下午
2:05
// Modified by linusflow on 2021/5/12 下午
3:47
//
import
'dart:async'
;
...
...
@@ -69,12 +69,19 @@ class DoKit {
return
;
}
blackList
=
methodChannelBlackList
;
await
runZoned
(
await
runZonedGuarded
(
()
async
=>
<
void
>{
_ensureDoKitBinding
(
useInRelease:
useInRelease
),
_runWrapperApp
(
app
!=
null
?
app
:
await
appCreator
!()),
_zone
=
Zone
.
current
},
(
Object
obj
,
StackTrace
stack
)
{
_collectError
(
obj
,
stack
);
if
(
exceptionCallback
!=
null
)
{
_zone
?.
runBinary
(
exceptionCallback
,
obj
,
stack
);
}
},
zoneSpecification:
ZoneSpecification
(
print:
(
Zone
self
,
ZoneDelegate
parent
,
Zone
zone
,
String
line
)
{
_collectLog
(
line
);
//手机日志
...
...
@@ -84,12 +91,6 @@ class DoKit {
}
},
),
onError:
(
Object
obj
,
StackTrace
stack
)
{
_collectError
(
obj
,
stack
);
if
(
exceptionCallback
!=
null
)
{
_zone
?.
runBinary
(
exceptionCallback
,
obj
,
stack
);
}
},
);
}
}
...
...
Flutter/lib/engine/dokit_binding.dart
浏览文件 @
65fe89b8
...
...
@@ -24,8 +24,7 @@ class DoKitWidgetsFlutterBinding extends WidgetsFlutterBinding
mixin
DoKitServicesBinding
on
BindingBase
,
ServicesBinding
{
@override
BinaryMessenger
createBinaryMessenger
()
{
return
DoKitBinaryMessenger
(
super
.
createBinaryMessenger
()
as
BinaryMessenger
);
return
DoKitBinaryMessenger
(
super
.
createBinaryMessenger
());
}
}
...
...
Flutter/lib/engine/dokit_http.dart
浏览文件 @
65fe89b8
...
...
@@ -5,6 +5,7 @@ import 'dart:typed_data';
import
'package:dokit/kit/apm/apm.dart'
;
import
'package:dokit/kit/apm/http_kit.dart'
;
import
'package:pedantic/pedantic.dart'
;
class
DoKitHttpOverrides
extends
HttpOverrides
{
DoKitHttpOverrides
(
this
.
origin
);
...
...
@@ -26,7 +27,6 @@ class DoKitHttpOverrides extends HttpOverrides {
class
DoKitHttpClient
implements
HttpClient
{
DoKitHttpClient
(
this
.
origin
);
final
HttpClient
origin
;
HttpInfo
?
httpInfo
;
...
...
@@ -45,7 +45,6 @@ class DoKitHttpClient implements HttpClient {
@override
set
connectionTimeout
(
Duration
?
value
)
=>
origin
.
connectionTimeout
=
value
;
@override
Duration
?
get
connectionTimeout
=>
origin
.
connectionTimeout
;
...
...
@@ -74,7 +73,8 @@ class DoKitHttpClient implements HttpClient {
}
@override
set
authenticate
(
Future
<
bool
>
Function
(
Uri
url
,
String
scheme
,
String
realm
)?
f
)
{
set
authenticate
(
Future
<
bool
>
Function
(
Uri
url
,
String
scheme
,
String
realm
)?
f
)
{
origin
.
authenticate
=
f
;
}
...
...
@@ -102,13 +102,13 @@ class DoKitHttpClient implements HttpClient {
}
Future
<
HttpClientRequest
>
monitor
(
Future
<
HttpClientRequest
>
future
)
async
{
future
.
catchError
((
dynamic
error
,
[
StackTrace
?
stackTrace
])
{
unawaited
(
future
.
catchError
((
dynamic
error
,
[
StackTrace
?
stackTrace
])
{
if
(
httpInfo
==
null
)
{
httpInfo
=
HttpInfo
.
error
(
error
.
toString
());
final
HttpKit
?
kit
=
ApmKitManager
.
instance
.
getKit
(
ApmKitName
.
KIT_HTTP
);
kit
?.
save
(
httpInfo
);
}
});
})
)
;
final
HttpClientRequest
request
=
await
future
;
httpInfo
??=
HttpInfo
(
request
.
uri
,
request
.
method
);
final
HttpKit
?
kit
=
ApmKitManager
.
instance
.
getKit
(
ApmKitName
.
KIT_HTTP
);
...
...
@@ -281,9 +281,7 @@ class DoKitHttpClientRequest implements HttpClientRequest {
void
recordParameter
(
List
<
int
>
data
)
{
try
{
httpInfo
?.
request
.
header
=
headers
.
toString
();
if
(
encoding
!=
null
)
{
httpInfo
?.
request
.
add
(
encoding
.
decode
(
data
));
}
httpInfo
?.
request
.
add
(
encoding
.
decode
(
data
));
}
catch
(
e
)
{
print
(
e
);
}
...
...
@@ -353,12 +351,11 @@ class DoKitHttpClientResponse implements HttpClientResponse {
return
origin
.
asBroadcastStream
(
onListen:
onListen
,
onCancel:
onCancel
);
}
@override
Stream
<
E
>
asyncExpand
<
E
>(
Stream
<
E
>?
Function
(
List
<
int
>
event
)
convert
)
{
return
asyncExpand
(
convert
);
}
@override
Stream
<
E
>
asyncMap
<
E
>(
FutureOr
<
E
>
Function
(
List
<
int
>
event
)
convert
)
{
return
asyncMap
(
convert
);
...
...
@@ -430,7 +427,6 @@ class DoKitHttpClientResponse implements HttpClientResponse {
return
origin
.
firstWhere
(
test
,
orElse:
orElse
);
}
@override
Future
<
S
>
fold
<
S
>(
S
initialValue
,
S
Function
(
S
previous
,
List
<
int
>
element
)
combine
)
{
...
...
@@ -478,8 +474,7 @@ class DoKitHttpClientResponse implements HttpClientResponse {
Future
<
int
>
get
length
=>
origin
.
length
;
bool
isTextResponse
()
{
return
headers
!=
null
&&
headers
[
'content-type'
]
!=
null
&&
return
headers
[
'content-type'
]
!=
null
&&
(
headers
[
'content-type'
].
toString
().
contains
(
'json'
)
||
headers
[
'content-type'
].
toString
().
contains
(
'text'
)
||
headers
[
'content-type'
].
toString
().
contains
(
'xml'
));
...
...
@@ -487,9 +482,7 @@ class DoKitHttpClientResponse implements HttpClientResponse {
Encoding
?
getEncoding
()
{
String
charset
;
if
(
headers
.
contentType
!=
null
&&
headers
.
contentType
?.
charset
!=
null
)
{
if
(
headers
.
contentType
!=
null
&&
headers
.
contentType
?.
charset
!=
null
)
{
charset
=
headers
.
contentType
!.
charset
!;
}
else
{
charset
=
'utf-8'
;
...
...
Flutter/lib/kit/apm/apm.dart
浏览文件 @
65fe89b8
...
...
@@ -22,7 +22,7 @@ class ApmKitManager {
ApmKitName
.
KIT_PAGE_LAUNCH
:
PageLaunchKit
()
};
ApmKitManager
.
_privateConstructor
()
{}
ApmKitManager
.
_privateConstructor
()
;
static
final
ApmKitManager
_instance
=
ApmKitManager
.
_privateConstructor
();
...
...
Flutter/lib/kit/apm/http_kit.dart
浏览文件 @
65fe89b8
...
...
@@ -278,7 +278,7 @@ class _HttpItemWidgetState extends State<HttpItemWidget> {
onLongPress:
()
{
if
(
widget
.
item
.
response
.
result
!=
null
)
{
Clipboard
.
setData
(
ClipboardData
(
text:
widget
.
item
.
response
.
result
));
Scaffold
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
Scaffold
Messenger
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
duration:
Duration
(
milliseconds:
500
),
content:
Text
(
'请求返回已拷贝至剪贴板'
),
));
...
...
Flutter/lib/kit/apm/log_kit.dart
浏览文件 @
65fe89b8
...
...
@@ -330,7 +330,7 @@ class _LogItemWidgetState extends State<LogItemWidget> {
return
GestureDetector
(
onLongPress:
()
{
Clipboard
.
setData
(
ClipboardData
(
text:
widget
.
item
.
msg
));
Scaffold
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
Scaffold
Messenger
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
duration:
Duration
(
milliseconds:
500
),
content:
Text
(
'已拷贝至剪贴板'
),
));
...
...
@@ -342,12 +342,10 @@ class _LogItemWidgetState extends State<LogItemWidget> {
(
SharedPreferences
prefs
)
{
if
(!
prefs
.
containsKey
(
KEY_SHOW_LOG_EXPAND_TIPS
))
{
prefs
.
setBool
(
KEY_SHOW_LOG_EXPAND_TIPS
,
true
);
Scaffold
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
duration:
Duration
(
milliseconds:
2000
),
content:
Text
(
'日志超过7行时,点击可展开日志详情'
),
),
);
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
duration:
Duration
(
milliseconds:
2000
),
content:
Text
(
'日志超过7行时,点击可展开日志详情'
),
));
}
},
);
...
...
Flutter/lib/kit/apm/memory_kit.dart
浏览文件 @
65fe89b8
...
...
@@ -127,8 +127,7 @@ class MemoryPageState extends State<MemoryPage> {
return
Container
(
margin:
EdgeInsets
.
only
(
top:
3
),
alignment:
Alignment
.
topLeft
,
child:
VmHelper
.
instance
.
memoryInfo
!=
null
&&
VmHelper
.
instance
.
memoryInfo
.
length
>
0
child:
VmHelper
.
instance
.
memoryInfo
.
isNotEmpty
?
Column
(
children:
getMemoryInfo
(
VmHelper
.
instance
.
memoryInfo
))
...
...
@@ -161,7 +160,7 @@ class MemoryPageState extends State<MemoryPage> {
style:
TextStyle
(
color:
Color
(
0xff333333
),
fontSize:
16
),
inputFormatters:
[
BlacklistingTextInputFormatter
(
RegExp
(
FilteringTextInputFormatter
.
deny
(
RegExp
(
'[^
\\
u0020-
\\
u007E
\\
u00A0-
\\
u00BE
\\
u2E80-
\\
uA4CF
\\
uF900-
\\
uFAFF
\\
uFE30-
\\
uFE4F
\\
uFF00-
\\
uFFEF
\\
u0080-
\\
u009F
\\
u2000-
\\
u201f
\r\n
]'
))
],
onSubmitted:
(
value
)
=>
{
filterAllocations
()},
...
...
@@ -176,9 +175,11 @@ class MemoryPageState extends State<MemoryPage> {
),
Container
(
width:
60
,
child:
FlatButton
(
padding:
EdgeInsets
.
only
(
left:
15
,
right:
0
,
top:
15
,
bottom:
15
),
child:
TextButton
(
style:
ButtonStyle
(
padding:
MaterialStateProperty
.
all
(
EdgeInsets
.
only
(
left:
15
,
right:
0
,
top:
15
,
bottom:
15
)),
),
child:
Image
.
asset
(
'images/dk_memory_search.png'
,
package:
DK_PACKAGE_NAME
,
height:
16
,
width:
16
),
onPressed:
filterAllocations
,
...
...
@@ -255,7 +256,6 @@ class MemoryPageState extends State<MemoryPage> {
void
filterAllocations
()
{
String
className
=
editingController
.
text
;
assert
(
className
!=
null
);
heaps
.
clear
();
if
(
className
.
length
>=
3
&&
kit
?.
getAllocationProfile
()
!=
null
)
{
kit
?.
getAllocationProfile
()?.
members
?.
forEach
((
element
)
{
...
...
Flutter/lib/kit/apm/method_channel_kit.dart
浏览文件 @
65fe89b8
...
...
@@ -45,7 +45,6 @@ class ChannelInfo implements IInfo {
'method:
${method}
\n
'
+
'arguments:
${arguments}
\n
'
+
'results:
${results}
'
;
;
}
factory
ChannelInfo
.
error
(
String
channelName
,
int
type
)
{
...
...
Flutter/lib/kit/apm/route_kit.dart
浏览文件 @
65fe89b8
...
...
@@ -214,7 +214,7 @@ class RouteInfoPageState extends State<RouteInfoPage> {
final
NavigatorState
?
navigatorState
=
element
.
findAncestorStateOfType
<
NavigatorState
>();
if
(
navigatorState
!=
null
&&
navigatorState
.
context
!=
null
)
{
if
(
navigatorState
!=
null
)
{
final
RouteInfo
parent
=
RouteInfo
();
parent
.
current
=
ModalRoute
.
of
(
navigatorState
.
context
);
routeInfo
.
parent
=
parent
;
...
...
Flutter/lib/kit/common/common.dart
浏览文件 @
65fe89b8
...
...
@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
abstract
class
CommonKit
implements
IKit
{
@override
void
tabAction
()
{
// ignore: invalid_use_of_protected_member
ResidentPage
.
residentPageKey
.
currentState
?.
setState
(()
{
ResidentPage
.
tag
=
getKitName
();
});
...
...
@@ -20,7 +21,7 @@ class CommonKitManager {
CommonKitName
.
KIT_BASIC_INFO
:
BasicInfoKit
(),
};
CommonKitManager
.
_privateConstructor
()
{}
CommonKitManager
.
_privateConstructor
()
;
static
final
CommonKitManager
_instance
=
CommonKitManager
.
_privateConstructor
();
...
...
@@ -29,7 +30,6 @@ class CommonKitManager {
// 如果想要自定义实现,可以用这个方式进行覆盖。后续扩展入口
void
addKit
(
String
tag
,
CommonKit
kit
)
{
assert
(
tag
!=
null
&&
kit
!=
null
);
kitMap
[
tag
]
=
kit
;
}
...
...
Flutter/lib/kit/visual/visual.dart
浏览文件 @
65fe89b8
...
...
@@ -36,12 +36,10 @@ class VisualKitManager {
// 如果想要自定义实现,可以用这个方式进行覆盖。后续扩展入口
void
addKit
(
String
tag
,
IKit
kit
)
{
assert
(
tag
!=
null
&&
kit
!=
null
);
kitMap
[
tag
]
=
kit
;
}
T
?
getKit
<
T
extends
IKit
>(
String
name
)
{
assert
(
name
!=
null
);
if
(
kitMap
.
containsKey
(
name
))
{
return
kitMap
[
name
]
as
T
;
}
...
...
Flutter/lib/ui/dokit_app.dart
浏览文件 @
65fe89b8
...
...
@@ -104,12 +104,16 @@ class _DoKitAppState extends State<DoKitApp> {
children:
<
Widget
>[
widget
.
origin
,
_MediaQueryFromWindow
(
child:
Localizations
(
locale:
supportedLocales
.
first
,
delegates:
_localizationsDelegates
.
toList
(),
child:
Overlay
(
key:
doKitOverlayKey
,
)))
child:
Localizations
(
locale:
supportedLocales
.
first
,
delegates:
_localizationsDelegates
.
toList
(),
child:
ScaffoldMessenger
(
child:
Overlay
(
key:
doKitOverlayKey
,
),
),
),
)
],
),
);
...
...
Flutter/lib/ui/dokit_btn.dart
浏览文件 @
65fe89b8
...
...
@@ -47,8 +47,10 @@ class DoKitBtnState extends State<DoKitBtn> {
width:
70
,
height:
70
,
alignment:
Alignment
.
center
,
child:
FlatButton
(
padding:
const
EdgeInsets
.
all
(
0
),
child:
TextButton
(
style:
ButtonStyle
(
padding:
MaterialStateProperty
.
all
(
EdgeInsets
.
all
(
0
)),
),
child:
Image
.
asset
(
'images/dokit_flutter_btn.png'
,
package:
DK_PACKAGE_NAME
,
height:
70
,
width:
70
),
onPressed:
openDebugPage
,
...
...
@@ -58,8 +60,10 @@ class DoKitBtnState extends State<DoKitBtn> {
width:
70
,
height:
70
,
alignment:
Alignment
.
center
,
child:
FlatButton
(
padding:
const
EdgeInsets
.
all
(
0
),
child:
TextButton
(
style:
ButtonStyle
(
padding:
MaterialStateProperty
.
all
(
EdgeInsets
.
all
(
0
)),
),
child:
Image
.
asset
(
'images/dokit_flutter_btn.png'
,
package:
DK_PACKAGE_NAME
,
height:
70
,
width:
70
),
onPressed:
openDebugPage
,
...
...
Flutter/lib/ui/kit_page.dart
浏览文件 @
65fe89b8
...
...
@@ -314,7 +314,6 @@ class KitPageManager {
}
bool
removeResidentKit
(
String
tag
)
{
assert
(
tag
!=
null
);
if
(
residentList
.
contains
(
tag
))
{
residentList
.
remove
(
tag
);
SharedPreferences
.
getInstance
().
then
((
SharedPreferences
prefs
)
=>
...
...
Flutter/lib/widget/dash_decoration.dart
浏览文件 @
65fe89b8
...
...
@@ -145,7 +145,7 @@ class DashedDecoration extends Decoration {
final
double
strokeHeight
;
final
double
gap
;
final
Color
?
dashedColor
;
final
bool
dawDashed
;
final
bool
?
dawDashed
;
@override
EdgeInsetsGeometry
?
get
padding
=>
border
?.
dimensions
;
...
...
@@ -333,9 +333,9 @@ class DashedDecoration extends Decoration {
final
Offset
center
=
size
.
center
(
Offset
.
zero
);
final
double
distance
=
(
position
-
center
).
distance
;
return
distance
<=
math
.
min
(
size
.
width
,
size
.
height
)
/
2.0
;
default
:
return
false
;
}
assert
(
shape
!=
null
);
return
false
;
}
@override
...
...
@@ -356,7 +356,6 @@ class _BoxDecorationPainter extends BoxPainter {
Rect
?
_rectForCachedBackgroundPaint
;
Paint
_getBackgroundPaint
(
Rect
rect
,
TextDirection
textDirection
)
{
assert
(
rect
!=
null
);
assert
(
_decoration
.
gradient
!=
null
||
_rectForCachedBackgroundPaint
==
null
);
...
...
@@ -399,6 +398,8 @@ class _BoxDecorationPainter extends BoxPainter {
paint
);
}
break
;
default
:
return
;
}
}
...
...
@@ -443,6 +444,8 @@ class _BoxDecorationPainter extends BoxPainter {
.
toRRect
(
rect
));
}
break
;
default
:
return
;
}
_imagePainter
!.
paint
(
canvas
,
rect
,
clipPath
,
configuration
);
}
...
...
@@ -462,7 +465,7 @@ class _BoxDecorationPainter extends BoxPainter {
_paintShadows
(
canvas
,
rect
,
textDirection
);
_paintBackgroundColor
(
canvas
,
rect
,
textDirection
);
_paintBackgroundImage
(
canvas
,
rect
,
configuration
);
if
(
_decoration
.
dawDashed
!=
null
&&
!
_decoration
.
dawDashed
)
{
if
(
_decoration
.
dawDashed
!=
null
&&
!
(
_decoration
.
dawDashed
??
true
)
)
{
_decoration
.
border
?.
paint
(
canvas
,
rect
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录