Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gmalpha_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
mobile
gmalpha_flutter
Commits
0968a395
Commit
0968a395
authored
Oct 30, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
ac0a214c
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
491 additions
and
190 deletions
+491
-190
MainActivity.kt
...c/main/kotlin/com/example/gmalpha_flutter/MainActivity.kt
+1
-1
file_paths.xml
android/app/src/main/res/xml/file_paths.xml
+2
-1
flutter.sh
flutter.sh
+13
-2
album_not_sel.svg
images/album_not_sel.svg
+3
-0
album_sel.svg
images/album_sel.svg
+4
-0
camera.svg
images/camera.svg
+6
-0
AppDelegate.m
ios/Runner/AppDelegate.m
+1
-1
AlbumRouter.dart
lib/AlbumModel/AlbumRouter.dart
+2
-2
AlbumRouterImpl.dart
lib/AlbumModel/AlbumRouterImpl.dart
+5
-3
AlbumModel.dart
lib/AlbumModel/page/album/AlbumModel.dart
+229
-35
AlbumPage.dart
lib/AlbumModel/page/album/AlbumPage.dart
+108
-75
AlbumRepository.dart
lib/AlbumModel/repository/AlbumRepository.dart
+14
-7
common.dart
lib/NewMessageModel/page/messagePage/common.dart
+9
-8
TestPage.dart
lib/TestPage.dart
+22
-18
AppBase.dart
lib/commonModel/base/AppBase.dart
+22
-10
BaseComponent.dart
lib/commonModel/base/BaseComponent.dart
+2
-0
BaseCenterPicker.dart
lib/commonModel/picker/base/BaseCenterPicker.dart
+6
-5
main.dart
lib/main.dart
+20
-14
ALColors.dart
lib/res/value/ALColors.dart
+1
-0
UserSettingModel.dart
lib/userModel/page/userSetting/UserSettingModel.dart
+7
-0
UserSettingPage.dart
lib/userModel/page/userSetting/UserSettingPage.dart
+12
-6
JumpUtil.dart
lib/userModel/util/JumpUtil.dart
+1
-1
pubspec.yaml
pubspec.yaml
+1
-1
No files found.
android/app/src/main/kotlin/com/example/gmalpha_flutter/MainActivity.kt
View file @
0968a395
...
...
@@ -75,7 +75,7 @@ class MainActivity : FlutterActivity() {
map
.
put
(
"buildConfig"
,
"debug"
)
map
.
put
(
"provider"
,
"com.example.gmalpha_flutter"
)
//HERE
// map.put("proxy", "172.30.9.
84
:6666");
// map.put("proxy", "172.30.9.
137
:6666");
result
.
success
(
map
)
}
else
if
(
call
.
method
==
"UPLOAD_IMG"
)
{
result
.
success
(
"2019/10/17/1156/44dbb13ac6d9"
);
...
...
android/app/src/main/res/xml/file_paths.xml
View file @
0968a395
...
...
@@ -2,5 +2,5 @@
<paths>
<!--path:需要临时授权访问的路径(.代表所有路径)-->
<!--name:就是你给这个访问路径起个名字-->
<external-path
name=
"
InstructiveRide
"
path=
"."
/>
<external-path
name=
"
LLL
"
path=
"."
/>
</paths>
\ No newline at end of file
flutter.sh
View file @
0968a395
...
...
@@ -136,8 +136,18 @@ function android_publish(){
git push
}
function
copyAAR
(){
cp
-r
/Users/apple/lsy/gmalpha_flutter/build/flutter_boost/outputs/aar/flutter_boost-
${
suff
}
.aar /Users/apple/lsy/MergeTest/app/libs/flutter_boost.aar
cp
-r
/Users/apple/lsy/gmalpha_flutter/build/gengmei_flutter_plugin/outputs/aar/gengmei_flutter_plugin-
${
suff
}
.aar /Users/apple/lsy/MergeTest/app/libs/gengmei_flutter_plugin.aar
cp
-r
/Users/apple/lsy/gmalpha_flutter/build/path_provider/outputs/aar/path_provider-
${
suff
}
.aar /Users/apple/lsy/MergeTest/app/libs/path_provider.aar
cp
-r
/Users/apple/lsy/gmalpha_flutter/build/sqflite/outputs/aar/sqflite-
${
suff
}
.aar /Users/apple/lsy/MergeTest/app/libs/sqflite.aar
cp
-r
/Users/apple/lsy/gmalpha_flutter/build/xservice_kit/outputs/aar/xservice_kit-
${
suff
}
.aar /Users/apple/lsy/MergeTest/app/libs/xservice_kit.aar
}
#====upload
function
upload_android_aar
(){
cd
/Users/apple/lsy/MergeTest
./gradlew clean
./gradlew assembleRelease
...
...
@@ -250,11 +260,12 @@ mkdir /Users/apple/lsy/aar_update/androd${message}/
mkdir
/Users/apple/lsy/aar_update/ios
${
message
}
/
clean
android_apk
#
android_apk
#android
#android_publish
#copyAAR
#upload_android_aar
#
ios
ios
#ios_publish
#notifyDingDing
...
...
images/album_not_sel.svg
0 → 100644
View file @
0968a395
<svg
width=
"24"
height=
"24"
viewBox=
"0 0 24 24"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<circle
cx=
"12"
cy=
"12"
r=
"11.5"
fill=
"black"
fill-opacity=
"0.2"
stroke=
"white"
/>
</svg>
images/album_sel.svg
0 → 100644
View file @
0968a395
<svg
width=
"24"
height=
"24"
viewBox=
"0 0 24 24"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<path
d=
"M23.25 12C23.25 18.2132 18.2132 23.25 12 23.25C5.7868 23.25 0.75 18.2132 0.75 12C0.75 5.7868 5.7868 0.75 12 0.75C18.2132 0.75 23.25 5.7868 23.25 12Z"
fill=
"white"
stroke=
"white"
stroke-width=
"1.5"
/>
<path
d=
"M6.97825 12.3108L10.4976 15.8302L17.6353 8.69248"
stroke=
"#323232"
stroke-width=
"1.5"
/>
</svg>
images/camera.svg
0 → 100644
View file @
0968a395
<svg
width=
"93"
height=
"93"
viewBox=
"0 0 93 93"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<rect
width=
"93"
height=
"93"
fill=
"white"
/>
<path
d=
"M32.5 59.5V36.5H40L41.5 33.5H54L55.5 36.5H63.5V59.5H32.5Z"
stroke=
"#323232"
stroke-width=
"2"
/>
<circle
cx=
"48"
cy=
"47"
r=
"6"
stroke=
"#323232"
stroke-width=
"2"
/>
<circle
cx=
"58"
cy=
"42"
r=
"2"
fill=
"#323232"
/>
</svg>
ios/Runner/AppDelegate.m
View file @
0968a395
...
...
@@ -26,7 +26,7 @@
FlutterEventChannel
*
flutterEvent
=
[
FlutterEventChannel
eventChannelWithName
:
@"flutter_channel_event"
binaryMessenger
:
controller
];
[
flutterEvent
setStreamHandler
:
self
];
[
flutterEvent
setStreamHandler
:
self
];
[
buryChannel
setMethodCallHandler
:
^
(
FlutterMethodCall
*
call
,
FlutterResult
result
)
{
...
...
lib/AlbumModel/AlbumRouter.dart
View file @
0968a395
...
...
@@ -11,6 +11,6 @@ import 'package:gmalpha_flutter/Annotations/anno/Router.dart';
@Router
(
"albumModel"
,
AlbumRouterImpl
,
true
)
abstract
class
AlbumRouter
implements
RouterBaser
{
Widget
getAlbumPage
(
String
provider
,
bool
showCamera
,
int
bigSelectImage
,
List
<
String
>
selectedImages
);
List
<
String
>
selectedImages
,
bool
fromNative
,
String
fromPage
,
{
int
maxVideoCount
=
0
,
videoSelectPath
=
null
,
iosPushedPage
=
null
});
}
lib/AlbumModel/AlbumRouterImpl.dart
View file @
0968a395
...
...
@@ -9,8 +9,10 @@ import 'package:gmalpha_flutter/AlbumModel/page/album/AlbumPage.dart';
class
AlbumRouterImpl
implements
AlbumRouter
{
@override
Widget
getAlbumPage
(
String
provider
,
bool
showCamera
,
int
bigSelectSize
,
List
<
String
>
selectedImages
)
{
return
AlbumPage
(
provider
,
showCamera
,
bigSelectSize
,
selectedImages
);
Widget
getAlbumPage
(
String
provider
,
bool
showCamera
,
int
bigSelectSize
,
List
<
String
>
selectedImages
,
bool
fromNative
,
String
fromPage
,
{
int
maxVideoCount
=
0
,
videoSelectPath
,
iosPushedPage
})
{
return
AlbumPage
(
provider
,
showCamera
,
bigSelectSize
,
selectedImages
,
fromNative
,
maxVideoCount
,
videoSelectPath
,
fromPage
,
iosPushedPage
);
}
}
lib/AlbumModel/page/album/AlbumModel.dart
View file @
0968a395
...
...
@@ -11,6 +11,7 @@ import 'package:gengmei_flutter_plugin/ScanImagePlugn.dart';
import
'package:gengmei_flutter_plugin/gengmei_flutter_plugin.dart'
;
import
'package:gmalpha_flutter/AlbumModel/bean/DirBean.dart'
;
import
'package:gmalpha_flutter/AlbumModel/repository/AlbumRepository.dart'
;
import
'package:gmalpha_flutter/commonModel/GMBase.dart'
;
import
'package:gmalpha_flutter/commonModel/live/BaseModel.dart'
;
import
'package:gmalpha_flutter/commonModel/live/LiveData.dart'
;
import
'package:gmalpha_flutter/commonModel/toast/toast.dart'
;
...
...
@@ -28,6 +29,7 @@ class AlbumModel extends BaseModel {
Map
<
String
,
List
<
ScanImageItem
>>
_mainValue
=
Map
();
List
<
String
>
_selectList
=
List
();
List
<
String
>
_selectVideoList
=
List
();
String
_nowDirName
=
MainDir
;
StreamSubscription
_listen
;
bool
showCamera
=
true
;
...
...
@@ -49,37 +51,54 @@ class AlbumModel extends BaseModel {
bool
showPop
=
false
;
List
<
DirBean
>
_dirList
=
List
();
final
bool
fromNative
;
int
maxVideoCount
;
final
String
fromPage
;
final
String
iosPushedPage
;
get
dirList
=>
_dirList
;
AlbumModel
(
this
.
provider
,
this
.
showCamera
,
int
maxCount
,
List
<
String
>
selectedList
)
{
this
.
provider
,
this
.
showCamera
,
int
maxCount
,
List
<
String
>
selectedList
,
this
.
fromNative
,
int
maxVideoCount
,
List
<
String
>
videoSelectPath
,
this
.
fromPage
,
this
.
iosPushedPage
)
{
print
(
"======>>>>>
${selectedList}
${videoSelectPath}
<<<<<====="
);
this
.
maxVideoCount
=
maxVideoCount
;
this
.
_maxCount
=
maxCount
;
if
(
selectedList
!=
null
&&
!
selectedList
.
isEmpty
)
{
this
.
_selectList
.
clear
();
this
.
_selectList
.
addAll
(
selectedList
);
}
if
(
videoSelectPath
!=
null
&&
!
videoSelectPath
.
isEmpty
)
{
this
.
_selectVideoList
.
clear
();
this
.
_selectVideoList
.
addAll
(
videoSelectPath
);
}
}
void
_onEvent
(
Object
event
)
{
var
map
=
(
event
as
Map
);
// var list = map[_nowDirName];
_mainValue
.
forEach
((
k
,
itemList
)
{
var
key
=
map
[
k
];
if
(
key
!=
null
)
{
for
(
int
i
=
0
;
i
<
itemList
.
length
;
i
++)
{
if
(
key
[
i
]
==
null
)
{
continue
;
}
if
(
itemList
[
i
].
path
==
null
)
{
if
(
_mainValue
==
null
||
_mainValue
.
length
==
0
)
{
_mainValue
=
map
;
}
else
{
_mainValue
.
forEach
((
k
,
itemList
)
{
var
key
=
map
[
k
];
if
(
key
!=
null
)
{
for
(
int
i
=
0
;
i
<
itemList
.
length
;
i
++)
{
if
(
key
[
i
]
==
null
)
{
continue
;
}
itemList
[
i
].
path
=
key
[
i
][
"path"
];
}
if
(
itemList
[
i
].
realPath
==
null
)
{
itemList
[
i
].
realPath
=
key
[
i
][
"realPath"
];
}
}
}
}
);
}
);
}
albumLive
.
notifyView
(
_mainValue
[
_nowDirName
]);
}
...
...
@@ -88,12 +107,15 @@ class AlbumModel extends BaseModel {
}
void
initScanImages
(
BuildContext
context
)
{
_listen
=
GengmeiFlutterPlugin
.
phoneImagesEvent
.
receiveBroadcastStream
()
.
listen
(
_onEvent
,
onError:
_onError
);
if
(
Platform
.
isAndroid
)
{
_listen
=
GengmeiFlutterPlugin
.
phoneImagesEvent
.
receiveBroadcastStream
()
.
listen
(
_onEvent
,
onError:
_onError
);
}
AlbumRepository
.
getInstance
().
scanPhoneImg
().
listen
((
value
)
{
if
(
value
!=
null
)
{
_mainValue
=
value
;
selectSizeLive
.
notifyView
(
_selectList
.
length
+
_selectVideoList
.
length
);
value
.
forEach
((
key
,
eachValue
)
{
if
(
eachValue
!=
null
&&
!
eachValue
.
isEmpty
)
{
if
(
key
==
MainDir
)
{
...
...
@@ -129,16 +151,40 @@ class AlbumModel extends BaseModel {
GengmeiFlutterPlugin
.
quitPage
();
}
select
(
int
index
)
{}
bool
isSelect
(
int
index
)
{
bool
haveIt
=
false
;
if
(
_selectList
.
isEmpty
)
{
return
false
;
}
_selectList
.
forEach
((
value
)
{
if
(
value
==
albumLive
.
data
[
index
].
realPath
)
{
haveIt
=
true
;
if
(
Platform
.
isAndroid
)
{
if
(
value
==
albumLive
.
data
[
index
].
realPath
)
{
haveIt
=
true
;
}
}
else
{
if
(
value
==
albumLive
.
data
[
index
].
path
)
{
haveIt
=
true
;
}
}
});
return
haveIt
;
}
bool
isSelectVideo
(
int
index
)
{
bool
haveIt
=
false
;
if
(
_selectVideoList
.
isEmpty
)
{
return
false
;
}
_selectVideoList
.
forEach
((
value
)
{
if
(
Platform
.
isAndroid
)
{
if
(
value
==
albumLive
.
data
[
index
].
realPath
)
{
haveIt
=
true
;
}
}
else
{
if
(
value
==
albumLive
.
data
[
index
].
path
)
{
haveIt
=
true
;
}
}
});
return
haveIt
;
...
...
@@ -148,41 +194,152 @@ class AlbumModel extends BaseModel {
return
_selectList
.
length
==
_maxCount
;
}
void
clickItem
(
BuildContext
context
,
int
index
)
{
String
path
=
albumLive
.
data
[
index
].
realPath
;
bool
isFullSelectVideo
()
{
return
_selectVideoList
.
length
==
maxVideoCount
;
}
bool
isVideo
(
int
index
)
{
return
albumLive
.
data
[
index
].
isVideo
;
}
if
(!
_selectList
.
contains
(
path
))
{
if
(
_selectList
.
length
>=
_maxCount
)
{
Toast
.
show
(
context
,
"最多选择
${_maxCount}
张图片"
);
return
;
void
clickItem
(
BuildContext
context
,
int
index
)
{
String
path
;
if
(
Platform
.
isAndroid
)
{
path
=
albumLive
.
data
[
index
].
realPath
;
}
else
{
path
=
albumLive
.
data
[
index
].
path
;
}
if
(
maxVideoCount
>
0
&&
albumLive
.
data
[
index
].
isVideo
)
{
if
(!
_selectVideoList
.
contains
(
path
))
{
if
(
_selectVideoList
.
length
>=
maxVideoCount
)
{
Toast
.
show
(
context
,
"最多选择
${maxVideoCount}
个视频"
);
return
;
}
_selectVideoList
.
add
(
path
);
}
else
{
_selectVideoList
.
remove
(
path
);
}
_selectList
.
add
(
path
);
}
else
{
_selectList
.
remove
(
path
);
if
(!
_selectList
.
contains
(
path
))
{
if
(
_selectList
.
length
>=
_maxCount
)
{
Toast
.
show
(
context
,
"最多选择
${_maxCount}
张图片"
);
return
;
}
_selectList
.
add
(
path
);
}
else
{
_selectList
.
remove
(
path
);
}
}
albumLive
.
notifyView
(
albumLive
.
data
);
selectSizeLive
.
notifyView
(
_selectList
.
length
);
selectSizeLive
.
notifyView
(
_selectList
.
length
+
_selectVideoList
.
length
);
}
void
onNext
(
BuildContext
context
)
{
if
(
_selectList
.
isEmpty
)
{
if
(
_selectList
.
isEmpty
&&
_selectVideoList
.
isEmpty
)
{
Navigator
.
pop
(
context
,
null
);
}
else
{
Navigator
.
pop
(
context
,
_selectList
);
if
(
fromNative
)
{
if
(
Platform
.
isAndroid
)
{
albumResult
({
"image"
:
_selectList
,
"video"
:
_selectVideoList
});
}
else
{
iosAlbum
(
_selectList
,
context
,
(
image
)
{
iosAlbum
(
_selectVideoList
,
context
,
(
video
)
{
var
newImages
=
List
<
String
>();
for
(
String
item
in
_selectList
)
{
for
(
Map
real
in
image
)
{
var
map
=
Map
<
String
,
String
>.
from
(
real
);
if
(
map
[
"path"
]
==
item
)
{
newImages
.
add
(
map
[
"realImagePath"
]);
break
;
}
}
}
var
newVideos
=
List
<
String
>();
for
(
String
item
in
_selectVideoList
)
{
for
(
Map
real
in
video
)
{
var
map
=
Map
<
String
,
String
>.
from
(
real
);
if
(
map
[
"path"
]
==
item
)
{
newVideos
.
add
(
map
[
"realVideoPath"
]);
break
;
}
}
}
print
(
"IM
${newImages}
$image
VIDEI
${newVideos}
${video}
"
);
Navigator
.
pop
(
context
);
albumResult
({
"image"
:
_selectList
,
"image_real"
:
newImages
,
"video"
:
_selectVideoList
,
"video_real"
:
newVideos
,
"iosPushedPage"
:
iosPushedPage
});
});
});
}
}
else
{
if
(
Platform
.
isAndroid
)
{
Navigator
.
pop
(
context
,
_selectList
);
}
else
{
iosAlbum
(
_selectList
,
context
,
(
value
)
{
print
(
value
);
List
<
String
>
resultList
=
new
List
();
resultList
.
add
(
Map
<
String
,
String
>.
from
(
value
[
0
])[
"realImagePath"
]);
Navigator
.
pop
(
context
,
resultList
);
});
}
}
}
}
void
iosAlbum
(
List
<
String
>
list
,
BuildContext
context
,
Function
fun
)
{
GengmeiFlutterPlugin
.
ios_album_path
(
list
).
then
((
value
)
{
if
(
value
!=
null
)
{
fun
(
List
<
Map
>.
from
(
value
));
}
}).
catchError
((
error
)
{
print
(
error
);
});
}
void
iosAlbumGetImagePath
(
String
path
,
int
index
)
{}
void
nativeCamera
(
BuildContext
context
)
{
if
(
_selectList
.
length
==
maxCount
)
{
Toast
.
show
(
context
,
"最多选择
${_maxCount}
张图片"
);
return
;
}
AlbumRepository
.
getInstance
().
nativeCamera
(
provider
).
listen
((
data
)
{
print
(
"DATTTTTT
${data}
"
);
if
(
data
==
null
||
data
.
isEmpty
||
data
==
""
)
{
if
(
data
==
null
)
{
Toast
.
show
(
context
,
"没有拍摄照片"
);
}
else
{
Navigator
.
pop
(
context
,
data
);
ScanImageItem
item
=
new
ScanImageItem
();
item
.
realPath
=
data
[
"realPath"
]
as
String
;
item
.
path
=
data
[
"path"
]
as
String
;
item
.
isVideo
=
false
;
String
foldName
=
data
[
"folderName"
]
as
String
;
var
list
=
_mainValue
[
foldName
];
if
(
list
==
null
)
{
_mainValue
[
foldName
]
=
new
List
();
_mainValue
[
foldName
].
add
(
item
);
}
else
{
list
.
insert
(
0
,
item
);
}
_mainValue
[
MainDir
].
insert
(
0
,
item
);
_selectList
.
add
(
item
.
realPath
);
bool
haveIt
=
false
;
_dirList
.
forEach
((
it
)
{
if
(
it
.
dirName
==
foldName
)
{
haveIt
=
true
;
it
.
picCount
++;
}
});
if
(!
haveIt
)
{
_dirList
.
add
(
new
DirBean
(
foldName
,
1
,
File
(
item
.
path
)));
}
dirLive
.
notifyView
(
_dirList
);
albumLive
.
notifyView
(
_mainValue
[
_nowDirName
]);
selectSizeLive
.
notifyView
(
_selectList
.
length
+
_selectVideoList
.
length
);
// Navigator.pop(context, data);
// _selectList.add(data);
//TODO
}
...
...
@@ -248,4 +405,41 @@ class AlbumModel extends BaseModel {
print
(
colorString
);
backLive
.
notifyView
(
int
.
parse
(
colorString
));
}
String
getFormatTime
(
String
during
)
{
if
(
during
==
null
)
{
return
""
;
}
else
{
if
(
Platform
.
isIOS
)
{
return
during
;
}
try
{
var
parse
=
int
.
parse
(
during
);
String
min
;
int
minn
;
if
(
parse
>
60
*
1000
)
{
min
=
"00"
;
minn
=
0
;
}
else
{
minn
=
(
parse
/
(
60
*
1000
)).
floor
();
min
=
"
${minn}
"
;
}
String
second
=
"
${((parse - minn * (60 * 1000)) / 1000).floor()}
"
;
if
(
min
.
length
==
1
)
{
min
=
"0
$min
"
;
}
if
(
second
.
length
==
1
)
{
second
=
"0
$second
"
;
}
if
(
min
.
length
>
2
)
{
min
=
"99"
;
}
return
"
$min
:
$second
"
;
}
catch
(
e
)
{
print
(
e
);
return
""
;
}
}
}
}
lib/AlbumModel/page/album/AlbumPage.dart
View file @
0968a395
...
...
@@ -5,9 +5,11 @@
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:gengmei_flutter_plugin/ScanImagePlugn.dart'
;
import
'package:gmalpha_flutter/AlbumModel/bean/DirBean.dart'
;
import
'package:gmalpha_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gmalpha_flutter/commonModel/base/BasePage.dart'
;
import
'package:gmalpha_flutter/res/value/ALColors.dart'
;
import
'AlbumModel.dart'
;
...
...
@@ -15,18 +17,27 @@ import 'AlbumModel.dart';
class
AlbumPage
extends
StatefulWidget
{
AlbumModel
model
;
AlbumPage
(
String
provider
,
bool
showCamera
,
int
maxCount
,
List
<
String
>
selectedList
)
{
model
=
new
AlbumModel
(
provider
,
showCamera
,
maxCount
,
selectedList
);
AlbumPage
(
String
provider
,
bool
showCamera
,
int
maxCount
,
List
<
String
>
selectedList
,
bool
fromNative
,
int
maxVideo
,
List
<
String
>
videoSelectPath
,
String
fromPage
,
String
iosPushedPage
)
{
model
=
new
AlbumModel
(
provider
,
showCamera
,
maxCount
,
selectedList
,
fromNative
,
maxVideo
,
videoSelectPath
,
fromPage
,
iosPushedPage
);
}
@override
State
<
StatefulWidget
>
createState
()
=>
AlbumState
(
model
);
}
class
AlbumState
extends
State
<
AlbumPage
>
with
SingleTickerProviderStateMixin
{
class
AlbumState
extends
BasePage
<
AlbumPage
>
with
SingleTickerProviderStateMixin
{
final
AlbumModel
_model
;
String
colorString
=
"0x00000000"
;
AlbumState
(
this
.
_model
);
...
...
@@ -50,8 +61,8 @@ class AlbumState extends State<AlbumPage> with SingleTickerProviderStateMixin {
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
baseAppBarChangeTitle
(
backClick:
(){
Navigator
.
pop
(
context
,
null
);
backClick:
()
{
Navigator
.
pop
(
context
,
null
);
},
centerTitle:
true
,
title:
GestureDetector
(
...
...
@@ -105,18 +116,21 @@ class AlbumState extends State<AlbumPage> with SingleTickerProviderStateMixin {
initialData:
_model
.
selectSizeLive
.
data
,
builder:
(
c
,
data
)
{
String
showText
=
"下一步"
;
Color
color
=
ALColors
.
Color8E8E8E
;
if
(
data
.
data
!=
null
&&
data
.
data
!=
0
)
{
showText
=
"
$showText
(
${data.data}
)"
;
color
=
ALColors
.
Color323232
;
}
return
Center
(
child:
GestureDetector
(
onTap:
()
=>
_model
.
onNext
(
context
),
onTap:
()
{
if
(
data
.
data
!=
null
&&
data
.
data
!=
0
)
{
_model
.
onNext
(
context
);
}
},
child:
Container
(
margin:
EdgeInsets
.
fromLTRB
(
0
,
0
,
16
,
0
),
child:
Text
(
showText
,
style:
TextStyle
(
fontSize:
16
),
),
child:
baseText
(
showText
,
16
,
color
),
)));
},
)
...
...
@@ -125,29 +139,33 @@ class AlbumState extends State<AlbumPage> with SingleTickerProviderStateMixin {
body:
Stack
(
children:
<
Widget
>[
mainView
(),
StreamBuilder
<
int
>(
stream:
_model
.
backLive
.
stream
,
initialData:
_model
.
backLive
.
data
,
builder:
(
con
,
data
)
{
if
(
data
.
data
==
null
)
{
return
Container
();
}
return
GestureDetector
(
onTap:
()
{
_model
.
changPopState
();
},
child:
Container
(
width:
double
.
maxFinite
,
height:
double
.
maxFinite
,
color:
Color
(
data
.
data
),
));
},
),
backView
(),
popWindow
(),
],
));
}
backView
()
{
return
StreamBuilder
<
int
>(
stream:
_model
.
backLive
.
stream
,
initialData:
_model
.
backLive
.
data
,
builder:
(
con
,
data
)
{
if
(
data
.
data
==
null
)
{
return
Container
();
}
return
GestureDetector
(
onTap:
()
{
_model
.
changPopState
();
},
child:
Container
(
width:
double
.
maxFinite
,
height:
double
.
maxFinite
,
color:
Color
(
data
.
data
),
));
},
);
}
@override
void
dispose
()
{
controller
.
dispose
();
...
...
@@ -171,9 +189,9 @@ class AlbumState extends State<AlbumPage> with SingleTickerProviderStateMixin {
}
return
GridView
.
builder
(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
3
,
crossAxisSpacing:
5
,
mainAxisSpacing:
5
,
crossAxisCount:
4
,
crossAxisSpacing:
1
,
mainAxisSpacing:
1
,
childAspectRatio:
1
),
itemCount:
_model
.
showCamera
?
imgList
.
data
.
length
+
1
:
imgList
.
data
.
length
,
...
...
@@ -181,33 +199,24 @@ class AlbumState extends State<AlbumPage> with SingleTickerProviderStateMixin {
if
(
index
==
0
&&
_model
.
showCamera
)
{
return
GestureDetector
(
onTap:
()
=>
_model
.
nativeCamera
(
context
),
child:
Container
(
color:
Colors
.
yellow
,
child:
Column
(
children:
<
Widget
>[
Expanded
(
child:
Container
(),
),
Icon
(
Icons
.
camera_alt
),
Container
(
margin:
EdgeInsets
.
fromLTRB
(
0
,
5
,
0
,
0
),
child:
Text
(
"本地相机"
),
),
Expanded
(
child:
Container
(),
),
],
)));
child:
Center
(
child:
SvgPicture
.
asset
(
"images/camera.svg"
),
));
}
int
newIndex
=
_model
.
showCamera
?
index
-
1
:
index
;
if
(
imgList
.
data
[
newIndex
]
==
null
||
imgList
.
data
[
newIndex
].
path
==
null
||
imgList
.
data
[
newIndex
].
realPath
==
null
)
{
imgList
.
data
[
newIndex
].
realPath
==
null
&&
Platform
.
isAndroid
)
{
return
Icon
(
Icons
.
photo
,
size:
20
,
);
}
String
during
;
if
(
_model
.
maxVideoCount
>
0
&&
_model
.
isVideo
(
newIndex
))
{
during
=
_model
.
getFormatTime
(
imgList
.
data
[
newIndex
].
during
);
// print("druing ${imgList.data[newIndex].during} dur ${during}");
}
return
GestureDetector
(
onTap:
()
=>
_model
.
clickItem
(
context
,
newIndex
),
child:
Container
(
...
...
@@ -216,26 +225,38 @@ class AlbumState extends State<AlbumPage> with SingleTickerProviderStateMixin {
image:
FileImage
(
File
(
imgList
.
data
[
newIndex
].
path
)),
fit:
BoxFit
.
cover
),
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
3.0
))),
margin:
EdgeInsets
.
only
(
left:
2
,
top:
2
,
right:
2
,
bottom:
2
),
margin:
EdgeInsets
.
only
(
left:
1
,
top:
1
,
right:
1
,
bottom:
1
),
child:
Stack
(
alignment:
AlignmentDirectional
.
topEnd
,
children:
<
Widget
>[
_model
.
isSelect
(
newIndex
)
?
Icon
(
Icons
.
check_circle
,
color:
Colors
.
amberAccent
,
size:
25
,
)
:
Icon
(
Icons
.
check_circle_outline
,
color:
Colors
.
grey
,
size:
25
,
),
_model
.
isFullSelect
()
&&
!
_model
.
isSelect
(
newIndex
)
?
Container
(
width:
double
.
maxFinite
,
height:
double
.
maxFinite
,
color:
Colors
.
white60
,
_model
.
maxVideoCount
>
0
&&
_model
.
isVideo
(
newIndex
)
?
_model
.
isSelectVideo
(
newIndex
)
?
SvgPicture
.
asset
(
"images/album_sel.svg"
)
:
SvgPicture
.
asset
(
"images/album_not_sel.svg"
)
:
_model
.
isSelect
(
newIndex
)
?
SvgPicture
.
asset
(
"images/album_sel.svg"
)
:
SvgPicture
.
asset
(
"images/album_not_sel.svg"
),
_model
.
maxVideoCount
>
0
&&
_model
.
isVideo
(
newIndex
)
?
_model
.
isFullSelectVideo
()
&&
!
_model
.
isSelectVideo
(
newIndex
)
?
Container
(
width:
double
.
maxFinite
,
height:
double
.
maxFinite
,
color:
ALColors
.
Color33000000
,
)
:
Container
()
:
_model
.
isFullSelect
()
&&
!
_model
.
isSelect
(
newIndex
)
?
Container
(
width:
double
.
maxFinite
,
height:
double
.
maxFinite
,
color:
ALColors
.
Color33000000
,
)
:
Container
(),
_model
.
maxVideoCount
>
0
&&
_model
.
isVideo
(
newIndex
)
?
Positioned
(
left:
50
,
top:
70
,
child:
baseText
(
during
,
15
,
ALColors
.
ColorF8F8F8
),
)
:
Container
()
],
...
...
@@ -268,7 +289,7 @@ class AlbumState extends State<AlbumPage> with SingleTickerProviderStateMixin {
return
SlideTransition
(
position:
animation
,
child:
Container
(
padding:
EdgeInsets
.
fromLTRB
(
1
6
,
3
,
16
,
3
),
padding:
EdgeInsets
.
fromLTRB
(
1
2
,
6
,
21
,
6
),
color:
Colors
.
white
,
height:
280
,
child:
ListView
.
separated
(
...
...
@@ -282,25 +303,37 @@ class AlbumState extends State<AlbumPage> with SingleTickerProviderStateMixin {
child:
Row
(
children:
<
Widget
>[
Container
(
width:
5
0
,
height:
5
0
,
width:
5
2
,
height:
5
2
,
child:
Image
.
file
(
snapshot
.
data
[
index
].
pic
,
fit:
BoxFit
.
cover
,
),
),
Container
(
padding:
EdgeInsets
.
fromLTRB
(
5
,
0
,
0
,
0
),
child:
Text
(
"
${snapshot.data[index].dirName}
(
${snapshot.data[index].picCount}
)"
),
padding:
EdgeInsets
.
fromLTRB
(
10
,
0
,
0
,
0
),
child:
baseText
(
"
${snapshot.data[index].dirName}
(
${snapshot.data[index].picCount}
)"
,
11
,
ALColors
.
Color323232
),
),
Expanded
(
child:
Text
(
""
),
),
Icon
(
Icons
.
chevron_right
)
//
Icon(Icons.chevron_right)
],
),
);
})));
}
@override
String
pageName
()
{
return
"album"
;
}
@override
String
referrer
()
{
return
_model
.
fromPage
;
}
}
lib/AlbumModel/repository/AlbumRepository.dart
View file @
0968a395
...
...
@@ -24,21 +24,28 @@ class AlbumRepository {
Observable
<
Map
<
String
,
List
<
ScanImageItem
>>>
scanPhoneImg
()
{
return
Observable
.
fromFuture
(
GengmeiFlutterPlugin
.
phoneImages
())
.
map
((
value
)
{
if
(
value
!=
null
)
{
_cacheList
.
clear
();
_cacheList
.
addAll
(
value
);
}
// Map<String, List<ScanImageItem>> finalList = new Map();
// var all = value["IsGengmeiAlbumAllImages"];
// if (all != null) {
// value.forEach((k, v) {
// List<ScanImageItem> newList = List();
// v.forEach((value) {
//
// });
// });
// }
//
// if (value != null) {}
return
value
;
});
}
get
cacheList
=>
_cacheList
;
void
clearMemory
()
{
_cacheList
.
clear
();
}
Observable
<
String
>
nativeCamera
(
String
provider
)
{
Observable
<
Map
>
nativeCamera
(
String
provider
)
{
return
Observable
.
fromFuture
(
GengmeiFlutterPlugin
.
nativeCamera
(
provider
));
}
...
...
lib/NewMessageModel/page/messagePage/common.dart
View file @
0968a395
...
...
@@ -24,18 +24,17 @@ Widget messageTop(imgUrl, title, content, count) {
children:
<
Widget
>[
Container
(
padding:
EdgeInsets
.
only
(
top:
height
,
bottom:
height
),
margin:
EdgeInsets
.
only
(
left:
ScreenUtil
.
instance
.
setWidth
(
4
)),
margin:
EdgeInsets
.
only
(
left:
ScreenUtil
.
instance
.
setWidth
(
4
)),
width:
double
.
infinity
,
height:
ScreenUtil
.
instance
.
setHeight
(
50
),
child:
Row
(
children:
<
Widget
>[
Hero
(
tag:
"icon"
,
child:
SvgPicture
.
asset
(
imgUrl
,
color:
ALColors
.
Color323232
,
)),
tag:
"icon"
,
child:
SvgPicture
.
asset
(
imgUrl
,
color:
ALColors
.
Color323232
,
)),
SizedBox
(
width:
ScreenUtil
.
instance
.
setWidth
(
8
),
),
...
...
@@ -164,7 +163,9 @@ Widget messageList(Data list) {
"page_name"
:
"message_home"
,
"topic_id"
:
"
${list.repliedContent.topicId}
"
,
"user_name"
:
list
.
name
,
"pictorial_id"
:
list
.
repliedContent
.
pictorialId
"pictorial_id"
:
list
.
repliedContent
.
pictorialId
==
null
?
null
:
list
.
repliedContent
.
pictorialId
});
},
child:
Container
(
...
...
lib/TestPage.dart
View file @
0968a395
...
...
@@ -13,7 +13,7 @@ class TestPage extends StatelessWidget {
TestPage
()
{
Api
.
getInstance
().
setDioCookie
({
'Cookie'
:
'
sessionid=oji01pi0mou9l5ktg425mibrimyq5vc3;_gtid=120408d4f3c911e99a80525400e82fab6178;_gm_token=06e936157164441
8'
'
_gm_token=709ed71571898502; sessionid=usixwh8e2bfykdsiq5ydt0ss6kfc0c26; _gtid=52ebb2a2f62611e9b181525400e82fab383
8'
});
}
...
...
@@ -50,10 +50,9 @@ class TestPage extends StatelessWidget {
testMessagePage
(
BuildContext
context
)
{
return
base
(
context
,
()
{
Navigator
.
push
(
context
,
new
CustomRoute
(
RouterCenterImpl
()
.
findNewMessageRouter
()?.
getMessagePage
(
''
))
);
context
,
new
CustomRoute
(
RouterCenterImpl
().
findNewMessageRouter
()?.
getMessagePage
(
''
)));
},
"消息页面"
);
}
...
...
@@ -82,7 +81,12 @@ class TestPage extends StatelessWidget {
Navigator
.
push
(
context
,
new
CustomRoute
(
RouterCenterImpl
().
findAlbumRouter
()?.
getAlbumPage
(
"com.example.gengmei_flutter_plugin_example"
,
true
,
9
,
null
)));
"com.example.gmalpha_flutter"
,
true
,
9
,
null
,
false
,
"test"
,
maxVideoCount:
1
)));
},
"相册页面"
);
}
...
...
@@ -99,30 +103,30 @@ class TestPage extends StatelessWidget {
attentionPage
(
BuildContext
context
)
{
return
base
(
context
,
()
{
Navigator
.
push
(
context
,
new
CustomRoute
(
RouterCenterImpl
()
.
findNewMessageRouter
()?.
getAttentionPage
(
'message_home'
)
)
);
context
,
new
CustomRoute
(
RouterCenterImpl
()
.
findNewMessageRouter
(
)
?.
getAttentionPage
(
'message_home'
))
);
},
"通知页面"
);
}
likePage
(
BuildContext
context
)
{
return
base
(
context
,
()
{
Navigator
.
push
(
context
,
new
CustomRoute
(
RouterCenterImpl
()
.
findNewMessageRouter
()?.
getLikePage
(
'message_home'
)
)
);
context
,
new
CustomRoute
(
RouterCenterImpl
()
.
findNewMessageRouter
(
)
?.
getLikePage
(
'message_home'
))
);
},
"like页面"
);
}
focusPage
(
BuildContext
context
)
{
return
base
(
context
,
()
{
Navigator
.
push
(
context
,
new
CustomRoute
(
RouterCenterImpl
()
.
findNewMessageRouter
()?.
getFocusPage
(
'message_home'
)
)
);
context
,
new
CustomRoute
(
RouterCenterImpl
()
.
findNewMessageRouter
(
)
?.
getFocusPage
(
'message_home'
))
);
},
"关注页面"
);
}
}
lib/commonModel/base/AppBase.dart
View file @
0968a395
...
...
@@ -21,7 +21,9 @@ const NET_TYPE = "GET_NET_TYPE";
const
INIT_PARAMS
=
"INIT_PARAMS"
;
const
UPLOAD_IMG
=
"UPLOAD_IMG"
;
const
USER_LOGOUT
=
"USER_LOGOUT"
;
const
platform
=
const
MethodChannel
(
'flutter_channel'
);
const
FINISH_CURRENT_ACTIVITY
=
"FINISH_CURRENT_ACTIVITY"
;
const
ALBUM_RESULT
=
"ALBUM_RESULT"
;
const
methodChannel
=
const
MethodChannel
(
'flutter_channel'
);
const
eventChannel
=
const
EventChannel
(
'flutter_channel_event'
);
StreamSubscription
_listen
;
...
...
@@ -30,7 +32,7 @@ void jumpToH5(String jumpToName, Map params) {
if
(
params
!=
null
)
{
map
.
addAll
(
params
);
}
platform
.
invokeMethod
(
"FLUTTER_TO_H5"
,
map
);
methodChannel
.
invokeMethod
(
"FLUTTER_TO_H5"
,
map
);
}
void
jumpToNative
(
String
jumpToName
,
Map
params
)
{
...
...
@@ -38,7 +40,7 @@ void jumpToNative(String jumpToName, Map params) {
if
(
params
!=
null
)
{
map
.
addAll
(
params
);
}
platform
.
invokeMethod
(
"FLUTTER_TO_NATIVE"
,
map
);
methodChannel
.
invokeMethod
(
"FLUTTER_TO_NATIVE"
,
map
);
}
void
jumpToFlutter
(
String
jumpToName
,
Map
params
)
{
...
...
@@ -46,35 +48,45 @@ void jumpToFlutter(String jumpToName, Map params) {
if
(
params
!=
null
)
{
map
.
addAll
(
params
);
}
platform
.
invokeMethod
(
"FLUTTER_TO_FLUTTER"
,
map
);
methodChannel
.
invokeMethod
(
"FLUTTER_TO_FLUTTER"
,
map
);
}
Future
getBuriedInfo
(
)
async
{
return
await
platform
.
invokeMethod
(
BURIED_METHOD
,
null
);
return
await
methodChannel
.
invokeMethod
(
BURIED_METHOD
,
null
);
}
Observable
messagePopPicker
(
Map
params
)
{
return
Observable
.
fromFuture
(
platform
.
invokeMethod
(
"MESSAGE_POP_PICKER"
,
params
));
methodChannel
.
invokeMethod
(
"MESSAGE_POP_PICKER"
,
params
));
}
Observable
getNetType
(
)
{
return
Observable
.
fromFuture
(
platform
.
invokeMethod
(
NET_TYPE
,
null
));
return
Observable
.
fromFuture
(
methodChannel
.
invokeMethod
(
NET_TYPE
,
null
));
}
Observable
<
String
>
uploadImg
(
String
path
,
String
token
)
{
return
Observable
.
fromFuture
(
platform
.
invokeMethod
(
UPLOAD_IMG
,
{
"path"
:
path
,
"token"
:
token
}));
methodChannel
.
invokeMethod
(
UPLOAD_IMG
,
{
"path"
:
path
,
"token"
:
token
}));
}
Observable
<
bool
>
userLogout
()
{
return
Observable
.
fromFuture
(
platform
.
invokeMethod
(
USER_LOGOUT
));
return
Observable
.
fromFuture
(
methodChannel
.
invokeMethod
(
USER_LOGOUT
));
}
Observable
<
bool
>
finishCurrentActivity
()
{
return
Observable
.
fromFuture
(
methodChannel
.
invokeMethod
(
FINISH_CURRENT_ACTIVITY
));
}
Observable
<
bool
>
albumResult
(
Map
selectList
)
{
return
Observable
.
fromFuture
(
methodChannel
.
invokeMethod
(
ALBUM_RESULT
,
selectList
));
}
void
initParams
(
VoidCallback
callback
)
{
_listen
=
eventChannel
.
receiveBroadcastStream
().
listen
(
_onEvent
,
onError:
_onError
);
platform
.
invokeMethod
(
INIT_PARAMS
,
null
).
then
((
value
)
{
methodChannel
.
invokeMethod
(
INIT_PARAMS
,
null
).
then
((
value
)
{
print
(
"lsy INITPARAMS !!
$value
"
);
Api
.
getInstance
().
initBuildConfig
(
value
);
initBuried
(
callback
);
...
...
lib/commonModel/base/BaseComponent.dart
View file @
0968a395
...
...
@@ -28,12 +28,14 @@ AppBar baseAppBarChangeTitle(
bool
centerTitle
,
VoidCallback
backClick
})
{
return
AppBar
(
backgroundColor:
ALColors
.
ColorFFFFFF
,
title:
title
,
centerTitle:
centerTitle
,
elevation:
0.0
,
leading:
GestureDetector
(
onTap:
backClick
,
child:
Container
(
color:
ALColors
.
ColorFFFFFF
,
alignment:
Alignment
.
centerLeft
,
padding:
EdgeInsets
.
only
(
left:
22
),
width:
30
,
...
...
lib/commonModel/picker/base/BaseCenterPicker.dart
View file @
0968a395
...
...
@@ -15,12 +15,14 @@ class BaseCenterPicker extends StatefulWidget {
setPicker
(
ICenterPicker
picker
)
{
this
.
picker
=
picker
;
}
sync
()
{
centerState
?.
setState
(()
{});
}
setCancelOutside
(
bool
cancel
)
{
this
.
cancelOutSide
=
cancel
;
centerState
?.
setState
(()
{});
}
show
(
BuildContext
context
)
{
...
...
@@ -41,9 +43,8 @@ class BaseCenterPicker extends StatefulWidget {
class
BaseCenterPickerState
extends
State
<
BaseCenterPicker
>
{
@override
Widget
build
(
BuildContext
context
)
{
ScreenUtil
.
instance
=
ScreenUtil
(
width:
375
,
height:
667
)..
init
(
context
);
return
CupertinoFullscreenDialogTransition
(
child:
Container
(
// ScreenUtil.instance = ScreenUtil(width: 375, height: 667)..init(context);
return
Container
(
color:
Colors
.
black54
,
width:
double
.
maxFinite
,
height:
double
.
maxFinite
,
...
...
@@ -63,7 +64,7 @@ class BaseCenterPickerState extends State<BaseCenterPicker> {
))
],
),
)
)
;
);
}
}
...
...
lib/main.dart
View file @
0968a395
...
...
@@ -7,10 +7,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import
'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart'
;
import
'package:gmalpha_flutter/Error_Page.dart'
;
import
'package:gmalpha_flutter/TestPage.dart'
;
import
'package:gmalpha_flutter/commonModel/cache/CacheManager.dart'
;
import
'package:gmalpha_flutter/commonModel/net/Api.dart'
;
import
'package:gmalpha_flutter/commonModel/util/IsolateUtil.dart'
;
import
'package:gmalpha_flutter/messageModel/home/message_home.dart'
;
import
'commonModel/GMBase.dart'
;
...
...
@@ -59,16 +55,26 @@ class _MyAppState extends State<MyApp> {
if
(
params
==
null
)
{
return
ErrorPage
(
"出错:需要传递的参数为空"
);
}
var
provider
=
params
[
"provider"
]
as
String
;
return
RouterCenterImpl
().
findAlbumRouter
().
getAlbumPage
(
p
rovider
,
p
arams
[
"provider"
]
as
String
,
params
[
"needCamera"
]
==
null
?
true
:
params
[
"needCamera"
]
==
"0"
?
true
:
false
,
params
[
"maxCount"
]
==
null
?
1
:
int
.
parse
(
params
[
"maxCount"
]),
params
[
"selectedPath"
]
==
null
?
null
:
params
[
"selectedPath"
]
as
List
<
String
>);
:
new
List
<
String
>.
from
(
params
[
"selectedPath"
]),
true
,
params
[
"fromPage"
]
==
null
?
""
:
params
[
"fromPage"
],
maxVideoCount:
params
[
"maxVideoCount"
]
==
null
?
0
:
int
.
parse
(
params
[
"maxVideoCount"
]),
videoSelectPath:
params
[
"videoSelectedPath"
]
==
null
?
null
:
new
List
<
String
>.
from
(
params
[
"videoSelectedPath"
]),
iosPushedPage:
params
[
"iosPushedPage"
]
==
null
?
null
:
params
[
"iosPushedPage"
]);
},
"prestige"
:
(
pageName
,
params
,
_
)
{
print
(
"PARAMS!!
${params}
"
);
...
...
@@ -87,13 +93,13 @@ class _MyAppState extends State<MyApp> {
return
RouterCenterImpl
()
.
findActivityReportRouter
()
?.
getActivityReportPage
(
params
[
"survey_record_id"
]
==
null
?
null
:
int
.
parse
(
params
[
"survey_record_id"
]),
params
[
"template_id"
]
==
null
?
null
:
int
.
parse
(
params
[
"template_id"
]),
params
[
"fromPage"
]);
params
[
"survey_record_id"
]
==
null
?
null
:
int
.
parse
(
params
[
"survey_record_id"
]),
params
[
"template_id"
]
==
null
?
null
:
int
.
parse
(
params
[
"template_id"
]),
params
[
"fromPage"
]);
},
"message_focus"
:
(
pageName
,
params
,
_
)
{
return
RouterCenterImpl
()
...
...
lib/res/value/ALColors.dart
View file @
0968a395
...
...
@@ -26,6 +26,7 @@ class ALColors {
static
const
Color
Color5276F4
=
Color
(
0xFF5276F4
);
static
const
Color
Color0093FF
=
Color
(
0xFF0093FF
);
static
const
Color
Color666666
=
Color
(
0xFF666666
);
static
const
Color
Color33000000
=
Color
(
0x33000000
);
}
lib/userModel/page/userSetting/UserSettingModel.dart
View file @
0968a395
...
...
@@ -4,6 +4,7 @@
**/
import
'dart:async'
;
import
'dart:io'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
...
...
@@ -113,7 +114,13 @@ class UserSettingModel extends BaseModel {
jumpToCamera
(
context
,
pageName
,
Api
.
PROVIDER_NAME
,
true
,
1
,
null
)
.
then
((
value
)
{
if
(
value
!=
null
)
{
print
(
"
$value
"
);
selectImgPath
=
value
[
0
];
File
txt
=
File
(
selectImgPath
);
var
dir_bool
=
txt
.
exists
().
then
((
value
){
print
(
"RESULT!!!!!
$selectImgPath
bool
${value}
"
);
});
headImgLive
.
notifyView
(
selectImgPath
);
detectUpdate
();
}
...
...
lib/userModel/page/userSetting/UserSettingPage.dart
View file @
0968a395
...
...
@@ -10,6 +10,7 @@ import 'package:cached_network_image/cached_network_image.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:gmalpha_flutter/NewMessageModel/page/messagePage/common.dart'
;
import
'package:gmalpha_flutter/commonModel/GMBase.dart'
;
import
'package:gmalpha_flutter/commonModel/base/BaseBuried.dart'
;
import
'package:gmalpha_flutter/commonModel/base/BaseComponent.dart'
;
...
...
@@ -53,6 +54,7 @@ class UserState extends BasePage<UserSettingPage> {
baseLoadingItem
=
BaseLoadingItem
(
"加载中"
);
userLogoutPicker
=
UserLogoutPicker
(()
{
logoutPicker
.
setPicker
(
baseLoadingItem
);
logoutPicker
.
sync
();
_model
.
quit
(
context
,
pageName
(),
()
{
logoutPicker
.
dismiss
(
context
);
});
...
...
@@ -94,8 +96,10 @@ class UserState extends BasePage<UserSettingPage> {
}
else
{
return
GestureDetector
(
onTap:
()
{
BaseCenterPicker
()..
setPicker
(
BaseLoadingItem
(
"加载中"
))
..
setCancelOutside
(
true
)..
show
(
context
);
var
picker
=
BaseCenterPicker
()
..
setPicker
(
BaseLoadingItem
(
"加载中"
))
..
setCancelOutside
(
true
);
picker
.
show
(
context
);
_model
.
save
(
context
);
},
child:
Padding
(
...
...
@@ -115,7 +119,7 @@ class UserState extends BasePage<UserSettingPage> {
Container
(
margin:
EdgeInsets
.
fromLTRB
(
ScreenUtil
.
instance
.
setWidth
(
29
),
ScreenUtil
.
instance
.
setWidth
(
25
),
0
,
0
),
child:
baseText
(
"设置"
,
30
,
ALColors
.
Color323232
),
child:
baseText
(
'设置'
,
30
,
ALColors
.
Color323232
),
),
Container
(
width:
ScreenUtil
.
instance
.
setWidth
(
127
),
...
...
@@ -127,6 +131,7 @@ class UserState extends BasePage<UserSettingPage> {
ScreenUtil
.
instance
.
setWidth
(
23
)),
child:
GestureDetector
(
onTap:
()
{
clickEvent
(
"page_setting_up"
,
"photograph"
);
_model
.
jumpToCAM
(
context
,
pageName
());
},
child:
Stack
(
...
...
@@ -230,8 +235,8 @@ class UserState extends BasePage<UserSettingPage> {
jumpToComment
(
context
,
pageName
());
},
"意见与建议"
,
null
,
true
),
baseDivide
(
1
,
30
,
ALColors
.
ColorE4E4E4
),
baseItem
(()
{},
"隐私声明"
,
null
,
true
),
baseDivide
(
1
,
30
,
ALColors
.
ColorE4E4E4
),
//
baseItem(() {}, "隐私声明", null, true),
//
baseDivide(1, 30, ALColors.ColorE4E4E4),
],
),
Expanded
(
...
...
@@ -246,9 +251,10 @@ class UserState extends BasePage<UserSettingPage> {
right:
ScreenUtil
.
instance
.
setWidth
(
30
)),
child:
OutlineButton
(
onPressed:
()
{
clickEvent
(
"page_setting_up"
,
"quit"
);
logoutPicker
.
show
(
context
);
},
child:
baseText
(
"退出登
入
"
,
14
,
ALColors
.
Color323232
),
child:
baseText
(
"退出登
录
"
,
14
,
ALColors
.
Color323232
),
borderSide:
new
BorderSide
(
color:
Color
(
0xff323232
)),
),
)
...
...
lib/userModel/util/JumpUtil.dart
View file @
0968a395
...
...
@@ -19,7 +19,7 @@ Future jumpToCamera(BuildContext context, String refer, String provider,
return
Navigator
.
push
(
context
,
CustomRoute
(
RouterCenterImpl
().
findAlbumRouter
()?.
getAlbumPage
(
provider
,
showCamera
,
bigSelectImage
,
selectedImages
)));
provider
,
showCamera
,
bigSelectImage
,
selectedImages
,
false
,
refer
)));
}
Future
jumpToCountry
(
BuildContext
context
,
String
refer
)
{
...
...
pubspec.yaml
View file @
0968a395
...
...
@@ -39,7 +39,7 @@ dependencies:
gengmei_flutter_plugin
:
git
:
url
:
'
git@git.wanmeizhensuo.com:linshengyu/flutter_plugin.git'
ref
:
"
703b4906beabe5fa9ba4e5e76a5b43799a25f89
b"
ref
:
"
00b2ed0f616c59ba5352a1dd9a3ed1fe8b2d7cd
b"
protobuf
:
^0.14.4
grpc
:
^2.1.2
flutter_svg
:
^0.14.1
...
...
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