Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
desktop_flutter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林生雨
desktop_flutter
Commits
e2848217
Commit
e2848217
authored
Dec 09, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
14bfc57b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
447 additions
and
127 deletions
+447
-127
HomeModel.dart
lib/HomeModel.dart
+1
-1
BaseTitle.dart
lib/HomeModel/base/BaseTitle.dart
+48
-26
DataCenter.dart
lib/HomeModel/page/data/DataCenter.dart
+1
-1
HomeModel.dart
lib/HomeModel/page/home/HomeModel.dart
+56
-30
HomePage.dart
lib/HomeModel/page/home/HomePage.dart
+16
-8
UploadBean.dart
lib/HomeModel/page/home/UploadBean.dart
+6
-5
UploadHideView.dart
lib/HomeModel/page/home/UploadHideView.dart
+15
-23
PicModel.dart
lib/HomeModel/page/picture/PicModel.dart
+1
-0
WorkModel.dart
lib/HomeModel/page/work/WorkModel.dart
+122
-1
WorkPage.dart
lib/HomeModel/page/work/WorkPage.dart
+0
-0
temp.dart
lib/HomeModel/page/work/temp.dart
+12
-0
HomeRepo.dart
lib/HomeModel/service/HomeRepo.dart
+48
-18
AllTabBean.dart
lib/HomeModel/service/remote/entity/AllTabBean.dart
+0
-0
DetectImgBean.dart
lib/HomeModel/service/remote/entity/DetectImgBean.dart
+23
-0
ImageAiBean.dart
lib/HomeModel/service/remote/entity/ImageAiBean.dart
+50
-1
UploadBean.dart
lib/HomeModel/service/remote/entity/UploadBean.dart
+23
-0
HomePage.dart
lib/HomePage.dart
+7
-1
Persionset.dart
lib/UserModel/page/usermanager/Persionset.dart
+1
-1
BaseState.dart
lib/commonModel/base/BaseState.dart
+6
-0
BaseCenterPicker.dart
lib/commonModel/picker/base/BaseCenterPicker.dart
+1
-1
BasePickerComponent.dart
lib/commonModel/picker/base/BasePickerComponent.dart
+9
-8
ALColors.dart
lib/res/value/ALColors.dart
+1
-2
No files found.
lib/HomeModel.dart
View file @
e2848217
...
...
@@ -33,7 +33,7 @@ class HomeModel extends BaseModel {
void
init
()
{
var
mainWidget
=
RouterCenterImpl
().
findHomeRouter
()?.
getHomePage
();
var
persionPage
=
RouterCenterImpl
().
findUserRouter
()?.
get
Logi
nPage
();
var
persionPage
=
RouterCenterImpl
().
findUserRouter
()?.
get
Persio
nPage
();
var
findPage
=
RouterCenterImpl
().
findHomeRouter
()?.
getDataPage
();
int
index
=
0
;
if
(
mainWidget
!=
null
)
{
...
...
lib/HomeModel/base/BaseTitle.dart
View file @
e2848217
...
...
@@ -281,8 +281,8 @@ class SurePicker implements ICenterPicker {
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
20
))),
width:
3
5
0
,
height:
26
0
,
width:
3
0
0
,
height:
15
0
,
child:
Column
(
children:
<
Widget
>[
Expanded
(
...
...
@@ -291,40 +291,53 @@ class SurePicker implements ICenterPicker {
child:
baseText
(
showText
,
15
,
Colors
.
black
),
),
),
// Container(
// height: 1,
// width: double.maxFinite,
// color: Colors.black54,
// ),
Container
(
height:
1
,
width:
double
.
maxFinite
,
color:
Colors
.
black54
,
),
Container
(
margin:
EdgeInsets
.
only
(
bottom:
10
),
width:
double
.
maxFinite
,
height:
50
,
child:
Row
(
children:
<
Widget
>[
Expanded
(
child:
GestureDetector
(
onTap:
cancel
,
child:
Container
(
color:
Colors
.
transparent
,
alignment:
Alignment
.
center
,
child:
baseText
(
"取消"
,
12
,
Colors
.
black38
),
)),
child:
Container
(),
),
Container
(
width:
1
,
height:
double
.
maxFinite
,
color:
Colors
.
black54
,
FlatButton
(
onPressed:
cancel
,
child:
Container
(
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
all
(
//圆角
Radius
.
circular
(
20.0
),
),
color:
Colors
.
grey
),
width:
80
,
height:
20
,
child:
baseText
(
"取消"
,
13
,
Colors
.
white
),
),
),
Expanded
(
child:
GestureDetector
(
onTap:
sure
,
child:
Container
(
color:
Colors
.
transparent
,
alignment:
Alignment
.
center
,
child:
baseText
(
"确定"
,
12
,
Colors
.
red
),
FlatButton
(
onPressed:
sure
,
child:
Container
(
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
all
(
//圆角
Radius
.
circular
(
20.0
),
),
color:
Colors
.
red
),
width:
80
,
height:
20
,
child:
baseText
(
"确定"
,
13
,
Colors
.
white
),
),
)
),
Expanded
(
child:
Container
(),
),
],
),
)
...
...
@@ -439,3 +452,12 @@ Widget refreshloadingItem(VoidCallback callback) {
);
return
SliverFillViewport
(
delegate:
SliverChildListDelegate
([
loadCircle
]));
}
Widget
baseFlatButtonItem
(
VoidCallback
callback
,
String
text
){
return
FlatButton
(
padding:
EdgeInsets
.
only
(
top:
2
,
bottom:
2
),
color:
Color
.
fromARGB
(
255
,
236
,
236
,
236
),
onPressed:
callback
,
child:
baseText
(
text
,
13
,
Colors
.
black
),
);
}
lib/HomeModel/page/data/DataCenter.dart
View file @
e2848217
...
...
@@ -19,7 +19,7 @@ class DataCenter extends StatefulWidget {
State
<
StatefulWidget
>
createState
()
=>
DataCenterState
();
}
class
DataCenterState
extends
Base
State
<
DataCenter
>
{
class
DataCenterState
extends
State
<
DataCenter
>
{
DataCenterModel
_model
;
RefreshController
_refreshController
=
RefreshController
(
initialRefresh:
false
);
...
...
lib/HomeModel/page/home/HomeModel.dart
View file @
e2848217
...
...
@@ -20,6 +20,7 @@ import 'package:flutter/cupertino.dart';
import
'package:flutter/foundation.dart'
;
import
'package:flutter/src/widgets/framework.dart'
;
import
'package:file_chooser/file_chooser.dart'
;
import
'package:rxdart/rxdart.dart'
;
import
'UploadBean.dart'
;
...
...
@@ -30,6 +31,8 @@ class HomeModel extends BaseModel {
int
nowSize
;
List
<
String
>
uploadFile
=
new
List
();
LiveData
<
List
<
UploadItem
>>
uploadLive
=
new
LiveData
();
bool
uploading
=
false
;
@override
void
dispose
()
{
...
...
@@ -37,19 +40,24 @@ class HomeModel extends BaseModel {
}
init
()
{
uploading
=
false
;
// allprojectLive.notifyView(AllProjectBean("w"));
}
void
scanImages
(
BuildContext
context
)
async
{
if
(
uploading
)
{
Toast
.
show
(
context
,
"客观稍等 这波图片还没传输完"
);
return
;
}
await
showOpenPanel
((
result
,
files
)
{
if
(
result
!=
FileChooserResult
.
ok
||
files
.
isEmpty
)
{
Toast
.
show
(
context
,
"没有选择文件 批量上传 可以按住shift 或者拖拽鼠标!"
);
return
;
}
uploading
=
true
;
List
<
UploadItem
>
items
=
new
List
();
files
.
forEach
((
value
)
{
items
.
add
(
new
UploadItem
()
..
path
=
value
);
items
.
add
(
new
UploadItem
()..
path
=
value
);
});
uploadLive
.
notifyView
(
items
);
allSize
=
files
.
length
;
...
...
@@ -61,46 +69,64 @@ class HomeModel extends BaseModel {
},
allowsMultipleSelection:
true
);
}
void
uploadImage
(
BuildContext
context
,
String
path
,)
{
netUpload
(
path
).
then
((
value
)
{
if
(
value
!=
null
&&
(
value
.
statusCode
>=
200
&&
value
.
statusCode
<
300
))
{
uploadLive
.
data
[
nowSize
].
state
=
1
;
uploadLive
.
notifyView
(
uploadLive
.
data
);
nowSize
++;
if
(
allSize
==
nowSize
)
{
Toast
.
show
(
context
,
"上传成功"
);
// repo.updateScanList(scanList);
success
(
context
);
}
else
{
uploadImage
(
context
,
uploadFile
[
nowSize
]);
}
void
uploadImage
(
BuildContext
context
,
String
path
,
)
{
HomeRepo
.
getInstance
().
uploadImg
(
path
).
listen
((
value
)
{
if
(
value
!=
null
)
{
print
(
value
.
id
);
HomeRepo
.
getInstance
().
detectImg
(
value
.
id
).
listen
((
value
)
{
if
(
value
!=
null
)
{
if
(
value
.
isEffective
)
{
uploadItem
(
context
,
true
,
null
);
}
else
{
uploadItem
(
context
,
false
,
value
.
msg
==
null
&&
value
.
msg
.
isEmpty
?
"这个图片不符合标准哦~"
:
value
.
msg
);
}
}
else
{
uploadItem
(
context
,
false
,
"图片检测出错!"
);
}
}).
onError
((
error
)
{
Toast
.
show
(
context
,
error
.
toString
());
print
(
error
.
toString
());
uploadItem
(
context
,
false
,
"图片检测出错!"
);
});
}
else
{
Toast
.
show
(
context
,
"上传图片返回接口有空值 暂停上传"
);
print
(
"上传图片返回接口有空值 暂停上传"
);
uploadItem
(
context
,
false
,
"上传图片失败!"
);
}
}).
catch
Error
((
erro
)
{
}).
on
Error
((
erro
)
{
Toast
.
show
(
context
,
erro
.
toString
());
print
(
erro
.
toString
());
uploadLive
.
data
[
nowSize
].
state
=
2
;
uploadLive
.
notifyView
(
uploadLive
.
data
);
nowSize
++;
if
(
nowSize
<
allSize
)
{
uploadImage
(
context
,
uploadFile
[
nowSize
]);
}
uploadItem
(
context
,
false
,
"上传图片失败!"
);
});
}
uploadItem
(
BuildContext
context
,
bool
success
,
String
reason
)
{
uploadLive
.
data
[
nowSize
].
reason
=
reason
;
if
(
success
)
{
uploadLive
.
data
[
nowSize
].
state
=
1
;
}
else
{
uploadLive
.
data
[
nowSize
].
state
=
2
;
}
uploadLive
.
notifyView
(
uploadLive
.
data
);
nowSize
++;
if
(
nowSize
<
allSize
)
{
uploadImage
(
context
,
uploadFile
[
nowSize
]);
}
else
{
uploading
=
false
;
}
}
void
success
(
BuildContext
buildContext
)
{
Navigator
.
push
(
buildContext
,
CustomRoute
(
PicPage
()));
}
}
Future
<
Response
>
netUpload
(
String
path
)
async
{
return
DioUtil
.
getInstance
().
uploadFile
(
"image-upload/"
,
path
);
}
UploadResultBean
uploadImg
(
String
value
)
{
return
UploadResultBean
.
fromJson
(
json
.
decode
(
value
));
}
lib/HomeModel/page/home/HomePage.dart
View file @
e2848217
...
...
@@ -18,6 +18,7 @@ import 'package:example_flutter/commonModel/base/BaseComponent.dart';
import
'package:example_flutter/commonModel/base/BaseState.dart'
;
import
'package:example_flutter/commonModel/cache/CacheManager.dart'
;
import
'package:example_flutter/commonModel/eventbus/event/LogoutEvent.dart'
;
import
'package:example_flutter/commonModel/toast/toast.dart'
;
import
'package:example_flutter/main.dart'
;
import
'package:example_flutter/res/GMRes.dart'
;
import
'package:flutter/cupertino.dart'
;
...
...
@@ -33,8 +34,7 @@ class HomePage extends StatefulWidget {
@override
State
<
StatefulWidget
>
createState
()
=>
HomeState
();
}
class
HomeState
extends
BaseState
<
HomePage
>
class
HomeState
extends
State
<
HomePage
>
with
SingleTickerProviderStateMixin
{
HomeModel
_model
;
Size
screenSize
;
...
...
@@ -132,7 +132,8 @@ class HomeState extends BaseState<HomePage>
painter:
UploadHideView
(
data
.
data
[
index
].
state
,
animValue
,
data
.
data
[
index
].
progress
)),
data
.
data
[
index
].
progress
,
data
.
data
[
index
].
reason
)),
),
],
));
...
...
@@ -201,13 +202,20 @@ class HomeState extends BaseState<HomePage>
Row
(
children:
<
Widget
>[
baseButton
(()
{
_model
.
scanImages
(
context
);
if
(
_model
.
uploading
)
{
Toast
.
show
(
context
,
"客观稍等 这波图片还没传输完"
);
}
else
{
_model
.
scanImages
(
context
);
}
},
EdgeInsets
.
fromLTRB
(
10
,
20
,
10
,
20
),
"上传图片"
),
baseButton
(()
{
JumpUtil
.
jumpToPage
(
context
,
WorkPage
(
"http://i1.sinaimg.cn/ent/d/2008-06-04/U105P28T3D2048907F326DT20080604225106.jpg"
,
1
,
0
));
if
(
_model
.
uploading
)
{
Toast
.
show
(
context
,
"客观稍等 这波图片还没传输完"
);
}
else
{
JumpUtil
.
jumpToPage
(
context
,
PicPage
());
}
},
EdgeInsets
.
fromLTRB
(
10
,
20
,
10
,
20
),
"下一步"
),
],
),
...
...
lib/HomeModel/page/home/UploadBean.dart
View file @
e2848217
...
...
@@ -3,9 +3,11 @@
* @date 2019-12-05
**/
class
UploadItem
{
class
UploadItem
{
String
path
;
//0 loading 1success 2fail
int
state
=
0
;
double
progress
=
0.0
;
}
\ No newline at end of file
int
state
=
0
;
double
progress
=
0.0
;
String
reason
;
}
lib/HomeModel/page/home/UploadHideView.dart
View file @
e2848217
...
...
@@ -49,8 +49,9 @@ class UploadHideView extends CustomPainter {
double
animValue
;
double
progressValue
;
int
state
;
String
reason
;
UploadHideView
(
this
.
state
,
this
.
animValue
,
this
.
progressValue
);
UploadHideView
(
this
.
state
,
this
.
animValue
,
this
.
progressValue
,
this
.
reason
);
Paint
ImagePaint
=
new
Paint
()..
isAntiAlias
=
true
;
...
...
@@ -119,33 +120,24 @@ class UploadHideView extends CustomPainter {
path
.
lineTo
(
0
,
0
);
path
.
lineTo
(
22
,
-
22
);
canvas
.
drawPath
(
path
,
rectPaint
);
// TextPainter(
// text: TextSpan(
// text: "这个图片不符合标准哦~",
// style: TextStyle(
// fontSize: 13,
// color: Colors.yellow,
// fontWeight: FontWeight.w300)),
// textDirection: TextDirection.ltr,
// textAlign: TextAlign.center)
// ..layout(maxWidth: 150, minWidth: 30)
// ..paint(canvas, Offset(-60, - 30));
canvas
.
restore
();
}
else
if
(
state
==
2
)
{
canvas
.
save
();
canvas
.
translate
(
size
.
width
/
2
,
size
.
height
/
2
);
canvas
.
rotate
(
0.3
);
TextPainter
(
text:
TextSpan
(
text:
"这个图片不符合标准哦~"
,
style:
TextStyle
(
fontSize:
13
,
color:
Colors
.
yellow
,
fontWeight:
FontWeight
.
w300
)),
textDirection:
TextDirection
.
ltr
,
textAlign:
TextAlign
.
center
)
..
layout
(
maxWidth:
150
,
minWidth:
30
)
..
paint
(
canvas
,
Offset
(-
60
,
-
30
));
if
(
reason
!=
null
){
TextPainter
(
text:
TextSpan
(
text:
reason
,
style:
TextStyle
(
fontSize:
13
,
color:
Colors
.
yellow
,
fontWeight:
FontWeight
.
w300
)),
textDirection:
TextDirection
.
ltr
,
textAlign:
TextAlign
.
center
)
..
layout
(
maxWidth:
150
,
minWidth:
30
)
..
paint
(
canvas
,
Offset
(-
60
,
-
30
));
}
canvas
.
drawLine
(
Offset
(-
30
,
30
),
Offset
(
30
,
-
30
),
rectPaint
);
canvas
.
drawLine
(
Offset
(
30
,
30
),
Offset
(-
30
,
-
30
),
rectPaint
);
canvas
.
restore
();
...
...
lib/HomeModel/page/picture/PicModel.dart
View file @
e2848217
...
...
@@ -100,6 +100,7 @@ class PicModel extends BaseModel {
Navigator
.
pop
(
context
);
}).
onError
((
error
)
{
Toast
.
show
(
context
,
error
.
toString
());
Toast
.
show
(
context
,
"没有下一页了"
);
print
(
error
.
toString
());
Navigator
.
pop
(
context
);
});
...
...
lib/HomeModel/page/work/WorkModel.dart
View file @
e2848217
...
...
@@ -28,6 +28,7 @@ class WorkModel extends BaseModel {
LiveData
<
List
<
int
>>
nowIndexLive
=
new
LiveData
();
LiveData
<
Map
<
String
,
List
<
List
<
String
>>>>
selectLive
=
new
LiveData
();
LiveData
<
Map
<
String
,
List
<
List
<
String
>>>>
tabLive
=
new
LiveData
();
LiveData
<
bool
>
needHelpLineLive
=
new
LiveData
();
Map
<
String
,
List
<
List
<
String
>>>
selectMap
=
new
Map
();
Map
<
String
,
List
<
List
<
String
>>>
fixDataMap
=
new
Map
();
...
...
@@ -37,6 +38,7 @@ class WorkModel extends BaseModel {
AllTabBean
allTabBean
;
int
imageId
;
int
currentIndex
;
bool
needHelpLine
=
true
;
WorkModel
(
this
.
imageId
,
this
.
currentIndex
);
...
...
@@ -105,6 +107,44 @@ class WorkModel extends BaseModel {
if
(
value
.
anno
.
eyeDistance
!=
null
&&
value
.
anno
.
eyeDistance
!=
"无结果"
)
{
eyeList
.
add
([
EXPLAN
[
"eye_distance"
],
value
.
anno
.
eyeDistance
]);
}
if
(
value
.
anno
.
heiyanquanLeft
!=
null
&&
value
.
anno
.
heiyanquanLeft
!=
"无结果"
)
{
eyeList
.
add
([
EXPLAN
[
"heiyanquan_left"
],
value
.
anno
.
heiyanquanLeft
]);
}
if
(
value
.
anno
.
wocanLeft
!=
null
&&
value
.
anno
.
wocanLeft
!=
"无结果"
)
{
eyeList
.
add
([
EXPLAN
[
"wocan_left"
],
value
.
anno
.
wocanLeft
]);
}
if
(
value
.
anno
.
yanwenLeft
!=
null
&&
value
.
anno
.
yanwenLeft
!=
"无结果"
)
{
eyeList
.
add
([
EXPLAN
[
"yanwen_left"
],
value
.
anno
.
yanwenLeft
]);
}
if
(
value
.
anno
.
yuweiwenLeft
!=
null
&&
value
.
anno
.
yuweiwenLeft
!=
"无结果"
)
{
eyeList
.
add
([
EXPLAN
[
"yuweiwen_left"
],
value
.
anno
.
yuweiwenLeft
]);
}
if
(
value
.
anno
.
zhongyanpaoLeft
!=
null
&&
value
.
anno
.
zhongyanpaoLeft
!=
"无结果"
)
{
eyeList
.
add
([
EXPLAN
[
"zhongyanpao_left"
],
value
.
anno
.
zhongyanpaoLeft
]);
}
if
(
value
.
anno
.
leigouLeft
!=
null
&&
value
.
anno
.
leigouLeft
!=
"无结果"
)
{
eyeList
.
add
([
EXPLAN
[
"leigou_left"
],
value
.
anno
.
leigouLeft
]);
}
if
(
value
.
anno
.
heiyanquanRight
!=
null
&&
value
.
anno
.
heiyanquanRight
!=
"无结果"
)
{
eyeList
.
add
([
EXPLAN
[
"heiyanquan_right"
],
value
.
anno
.
heiyanquanRight
]);
}
if
(
value
.
anno
.
wocanRight
!=
null
&&
value
.
anno
.
wocanRight
!=
"无结果"
)
{
eyeList
.
add
([
EXPLAN
[
"wocan_right"
],
value
.
anno
.
wocanRight
]);
}
if
(
value
.
anno
.
yanwenRight
!=
null
&&
value
.
anno
.
yanwenRight
!=
"无结果"
)
{
eyeList
.
add
([
EXPLAN
[
"yanwen_right"
],
value
.
anno
.
yanwenRight
]);
}
if
(
value
.
anno
.
yuweiwenRight
!=
null
&&
value
.
anno
.
yuweiwenRight
!=
"无结果"
)
{
eyeList
.
add
([
EXPLAN
[
"yuweiwen_right"
],
value
.
anno
.
yuweiwenRight
]);
}
if
(
value
.
anno
.
zhongyanpaoRight
!=
null
&&
value
.
anno
.
zhongyanpaoRight
!=
"无结果"
)
{
eyeList
.
add
([
EXPLAN
[
"zhongyanpao_right"
],
value
.
anno
.
zhongyanpaoRight
]);
}
if
(
value
.
anno
.
leigouRight
!=
null
&&
value
.
anno
.
leigouRight
!=
"无结果"
)
{
eyeList
.
add
([
EXPLAN
[
"leigou_right"
],
value
.
anno
.
leigouRight
]);
}
if
(
eyeList
.
isNotEmpty
)
{
selectMap
.
putIfAbsent
(
"眼睛部分"
,
()
=>
eyeList
);
}
...
...
@@ -295,12 +335,85 @@ class WorkModel extends BaseModel {
eyeSpace
.
add
(
allTabBean
.
eyespacing
.
eyespacingData
.
narrow
);
eyeSpace
.
add
(
allTabBean
.
eyespacing
.
eyespacingData
.
appropriate
);
List
<
String
>
heiyanquan
=
new
List
();
heiyanquan
.
add
(
allTabBean
.
heiyanquanLeft
.
name
);
heiyanquan
.
add
(
allTabBean
.
heiyanquanLeft
.
heiyanquanLeftData
.
yes
);
heiyanquan
.
add
(
allTabBean
.
heiyanquanLeft
.
heiyanquanLeftData
.
no
);
List
<
String
>
heiyanquanR
=
new
List
();
heiyanquanR
.
add
(
allTabBean
.
heiyanquanRight
.
name
);
heiyanquanR
.
add
(
allTabBean
.
heiyanquanRight
.
heiyanquanRightData
.
yes
);
heiyanquanR
.
add
(
allTabBean
.
heiyanquanRight
.
heiyanquanRightData
.
no
);
List
<
String
>
wocan
=
new
List
();
wocan
.
add
(
allTabBean
.
wocanLeft
.
name
);
wocan
.
add
(
allTabBean
.
wocanLeft
.
wocanLeftData
.
yes
);
wocan
.
add
(
allTabBean
.
wocanLeft
.
wocanLeftData
.
no
);
List
<
String
>
wocanR
=
new
List
();
wocanR
.
add
(
allTabBean
.
wocanRight
.
name
);
wocanR
.
add
(
allTabBean
.
wocanRight
.
wocanRightData
.
yes
);
wocanR
.
add
(
allTabBean
.
wocanRight
.
wocanRightData
.
no
);
List
<
String
>
yanwen
=
new
List
();
yanwen
.
add
(
allTabBean
.
yanwenLeft
.
name
);
yanwen
.
add
(
allTabBean
.
yanwenLeft
.
yanwenLeftData
.
yes
);
yanwen
.
add
(
allTabBean
.
yanwenLeft
.
yanwenLeftData
.
no
);
List
<
String
>
yanwenR
=
new
List
();
yanwenR
.
add
(
allTabBean
.
yanwenRight
.
name
);
yanwenR
.
add
(
allTabBean
.
yanwenRight
.
yanwenRightData
.
yes
);
yanwenR
.
add
(
allTabBean
.
yanwenRight
.
yanwenRightData
.
no
);
List
<
String
>
yuweiwen
=
new
List
();
yuweiwen
.
add
(
allTabBean
.
yuweiwenLeft
.
name
);
yuweiwen
.
add
(
allTabBean
.
yuweiwenLeft
.
yuweiwenLeftData
.
yes
);
yuweiwen
.
add
(
allTabBean
.
yuweiwenLeft
.
yuweiwenLeftData
.
no
);
List
<
String
>
yuweiwenR
=
new
List
();
yuweiwenR
.
add
(
allTabBean
.
yuweiwenRight
.
name
);
yuweiwenR
.
add
(
allTabBean
.
yuweiwenRight
.
yuweiwenRightData
.
yes
);
yuweiwenR
.
add
(
allTabBean
.
yuweiwenRight
.
yuweiwenRightData
.
no
);
List
<
String
>
yanpao
=
new
List
();
yanpao
.
add
(
allTabBean
.
zhongyanpaoLeft
.
name
);
yanpao
.
add
(
allTabBean
.
zhongyanpaoLeft
.
zhongyanpaoLeftData
.
yes
);
yanpao
.
add
(
allTabBean
.
zhongyanpaoLeft
.
zhongyanpaoLeftData
.
no
);
List
<
String
>
yanpaoR
=
new
List
();
yanpaoR
.
add
(
allTabBean
.
zhongyanpaoRight
.
name
);
yanpaoR
.
add
(
allTabBean
.
zhongyanpaoRight
.
zhongyanpaoRightData
.
yes
);
yanpaoR
.
add
(
allTabBean
.
zhongyanpaoRight
.
zhongyanpaoRightData
.
no
);
List
<
String
>
leigou
=
new
List
();
leigou
.
add
(
allTabBean
.
leigouLeft
.
name
);
leigou
.
add
(
allTabBean
.
leigouLeft
.
leigouLeftData
.
yes
);
leigou
.
add
(
allTabBean
.
leigouLeft
.
leigouLeftData
.
no
);
List
<
String
>
leigouR
=
new
List
();
leigouR
.
add
(
allTabBean
.
leigouRight
.
name
);
leigouR
.
add
(
allTabBean
.
leigouRight
.
leigouRightData
.
yes
);
leigouR
.
add
(
allTabBean
.
leigouRight
.
leigouRightData
.
no
);
eyeList
.
add
(
lefteye
);
eyeList
.
add
(
righteye
);
eyeList
.
add
(
eyeStyleleft
);
eyeList
.
add
(
eyeStyleright
);
eyeList
.
add
(
eyebag
);
eyeList
.
add
(
eyeSpace
);
eyeList
.
add
(
heiyanquan
);
eyeList
.
add
(
heiyanquanR
);
eyeList
.
add
(
wocan
);
eyeList
.
add
(
wocanR
);
eyeList
.
add
(
yanwen
);
eyeList
.
add
(
yanwenR
);
eyeList
.
add
(
yuweiwen
);
eyeList
.
add
(
yuweiwenR
);
eyeList
.
add
(
yanpao
);
eyeList
.
add
(
yanpaoR
);
eyeList
.
add
(
leigou
);
eyeList
.
add
(
leigouR
);
fixDataMap
.
putIfAbsent
(
"眼睛部分"
,
()
=>
eyeList
);
//======== 鼻子👃
...
...
@@ -406,6 +519,7 @@ class WorkModel extends BaseModel {
@override
void
dispose
()
{
needHelpLineLive
.
dispost
();
rectMaskLive
.
dispost
();
maskTabLive
.
dispost
();
pointLive
.
dispost
();
...
...
@@ -560,7 +674,8 @@ class WorkModel extends BaseModel {
_repo
.
saveImageResult
(
imageId
,
stringBuffer
.
toString
()).
listen
((
value
)
{
if
(
value
!=
null
)
{
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
,
-
1
);
imageNext
(
context
);
// Navigator.pop(context, -1);
Toast
.
show
(
context
,
"保存成功"
);
}
}).
onError
((
error
)
{
...
...
@@ -757,4 +872,10 @@ class WorkModel extends BaseModel {
Navigator
.
pop
(
context
);
});
}
void
needHelpLineNotify
(
bool
value
)
{
needHelpLine
=
value
;
needHelpLineLive
.
notifyView
(
needHelpLine
);
syncPos
(-
10
,
-
10
);
}
}
lib/HomeModel/page/work/WorkPage.dart
View file @
e2848217
This diff is collapsed.
Click to expand it.
lib/HomeModel/page/work/temp.dart
View file @
e2848217
...
...
@@ -266,6 +266,18 @@ const Map<String, String> EXPLAN = {
"
Dense
": "
眉毛浓度
",
"
brows_spacing
": "
两眉间距
",
"
face
": "
脸型
",
"
heiyanquan_left
":"
左眼黑眼圈
",
"
wocan_left
":"
左眼卧蚕
",
"
yanwen_left
":"
左眼眼纹
",
"
yuweiwen_left
":"
左眼鱼尾纹
",
"
zhongyanpao_left
":"
左眼肿眼泡
",
"
leigou_left
":"
左眼泪沟
",
"
heiyanquan_right
":"
右眼黑眼圈
",
"
wocan_right
":"
右眼卧蚕
",
"
yanwen_right
":"
右眼眼纹
",
"
yuweiwen_right
":"
右眼鱼尾纹
",
"
zhongyanpao_right
":"
右眼肿眼泡
",
"
leigou_right
":"
右眼泪沟
",
};
const List<String> maskTabList = ["
左双眼皮
", "
右双眼皮
"];
...
...
lib/HomeModel/service/HomeRepo.dart
View file @
e2848217
...
...
@@ -11,11 +11,13 @@ import 'package:example_flutter/HomeModel/page/work/temp.dart';
import
'package:example_flutter/HomeModel/service/remote/api/HomeApi.serv.dart'
;
import
'package:example_flutter/HomeModel/service/remote/entity/AllTabBean.dart'
;
import
'package:example_flutter/HomeModel/service/remote/entity/DeleteResultBean.dart'
;
import
'package:example_flutter/HomeModel/service/remote/entity/DetectImgBean.dart'
;
import
'package:example_flutter/HomeModel/service/remote/entity/ImageAiBean.dart'
;
import
'package:example_flutter/HomeModel/service/remote/entity/ImageResultBean.dart'
;
import
'package:example_flutter/HomeModel/service/remote/entity/MaskResultBean.dart'
;
import
'package:example_flutter/HomeModel/service/remote/entity/PutImageDataBean.dart'
;
import
'package:example_flutter/HomeModel/service/remote/entity/TotalImageBean.dart'
;
import
'package:example_flutter/HomeModel/service/remote/entity/UploadBean.dart'
;
import
'package:example_flutter/HomeModel/service/remote/entity/UploadMyImageBean.dart'
;
import
'package:example_flutter/HomeModel/service/remote/entity/UploadResultBean.dart'
;
import
'package:example_flutter/commonModel/GMBase.dart'
;
...
...
@@ -28,13 +30,12 @@ ImageResultBean paseImageResult(String value) {
}
class
HomeRepo
{
Dio
mydio
;
static
HomeRepo
_repo
;
HomeRepo
.
_
(){
mydio
=
Dio
(
getw
());
HomeRepo
.
_
()
{
mydio
=
Dio
(
getw
());
}
static
HomeRepo
getInstance
()
{
...
...
@@ -163,10 +164,13 @@ class HomeRepo {
return
HomeApiImpl
().
getTotalImages
();
}
void
downloadMyImage
(
String
path
,
String
id
,
Function
()
ok
){
mydio
.
download
(
"api/downfile"
,
path
,
options:
Options
(
method:
"POST"
),
data:
FormData
.
from
(
{
"id"
:
id
})).
then
((
value
){
void
downloadMyImage
(
String
path
,
String
id
,
Function
()
ok
)
{
mydio
.
download
(
"api/downfile"
,
path
,
options:
Options
(
method:
"POST"
),
data:
FormData
.
from
({
"id"
:
id
}))
.
then
((
value
)
{
print
(
value
);
}).
whenComplete
((){
}).
whenComplete
(()
{
ok
();
});
// Observable.fromFuture(dio
...
...
@@ -184,26 +188,23 @@ class HomeRepo {
// });
}
Observable
<
UploadMyImageBean
>
uploadMyImage
(
String
path
,
String
id
){
Observable
<
UploadMyImageBean
>
uploadMyImage
(
String
path
,
String
id
)
{
var
name
=
path
.
substring
(
path
.
lastIndexOf
(
"/"
)
+
1
,
path
.
length
);
FormData
formData
=
new
FormData
.
from
({
"file"
:
new
UploadFileInfo
(
new
File
(
path
),
name
),
"id"
:
id
,
});
return
Observable
.
fromFuture
(
mydio
.
post
(
'api/fileUpload'
,
data:
formData
))
return
Observable
.
fromFuture
(
mydio
.
post
(
'api/fileUpload'
,
data:
formData
))
.
flatMap
((
value
)
{
if
(
value
!=
null
&&
(
value
.
statusCode
>=
200
&&
value
.
statusCode
<
300
))
{
return
Observable
.
fromFuture
(
compute
(
parseMyUpload
,
value
.
toString
()));
return
Observable
.
fromFuture
(
compute
(
parseMyUpload
,
value
.
toString
()));
}
else
{
return
Observable
.
fromFuture
(
null
);
}
});
}
BaseOptions
getw
()
{
BaseOptions
options
=
BaseOptions
();
options
.
connectTimeout
=
10
*
1000
;
...
...
@@ -219,7 +220,38 @@ class HomeRepo {
return
options
;
}
// Observable<>
Observable
<
DetectImgBean
>
detectImg
(
int
id
)
{
return
Observable
.
fromFuture
(
DioUtil
().
getDio
().
put
(
"filtimage/
${id}
/"
))
.
flatMap
((
value
)
{
if
(
value
!=
null
&&
(
value
.
statusCode
>=
200
&&
value
.
statusCode
<
300
))
{
return
Observable
.
fromFuture
(
compute
(
detectImgBean
,
value
.
toString
()));
}
else
{
return
Observable
.
fromFuture
(
null
);
}
});
}
Observable
<
UploadBean
>
uploadImg
(
String
path
)
{
return
Observable
.
fromFuture
(
DioUtil
.
getInstance
().
uploadFile
(
"image-upload/"
,
path
))
.
flatMap
((
value
)
{
if
(
value
!=
null
&&
(
value
.
statusCode
>=
200
&&
value
.
statusCode
<
300
))
{
return
Observable
.
fromFuture
(
compute
(
parseUpload
,
value
.
toString
()));
}
else
{
return
Observable
.
fromFuture
(
null
);
}
});
}
}
UploadBean
parseUpload
(
String
value
)
{
return
UploadBean
.
fromJson
(
json
.
decode
(
value
));
}
DetectImgBean
detectImgBean
(
String
value
)
{
return
DetectImgBean
.
fromJson
(
json
.
decode
(
value
));
}
ImageAiBean
paseImageAi
(
String
value
)
{
...
...
@@ -238,7 +270,6 @@ MaskResultBean parseMaskResult(String value) {
return
MaskResultBean
.
fromJson
(
json
.
decode
(
value
));
}
UploadMyImageBean
parseMyUpload
(
String
value
){
UploadMyImageBean
parseMyUpload
(
String
value
)
{
return
UploadMyImageBean
.
fromJson
(
json
.
decode
(
value
));
}
\ No newline at end of file
}
lib/HomeModel/service/remote/entity/AllTabBean.dart
View file @
e2848217
This diff is collapsed.
Click to expand it.
lib/HomeModel/service/remote/entity/DetectImgBean.dart
0 → 100644
View file @
e2848217
/*
* @author lsy
* @date 2019-12-06
**/
class
DetectImgBean
{
bool
isEffective
;
String
msg
;
DetectImgBean
({
this
.
isEffective
,
this
.
msg
});
DetectImgBean
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
isEffective
=
json
[
'is_effective'
];
msg
=
json
[
'msg'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'is_effective'
]
=
this
.
isEffective
;
data
[
'msg'
]
=
this
.
msg
;
return
data
;
}
}
lib/HomeModel/service/remote/entity/ImageAiBean.dart
View file @
e2848217
...
...
@@ -46,6 +46,19 @@ class Anno {
String
lipShape
;
String
lipPeak
;
String
heiyanquanLeft
;
String
wocanLeft
;
String
yanwenLeft
;
String
yuweiwenLeft
;
String
zhongyanpaoLeft
;
String
leigouLeft
;
String
heiyanquanRight
;
String
wocanRight
;
String
yanwenRight
;
String
yuweiwenRight
;
String
zhongyanpaoRight
;
String
leigouRight
;
Anno
(
{
this
.
browShape
,
this
.
browsStyle
,
...
...
@@ -67,7 +80,19 @@ class Anno {
this
.
lipThickness
,
this
.
lipRadian
,
this
.
lipShape
,
this
.
lipPeak
});
this
.
lipPeak
,
this
.
heiyanquanLeft
,
this
.
wocanLeft
,
this
.
yanwenLeft
,
this
.
yuweiwenLeft
,
this
.
zhongyanpaoLeft
,
this
.
leigouLeft
,
this
.
heiyanquanRight
,
this
.
wocanRight
,
this
.
yanwenRight
,
this
.
yuweiwenRight
,
this
.
zhongyanpaoRight
,
this
.
leigouRight
});
Anno
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
browShape
=
json
[
'brow_shape'
];
...
...
@@ -91,6 +116,18 @@ class Anno {
lipRadian
=
json
[
'lip_radian'
];
lipShape
=
json
[
'lip_shape'
];
lipPeak
=
json
[
'lip_peak'
];
heiyanquanLeft
=
json
[
'heiyanquan_left'
];
wocanLeft
=
json
[
'wocan_left'
];
yanwenLeft
=
json
[
'yanwen_left'
];
yuweiwenLeft
=
json
[
'yuweiwen_left'
];
zhongyanpaoLeft
=
json
[
'zhongyanpao_left'
];
leigouLeft
=
json
[
'leigou_left'
];
heiyanquanRight
=
json
[
'heiyanquan_right'
];
wocanRight
=
json
[
'wocan_right'
];
yanwenRight
=
json
[
'yanwen_right'
];
yuweiwenRight
=
json
[
'yuweiwen_right'
];
zhongyanpaoRight
=
json
[
'zhongyanpao_right'
];
leigouRight
=
json
[
'leigou_right'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
...
...
@@ -116,6 +153,18 @@ class Anno {
data
[
'lip_radian'
]
=
this
.
lipRadian
;
data
[
'lip_shape'
]
=
this
.
lipShape
;
data
[
'lip_peak'
]
=
this
.
lipPeak
;
data
[
'heiyanquan_left'
]
=
this
.
heiyanquanLeft
;
data
[
'wocan_left'
]
=
this
.
wocanLeft
;
data
[
'yanwen_left'
]
=
this
.
yanwenLeft
;
data
[
'yuweiwen_left'
]
=
this
.
yuweiwenLeft
;
data
[
'zhongyanpao_left'
]
=
this
.
zhongyanpaoLeft
;
data
[
'leigou_left'
]
=
this
.
leigouLeft
;
data
[
'heiyanquan_right'
]
=
this
.
heiyanquanRight
;
data
[
'wocan_right'
]
=
this
.
wocanRight
;
data
[
'yanwen_right'
]
=
this
.
yanwenRight
;
data
[
'yuweiwen_right'
]
=
this
.
yuweiwenRight
;
data
[
'zhongyanpao_right'
]
=
this
.
zhongyanpaoRight
;
data
[
'leigou_right'
]
=
this
.
leigouRight
;
return
data
;
}
}
...
...
lib/HomeModel/service/remote/entity/UploadBean.dart
0 → 100644
View file @
e2848217
/*
* @author lsy
* @date 2019-12-06
**/
class
UploadBean
{
String
url
;
int
id
;
UploadBean
({
this
.
url
,
this
.
id
});
UploadBean
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
url
=
json
[
'url'
];
id
=
json
[
'id'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'url'
]
=
this
.
url
;
data
[
'id'
]
=
this
.
id
;
return
data
;
}
}
lib/HomePage.dart
View file @
e2848217
...
...
@@ -13,6 +13,7 @@ import 'package:flutter_svg/svg.dart';
import
'HomeModel.dart'
;
import
'commonModel/GMBase.dart'
;
import
'commonModel/eventbus/event/ChangeTabBean.dart'
;
import
'commonModel/eventbus/event/LogoutEvent.dart'
;
import
'main.dart'
;
class
HomePage
extends
StatefulWidget
{
...
...
@@ -26,7 +27,8 @@ class HomePage extends StatefulWidget {
State
<
StatefulWidget
>
createState
()
=>
HomeState
(
_model
);
}
class
HomeState
extends
BaseState
<
HomePage
>
{
class
HomeState
extends
State
<
HomePage
>
{
StreamSubscription
<
LogoutEvent
>
busEvent
;
StreamSubscription
<
ChangeTabBean
>
changeTabEvent
;
HomeModel
_model
;
...
...
@@ -39,6 +41,9 @@ class HomeState extends BaseState<HomePage> {
_model
.
currentIndex
=
event
.
index
;
_model
.
onTap
(
event
.
index
);
});
busEvent
=
eventBus
.
on
<
LogoutEvent
>().
listen
((
event
)
{
Navigator
.
pop
(
context
);
});
super
.
initState
();
_model
.
init
();
}
...
...
@@ -138,6 +143,7 @@ class HomeState extends BaseState<HomePage> {
@override
void
dispose
()
{
busEvent
.
cancel
();
changeTabEvent
.
cancel
();
_model
.
dispose
();
super
.
dispose
();
...
...
lib/UserModel/page/usermanager/Persionset.dart
View file @
e2848217
...
...
@@ -13,7 +13,7 @@ class Persionset extends StatefulWidget {
State
<
StatefulWidget
>
createState
()
=>
PersionsetState
();
}
class
PersionsetState
extends
Base
State
<
Persionset
>
{
class
PersionsetState
extends
State
<
Persionset
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
...
...
lib/commonModel/base/BaseState.dart
View file @
e2848217
...
...
@@ -4,6 +4,7 @@
**/
import
'dart:async'
;
import
'package:example_flutter/commonModel/eventbus/event/ChangeTabBean.dart'
;
import
'package:example_flutter/commonModel/eventbus/event/LogoutEvent.dart'
;
import
'package:flutter/material.dart'
;
...
...
@@ -12,18 +13,23 @@ import '../../main.dart';
abstract
class
BaseState
<
T
extends
StatefulWidget
>
extends
State
<
T
>{
StreamSubscription
<
LogoutEvent
>
busEvent
;
StreamSubscription
<
ChangeTabBean
>
changState
;
@override
void
initState
()
{
busEvent
=
eventBus
.
on
<
LogoutEvent
>().
listen
((
event
)
{
Navigator
.
pop
(
context
);
});
changState
=
eventBus
.
on
<
ChangeTabBean
>().
listen
((
event
){
Navigator
.
pop
(
context
);
});
super
.
initState
();
}
@override
void
dispose
()
{
busEvent
.
cancel
();
changState
.
cancel
();
super
.
dispose
();
}
...
...
lib/commonModel/picker/base/BaseCenterPicker.dart
View file @
e2848217
...
...
@@ -44,7 +44,7 @@ class BaseCenterPickerState extends State<BaseCenterPicker> {
Widget
build
(
BuildContext
context
)
{
// ScreenUtil.instance = ScreenUtil(width: 375, height: 667)..init(context);
return
Container
(
color:
Colors
.
black
12
,
color:
Colors
.
black
38
,
width:
double
.
maxFinite
,
height:
double
.
maxFinite
,
child:
Stack
(
...
...
lib/commonModel/picker/base/BasePickerComponent.dart
View file @
e2848217
...
...
@@ -20,19 +20,20 @@ class BaseLoadingItem implements ICenterPicker {
height:
120.0
,
child:
new
Container
(
///弹框背景和圆角
decoration:
ShapeDecoration
(
color:
Colors
.
greenAccent
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
8.0
),
),
),
decoration:
BoxDecoration
(
// color: Colors.orange,
color:
Colors
.
purple
,
gradient:
LinearGradient
(
colors:
[
Color
.
fromARGB
(
255
,
253
,
113
,
34
),
Color
.
fromARGB
(
255
,
253
,
166
,
41
)
],
begin:
Alignment
.
centerRight
,
end:
Alignment
.
centerLeft
),
borderRadius:
BorderRadius
.
circular
(
8
),
),
child:
new
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
<
Widget
>[
new
YYWa
ve
(),
new
YYWa
nderingCubes
(),
new
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
20.0
,
...
...
lib/res/value/ALColors.dart
View file @
e2848217
...
...
@@ -27,6 +27,5 @@ class ALColors {
static
const
Color
Color0093FF
=
Color
(
0xFF0093FF
);
static
const
Color
Color666666
=
Color
(
0xFF666666
);
static
const
Color
Color33000000
=
Color
(
0x33000000
);
static
const
Color
ColorTitle
=
Color
.
fromARGB
(
255
,
236
,
236
,
236
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment