Commit 2614a897 authored by 林生雨's avatar 林生雨

fix

parent 0431ebee
package io.flutter.plugins; package io.flutter.plugins;
import io.flutter.plugin.common.PluginRegistry; import io.flutter.plugin.common.PluginRegistry;
import com.taobao.idlefish.flutterboost.FlutterBoostPlugin; import com.idlefish.flutterboost.FlutterBoostPlugin;
import com.example.flutter_drag_scale.FlutterDragScalePlugin; import com.example.flutter_drag_scale.FlutterDragScalePlugin;
import com.example.gengmei_flutter_plugin.GengmeiFlutterPlugin; import com.example.gengmei_flutter_plugin.GengmeiFlutterPlugin;
import io.flutter.plugins.pathprovider.PathProviderPlugin; import io.flutter.plugins.pathprovider.PathProviderPlugin;
import com.tekartik.sqflite.SqflitePlugin; import com.tekartik.sqflite.SqflitePlugin;
import fleamarket.taobao.com.xservicekit.XserviceKitPlugin;
/** /**
* Generated file. Do not edit. * Generated file. Do not edit.
...@@ -16,12 +15,11 @@ public final class GeneratedPluginRegistrant { ...@@ -16,12 +15,11 @@ public final class GeneratedPluginRegistrant {
if (alreadyRegisteredWith(registry)) { if (alreadyRegisteredWith(registry)) {
return; return;
} }
FlutterBoostPlugin.registerWith(registry.registrarFor("com.taobao.idlefish.flutterboost.FlutterBoostPlugin")); FlutterBoostPlugin.registerWith(registry.registrarFor("com.idlefish.flutterboost.FlutterBoostPlugin"));
FlutterDragScalePlugin.registerWith(registry.registrarFor("com.example.flutter_drag_scale.FlutterDragScalePlugin")); FlutterDragScalePlugin.registerWith(registry.registrarFor("com.example.flutter_drag_scale.FlutterDragScalePlugin"));
GengmeiFlutterPlugin.registerWith(registry.registrarFor("com.example.gengmei_flutter_plugin.GengmeiFlutterPlugin")); GengmeiFlutterPlugin.registerWith(registry.registrarFor("com.example.gengmei_flutter_plugin.GengmeiFlutterPlugin"));
PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin")); PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin"));
SqflitePlugin.registerWith(registry.registrarFor("com.tekartik.sqflite.SqflitePlugin")); SqflitePlugin.registerWith(registry.registrarFor("com.tekartik.sqflite.SqflitePlugin"));
XserviceKitPlugin.registerWith(registry.registrarFor("fleamarket.taobao.com.xservicekit.XserviceKitPlugin"));
} }
private static boolean alreadyRegisteredWith(PluginRegistry registry) { private static boolean alreadyRegisteredWith(PluginRegistry registry) {
......
...@@ -3,8 +3,6 @@ package com.example.gmalpha_flutter ...@@ -3,8 +3,6 @@ package com.example.gmalpha_flutter
import android.app.Activity import android.app.Activity
import android.app.Application import android.app.Application
import android.content.Context import android.content.Context
import com.taobao.idlefish.flutterboost.FlutterBoostPlugin
import com.taobao.idlefish.flutterboost.interfaces.IPlatform
import io.flutter.BuildConfig import io.flutter.BuildConfig
import io.flutter.Log import io.flutter.Log
import io.flutter.view.FlutterMain import io.flutter.view.FlutterMain
......
...@@ -8,8 +8,6 @@ import android.os.Bundle ...@@ -8,8 +8,6 @@ import android.os.Bundle
import android.support.v7.app.AppCompatActivity import android.support.v7.app.AppCompatActivity
import android.util.Log import android.util.Log
import android.view.View import android.view.View
import com.taobao.idlefish.flutterboost.FlutterBoostPlugin
import com.taobao.idlefish.flutterboost.containers.BoostFlutterActivity
import io.flutter.app.FlutterActivity import io.flutter.app.FlutterActivity
import io.flutter.embedding.engine.plugins.FlutterPlugin import io.flutter.embedding.engine.plugins.FlutterPlugin
......
...@@ -175,6 +175,13 @@ function ios(){ ...@@ -175,6 +175,13 @@ function ios(){
cp -r /Users/apple/lsy/gmalpha_flutter/ios/Flutter/App.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project cp -r /Users/apple/lsy/gmalpha_flutter/ios/Flutter/App.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project
cp -r /Users/apple/lsy/gmalpha_flutter/ios/Flutter/Flutter.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project cp -r /Users/apple/lsy/gmalpha_flutter/ios/Flutter/Flutter.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project
cp -r /Users/apple/lsy/gmalpha_flutter/build/ios/Release-iphoneos/gengmei_flutter_plugin/gengmei_flutter_plugin.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project cp -r /Users/apple/lsy/gmalpha_flutter/build/ios/Release-iphoneos/gengmei_flutter_plugin/gengmei_flutter_plugin.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project
# cp -r /Users/apple/lsy/gmalpha_flutter/build/ios/Release-iphoneos/flutter_boost/flutter_boost.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project
# cp -r /Users/apple/lsy/gmalpha_flutter/build/ios/Release-iphoneos/FMDB/FMDB.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project
# cp -r /Users/apple/lsy/gmalpha_flutter/build/ios/Release-iphoneos/path_provider/path_provider.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project
# cp -r /Users/apple/lsy/gmalpha_flutter/build/ios/Release-iphoneos/sqflite/sqflite.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project
# cp -r /Users/apple/lsy/gmalpha_flutter/build/ios/Release-iphoneos/flutter_drag_scale/flutter_drag_scale.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project
} }
function ios_publish(){ function ios_publish(){
...@@ -260,12 +267,12 @@ mkdir /Users/apple/lsy/aar_update/androd${message}/ ...@@ -260,12 +267,12 @@ mkdir /Users/apple/lsy/aar_update/androd${message}/
mkdir /Users/apple/lsy/aar_update/ios${message}/ mkdir /Users/apple/lsy/aar_update/ios${message}/
clean clean
android_apk #android_apk
#android #android
#android_publish #android_publish
#copyAAR #copyAAR
#upload_android_aar #upload_android_aar
#ios ios
#ios_publish #ios_publish
#notifyDingDing #notifyDingDing
......
...@@ -20,9 +20,6 @@ import 'package:gmalpha_flutter/commonModel/live/LiveData.dart'; ...@@ -20,9 +20,6 @@ import 'package:gmalpha_flutter/commonModel/live/LiveData.dart';
import 'package:gmalpha_flutter/commonModel/toast/toast.dart'; import 'package:gmalpha_flutter/commonModel/toast/toast.dart';
import 'package:gmalpha_flutter/res/GMRes.dart'; import 'package:gmalpha_flutter/res/GMRes.dart';
const String MainDir = "IsGengmeiAlbumAllImages";
const String MainDirExplain = "全部相片";
Map<String, List<ScanImageItem>> paseAlbum(Object event) { Map<String, List<ScanImageItem>> paseAlbum(Object event) {
var map = Map<String, List<dynamic>>.from(event); var map = Map<String, List<dynamic>>.from(event);
var newMap = Map<String, List<ScanImageItem>>(); var newMap = Map<String, List<ScanImageItem>>();
...@@ -54,27 +51,18 @@ Map<String, List<ScanImageItem>> paseAlbum(Object event) { ...@@ -54,27 +51,18 @@ Map<String, List<ScanImageItem>> paseAlbum(Object event) {
} }
class AlbumModel extends BaseModel { class AlbumModel extends BaseModel {
AlbumRepository repo = AlbumRepository.getInstance();
LiveData<List<ScanImageItem>> albumLive = LiveData(); LiveData<List<ScanImageItem>> albumLive = LiveData();
LiveData<int> selectSizeLive = LiveData(); LiveData<int> selectSizeLive = LiveData();
LiveData<List<DirBean>> dirLive = LiveData(); LiveData<List<DirBean>> dirLive = LiveData();
LiveData<String> titleData = LiveData(); LiveData<String> titleData = LiveData();
LiveData<int> backLive = LiveData(); LiveData<int> backLive = LiveData();
Map<String, List<ScanImageItem>> _mainValue = Map();
List<String> _selectList = List();
List<String> _selectVideoList = List();
String _nowDirName = MainDir; String _nowDirName = MainDir;
StreamSubscription _listen; StreamSubscription _listen;
bool showCamera = true; bool showCamera = true;
final String provider; final String provider;
int _maxCount = 1; int _maxCount = 1;
get selectList => _selectList;
get maxCount => _maxCount;
get nowDirName { get nowDirName {
if (_nowDirName == MainDir) { if (_nowDirName == MainDir) {
return MainDirExplain; return MainDirExplain;
...@@ -91,8 +79,6 @@ class AlbumModel extends BaseModel { ...@@ -91,8 +79,6 @@ class AlbumModel extends BaseModel {
final String iosPushedPage; final String iosPushedPage;
final String noVideoHint; final String noVideoHint;
get dirList => _dirList;
AlbumModel( AlbumModel(
this.provider, this.provider,
this.showCamera, this.showCamera,
...@@ -102,52 +88,29 @@ class AlbumModel extends BaseModel { ...@@ -102,52 +88,29 @@ class AlbumModel extends BaseModel {
int maxVideoCount, int maxVideoCount,
List<String> videoSelectPath, List<String> videoSelectPath,
this.fromPage, this.fromPage,
this.iosPushedPage this.iosPushedPage,
,this.noVideoHint) { this.noVideoHint) {
print("======>>>>>${selectedList} ${videoSelectPath} <<<<<====="); repo.clear();
this.maxVideoCount = maxVideoCount; this.maxVideoCount = maxVideoCount;
this._maxCount = maxCount; this._maxCount = maxCount;
if (selectedList != null && !selectedList.isEmpty) { if (selectedList != null && !selectedList.isEmpty) {
this._selectList.clear(); repo.updateSelectPhoto(selectedList);
this._selectList.addAll(selectedList);
} }
if (videoSelectPath != null && !videoSelectPath.isEmpty) { if (videoSelectPath != null && !videoSelectPath.isEmpty) {
this._selectVideoList.clear(); repo.updateSelectVideo(videoSelectPath);
this._selectVideoList.addAll(videoSelectPath);
} }
} }
void _onEvent(Object event) { void _onEvent(Object event) {
// if (Platform.isAndroid) {
// var map = (event as Map);
// 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"];
// itemList[i].realPath = key[i]["realPath"];
// }
// }
// });
// }
// albumLive.notifyView(_mainValue[_nowDirName]);
// } else {
compute(paseAlbum, event).then((value) { compute(paseAlbum, event).then((value) {
_mainValue = value; repo.updataMainValue(value);
_dirList.clear(); _dirList.clear();
_mainValue.forEach((k, v) { repo.getMainValue().forEach((k, v) {
_dirList.add(DirBean( _dirList.add(DirBean(
k == MainDir ? MainDirExplain : k, v.length, File(v[0].path))); k == MainDir ? MainDirExplain : k, v.length, File(v[0].path)));
}); });
albumLive.notifyView(_mainValue[_nowDirName]); albumLive.notifyView(repo.getMainValue()[_nowDirName]);
}); });
// }
} }
void _onError(Object error) { void _onError(Object error) {
...@@ -156,13 +119,14 @@ class AlbumModel extends BaseModel { ...@@ -156,13 +119,14 @@ class AlbumModel extends BaseModel {
void initScanImages(BuildContext context) { void initScanImages(BuildContext context) {
titleData.notifyView(MainDirExplain); titleData.notifyView(MainDirExplain);
selectSizeLive.notifyView(_selectList.length + _selectVideoList.length); selectSizeLive.notifyView(
repo.getSelectPhoto().length + repo.getSelectVideo().length);
_listen = GengmeiFlutterPlugin.phoneImagesEvent _listen = GengmeiFlutterPlugin.phoneImagesEvent
.receiveBroadcastStream() .receiveBroadcastStream()
.listen(_onEvent, onError: _onError); .listen(_onEvent, onError: _onError);
AlbumRepository.getInstance().scanPhoneImg().listen((value) { AlbumRepository.getInstance().scanPhoneImg().listen((value) {
if (value != null) { if (value != null) {
_mainValue = value; repo.updataMainValue(value);
value.forEach((key, eachValue) { value.forEach((key, eachValue) {
if (eachValue != null && !eachValue.isEmpty) { if (eachValue != null && !eachValue.isEmpty) {
if (key == MainDir) { if (key == MainDir) {
...@@ -195,10 +159,9 @@ class AlbumModel extends BaseModel { ...@@ -195,10 +159,9 @@ class AlbumModel extends BaseModel {
}); });
} }
void changDir() {}
@override @override
void dispose() { void dispose() {
GengmeiFlutterPlugin.quitPage();
if (_listen != null) { if (_listen != null) {
_listen.cancel(); _listen.cancel();
} }
...@@ -207,15 +170,14 @@ class AlbumModel extends BaseModel { ...@@ -207,15 +170,14 @@ class AlbumModel extends BaseModel {
albumLive.dispost(); albumLive.dispost();
dirLive.dispost(); dirLive.dispost();
titleData.dispost(); titleData.dispost();
GengmeiFlutterPlugin.quitPage();
} }
bool isSelect(int index) { bool isSelect(int index) {
bool haveIt = false; bool haveIt = false;
if (_selectList.isEmpty) { if (repo.getSelectPhoto().isEmpty) {
return false; return false;
} }
_selectList.forEach((value) { repo.getSelectPhoto().forEach((value) {
if (Platform.isAndroid) { if (Platform.isAndroid) {
if (value == albumLive.data[index].realPath) { if (value == albumLive.data[index].realPath) {
haveIt = true; haveIt = true;
...@@ -232,10 +194,10 @@ class AlbumModel extends BaseModel { ...@@ -232,10 +194,10 @@ class AlbumModel extends BaseModel {
bool isSelectVideo(int index) { bool isSelectVideo(int index) {
bool haveIt = false; bool haveIt = false;
if (_selectVideoList.isEmpty) { if (repo.getSelectVideo().isEmpty) {
return false; return false;
} }
_selectVideoList.forEach((value) { repo.getSelectVideo().forEach((value) {
if (Platform.isAndroid) { if (Platform.isAndroid) {
if (value == albumLive.data[index].realPath) { if (value == albumLive.data[index].realPath) {
haveIt = true; haveIt = true;
...@@ -250,11 +212,11 @@ class AlbumModel extends BaseModel { ...@@ -250,11 +212,11 @@ class AlbumModel extends BaseModel {
} }
bool isFullSelect() { bool isFullSelect() {
return _selectList.length == _maxCount; return repo.getSelectPhoto().length == _maxCount;
} }
bool isFullSelectVideo() { bool isFullSelectVideo() {
return _selectVideoList.length == maxVideoCount; return repo.getSelectVideo().length == maxVideoCount;
} }
bool isVideo(int index) { bool isVideo(int index) {
...@@ -262,8 +224,8 @@ class AlbumModel extends BaseModel { ...@@ -262,8 +224,8 @@ class AlbumModel extends BaseModel {
} }
void clickItem(BuildContext context, int index) { void clickItem(BuildContext context, int index) {
if(maxVideoCount==0&&albumLive.data[index].isVideo){ if (maxVideoCount == 0 && albumLive.data[index].isVideo) {
if(noVideoHint!=null){ if (noVideoHint != null) {
Toast.show(context, noVideoHint); Toast.show(context, noVideoHint);
} }
return; return;
...@@ -275,45 +237,47 @@ class AlbumModel extends BaseModel { ...@@ -275,45 +237,47 @@ class AlbumModel extends BaseModel {
path = albumLive.data[index].path; path = albumLive.data[index].path;
} }
if (maxVideoCount > 0 && albumLive.data[index].isVideo) { if (maxVideoCount > 0 && albumLive.data[index].isVideo) {
if (!_selectVideoList.contains(path)) { if (!repo.getSelectVideo().contains(path)) {
if (_selectVideoList.length >= maxVideoCount) { if (repo.getSelectVideo().length >= maxVideoCount) {
Toast.show(context, "最多选择${maxVideoCount}个视频"); Toast.show(context, "最多选择${maxVideoCount}个视频");
return; return;
} }
_selectVideoList.add(path); repo.addVideo(path);
} else { } else {
_selectVideoList.remove(path); repo.removeVideo(path);
} }
} else { } else {
if (!_selectList.contains(path)) { if (!repo.getSelectPhoto().contains(path)) {
if (_selectList.length >= _maxCount) { if (repo.getSelectPhoto().length >= _maxCount) {
Toast.show(context, "最多选择${_maxCount}张图片"); Toast.show(context, "最多选择${_maxCount}张图片");
return; return;
} }
_selectList.add(path); repo.addPhoto(path);
} else { } else {
_selectList.remove(path); repo.removePhoto(path);
} }
} }
albumLive.notifyView(albumLive.data); albumLive.notifyView(albumLive.data);
selectSizeLive.notifyView(_selectList.length + _selectVideoList.length); selectSizeLive.notifyView(
repo.getSelectPhoto().length + repo.getSelectVideo().length);
} }
void onNext(BuildContext context) { void onNext(BuildContext context) {
RouterCenterImpl() RouterCenterImpl()
.findBuriedRouter() .findBuriedRouter()
?.onEvent("post_add_pic_click_next", {"page_name": "post_add_pic"}); ?.onEvent("post_add_pic_click_next", {"page_name": "post_add_pic"});
if (_selectList.isEmpty && _selectVideoList.isEmpty) { if (repo.getSelectPhoto().isEmpty && repo.getSelectVideo().isEmpty) {
Navigator.pop(context, null); Navigator.pop(context, null);
} else { } else {
if (fromNative) { if (fromNative) {
if (Platform.isAndroid) { if (Platform.isAndroid) {
albumResult({"image": _selectList, "video": _selectVideoList}); albumResult(
{"image": repo.getSelectPhoto(), "video": repo.getSelectVideo()});
} else { } else {
iosAlbum(_selectList, context, (image) { iosAlbum(repo.getSelectPhoto(), context, (image) {
iosAlbum(_selectVideoList, context, (video) { iosAlbum(repo.getSelectVideo(), context, (video) {
var newImages = List<String>(); var newImages = List<String>();
for (String item in _selectList) { for (String item in repo.getSelectPhoto()) {
for (Map real in image) { for (Map real in image) {
var map = Map<String, String>.from(real); var map = Map<String, String>.from(real);
if (map["path"] == item) { if (map["path"] == item) {
...@@ -323,7 +287,7 @@ class AlbumModel extends BaseModel { ...@@ -323,7 +287,7 @@ class AlbumModel extends BaseModel {
} }
} }
var newVideos = List<String>(); var newVideos = List<String>();
for (String item in _selectVideoList) { for (String item in repo.getSelectVideo()) {
for (Map real in video) { for (Map real in video) {
var map = Map<String, String>.from(real); var map = Map<String, String>.from(real);
if (map["path"] == item) { if (map["path"] == item) {
...@@ -335,9 +299,9 @@ class AlbumModel extends BaseModel { ...@@ -335,9 +299,9 @@ class AlbumModel extends BaseModel {
print("IM ${newImages} $image VIDEI ${newVideos} ${video}"); print("IM ${newImages} $image VIDEI ${newVideos} ${video}");
Navigator.pop(context); Navigator.pop(context);
albumResult({ albumResult({
"image": _selectList, "image": repo.getSelectPhoto(),
"image_real": newImages, "image_real": newImages,
"video": _selectVideoList, "video": repo.getSelectVideo(),
"video_real": newVideos, "video_real": newVideos,
"iosPushedPage": iosPushedPage "iosPushedPage": iosPushedPage
}); });
...@@ -346,9 +310,9 @@ class AlbumModel extends BaseModel { ...@@ -346,9 +310,9 @@ class AlbumModel extends BaseModel {
} }
} else { } else {
if (Platform.isAndroid) { if (Platform.isAndroid) {
Navigator.pop(context, _selectList); Navigator.pop(context, repo.getSelectPhoto());
} else { } else {
iosAlbum(_selectList, context, (value) { iosAlbum(repo.getSelectPhoto(), context, (value) {
print(value); print(value);
List<String> resultList = new List(); List<String> resultList = new List();
resultList.add(Map<String, String>.from(value[0])["realImagePath"]); resultList.add(Map<String, String>.from(value[0])["realImagePath"]);
...@@ -370,16 +334,14 @@ class AlbumModel extends BaseModel { ...@@ -370,16 +334,14 @@ class AlbumModel extends BaseModel {
} }
int allSelectSize() { int allSelectSize() {
return _selectList.length + _selectVideoList.length; return repo.getSelectPhoto().length + repo.getSelectVideo().length;
} }
void iosAlbumGetImagePath(String path, int index) {}
void nativeCamera(BuildContext context) { void nativeCamera(BuildContext context) {
RouterCenterImpl() RouterCenterImpl()
.findBuriedRouter() .findBuriedRouter()
?.onEvent("post_add_pic_click_camera", {"page_name": "post_add_pic"}); ?.onEvent("post_add_pic_click_camera", {"page_name": "post_add_pic"});
if (_selectList.length == maxCount) { if (repo.getSelectPhoto().length == _maxCount) {
Toast.show(context, "最多选择${_maxCount}张图片"); Toast.show(context, "最多选择${_maxCount}张图片");
return; return;
} }
...@@ -392,18 +354,11 @@ class AlbumModel extends BaseModel { ...@@ -392,18 +354,11 @@ class AlbumModel extends BaseModel {
item.path = data["path"] as String; item.path = data["path"] as String;
item.isVideo = false; item.isVideo = false;
String foldName = data["folderName"] as String; String foldName = data["folderName"] as String;
var list = _mainValue[foldName]; repo.addItem(item, foldName);
if (list == null) {
_mainValue[foldName] = new List();
_mainValue[foldName].add(item);
} else {
list.insert(0, item);
}
_mainValue[MainDir].insert(0, item);
if (Platform.isAndroid) { if (Platform.isAndroid) {
_selectList.add(item.realPath); repo.addPhoto(item.realPath);
} else { } else {
_selectList.add(item.path); repo.addPhoto(item.path);
} }
bool haveIt = false; bool haveIt = false;
_dirList.forEach((it) { _dirList.forEach((it) {
...@@ -416,8 +371,9 @@ class AlbumModel extends BaseModel { ...@@ -416,8 +371,9 @@ class AlbumModel extends BaseModel {
_dirList.add(new DirBean(foldName, 1, File(item.path))); _dirList.add(new DirBean(foldName, 1, File(item.path)));
} }
dirLive.notifyView(_dirList); dirLive.notifyView(_dirList);
albumLive.notifyView(_mainValue[_nowDirName]); albumLive.notifyView(repo.getMainValue()[_nowDirName]);
selectSizeLive.notifyView(_selectList.length + _selectVideoList.length); selectSizeLive.notifyView(
repo.getSelectPhoto().length + repo.getSelectVideo().length);
// Navigator.pop(context, data); // Navigator.pop(context, data);
// _selectList.add(data); // _selectList.add(data);
//TODO //TODO
...@@ -428,26 +384,6 @@ class AlbumModel extends BaseModel { ...@@ -428,26 +384,6 @@ class AlbumModel extends BaseModel {
}); });
} }
void AiCamera(BuildContext context) {
if (_selectList.length == maxCount) {
Toast.show(context, "最多选择${_maxCount}张图片");
return;
}
AlbumRepository.getInstance().aiCamera().listen((data) {
if (data == null || data.isEmpty || data == "") {
Toast.show(context, "没有拍摄照片");
} else {
Navigator.pop(context, data);
// _selectList.add(data);
//TODO
}
}).onError((error) {});
}
File getDirPic(int index) {
return File(_mainValue[_dirList[index]][0].path);
}
void changPopState() { void changPopState() {
if (showPop) { if (showPop) {
showPop = false; showPop = false;
...@@ -471,7 +407,39 @@ class AlbumModel extends BaseModel { ...@@ -471,7 +407,39 @@ class AlbumModel extends BaseModel {
_nowDirName = dirName; _nowDirName = dirName;
changPopState(); changPopState();
showPop = false; showPop = false;
albumLive.notifyView(_mainValue[dirName]); albumLive.notifyView(repo.getMainValue()[dirName]);
}
void previewItem(BuildContext context, int index, String pageName) {
String path = Platform.isAndroid
? albumLive.data[index].realPath
: albumLive.data[index].path;
print("LSY $path");
if (albumLive.data[index].isVideo) {
GengmeiFlutterPlugin.playAlbumVideo(path);
} else {
// GengmeiFlutterPlugin.previewImage(path);
Navigator.push(
context,
CustomRoute(AlbumPreviewPage(
path,
albumLive.data[index].size,
albumLive.data,
_maxCount,
maxVideoCount,
noVideoHint,
index)))
.then((value) {
albumLive.notifyView(repo.getMainValue()[_nowDirName]);
selectSizeLive.notifyView(
repo.getSelectPhoto().length + repo.getSelectVideo().length);
if (value != null) {
if (value == -1) {
onNext(context);
}
}
});
}
} }
void backAnim(double dy) { void backAnim(double dy) {
...@@ -487,54 +455,4 @@ class AlbumModel extends BaseModel { ...@@ -487,54 +455,4 @@ class AlbumModel extends BaseModel {
print(colorString); print(colorString);
backLive.notifyView(int.parse(colorString)); backLive.notifyView(int.parse(colorString));
} }
String getFormatTime(String during) {
if (during == null) {
return "";
} else {
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 "";
}
}
}
void previewItem(BuildContext context, int index, String pageName) {
String path = Platform.isAndroid
? albumLive.data[index].realPath
: albumLive.data[index].path;
print("LSY $path");
if (albumLive.data[index].isVideo) {
GengmeiFlutterPlugin.playAlbumVideo(path);
} else {
GengmeiFlutterPlugin.previewImage(path);
// Navigator.push(
// context,
// CustomRoute(
// AlbumPreviewPage(path, albumLive.data[index].size, pageName)));
}
}
} }
...@@ -10,6 +10,7 @@ import 'package:flutter_svg/flutter_svg.dart'; ...@@ -10,6 +10,7 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:gengmei_flutter_plugin/ScanImagePlugn.dart'; import 'package:gengmei_flutter_plugin/ScanImagePlugn.dart';
import 'package:gmalpha_flutter/AlbumModel/bean/DirBean.dart'; import 'package:gmalpha_flutter/AlbumModel/bean/DirBean.dart';
import 'package:gmalpha_flutter/AlbumModel/page/preview/AlbumPreviewPage.dart'; import 'package:gmalpha_flutter/AlbumModel/page/preview/AlbumPreviewPage.dart';
import 'package:gmalpha_flutter/AlbumModel/util/AlbumUtil.dart';
import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart'; import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart';
import 'package:gmalpha_flutter/commonModel/base/BaseComponent.dart'; import 'package:gmalpha_flutter/commonModel/base/BaseComponent.dart';
import 'package:gmalpha_flutter/commonModel/base/BasePage.dart'; import 'package:gmalpha_flutter/commonModel/base/BasePage.dart';
...@@ -32,8 +33,17 @@ class AlbumPage extends StatefulWidget { ...@@ -32,8 +33,17 @@ class AlbumPage extends StatefulWidget {
String fromPage, String fromPage,
String iosPushedPage, String iosPushedPage,
String noVideoHint) { String noVideoHint) {
model = new AlbumModel(provider, showCamera, maxCount, selectedList, model = new AlbumModel(
fromNative, maxVideo, videoSelectPath, fromPage, iosPushedPage,noVideoHint); provider,
showCamera,
maxCount,
selectedList,
fromNative,
maxVideo,
videoSelectPath,
fromPage,
iosPushedPage,
noVideoHint);
} }
@override @override
...@@ -43,6 +53,7 @@ class AlbumPage extends StatefulWidget { ...@@ -43,6 +53,7 @@ class AlbumPage extends StatefulWidget {
class AlbumState extends BasePage<AlbumPage> class AlbumState extends BasePage<AlbumPage>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
final AlbumModel _model; final AlbumModel _model;
ScrollController scrollController = new ScrollController();
AlbumState(this._model); AlbumState(this._model);
...@@ -177,6 +188,7 @@ class AlbumState extends BasePage<AlbumPage> ...@@ -177,6 +188,7 @@ class AlbumState extends BasePage<AlbumPage>
@override @override
void dispose() { void dispose() {
scrollController.dispose();
_model.dispose(); _model.dispose();
controller.dispose(); controller.dispose();
super.dispose(); super.dispose();
...@@ -197,6 +209,7 @@ class AlbumState extends BasePage<AlbumPage> ...@@ -197,6 +209,7 @@ class AlbumState extends BasePage<AlbumPage>
); );
} }
return GridView.builder( return GridView.builder(
controller: scrollController,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4, crossAxisCount: 4,
crossAxisSpacing: 1, crossAxisSpacing: 1,
...@@ -224,7 +237,7 @@ class AlbumState extends BasePage<AlbumPage> ...@@ -224,7 +237,7 @@ class AlbumState extends BasePage<AlbumPage>
} }
String during; String during;
if (_model.isVideo(newIndex)) { if (_model.isVideo(newIndex)) {
during = _model.getFormatTime(imgList.data[newIndex].during); during = AlbumUtil.getFormatTime(imgList.data[newIndex].during);
} }
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
......
...@@ -7,17 +7,29 @@ import 'dart:typed_data'; ...@@ -7,17 +7,29 @@ import 'dart:typed_data';
import 'dart:ui'; import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gengmei_flutter_plugin/ScanImagePlugn.dart';
import 'package:gengmei_flutter_plugin/gengmei_flutter_plugin.dart'; import 'package:gengmei_flutter_plugin/gengmei_flutter_plugin.dart';
import 'package:gmalpha_flutter/AlbumModel/repository/AlbumRepository.dart';
import 'package:gmalpha_flutter/commonModel/GMBase.dart'; import 'package:gmalpha_flutter/commonModel/GMBase.dart';
import 'package:gmalpha_flutter/commonModel/toast/toast.dart'; import 'package:gmalpha_flutter/commonModel/toast/toast.dart';
class AlbumPreviewModel extends BaseModel { class AlbumPreviewModel extends BaseModel {
AlbumRepository repo = AlbumRepository.getInstance();
var imageLive = LiveData<String>(); var imageLive = LiveData<String>();
var pageList = LiveData<List<ScanImageItem>>();
var titleLive = LiveData<String>();
var selectLive = LiveData<bool>();
var nextLive = LiveData<int>();
final String imgPath; final String imgPath;
int size; int size;
int _maxCount;
int maxVideoCount;
String noVideoHint;
AlbumPreviewModel(this.imgPath, this.size); AlbumPreviewModel(this.imgPath, this.size, this._maxCount, this.maxVideoCount,
this.noVideoHint);
getPreviewImage(BuildContext context) { getPreviewImage(BuildContext context) {
print("IMAGE SIZE ===> $size"); print("IMAGE SIZE ===> $size");
...@@ -33,6 +45,7 @@ class AlbumPreviewModel extends BaseModel { ...@@ -33,6 +45,7 @@ class AlbumPreviewModel extends BaseModel {
// } // }
} }
//
// Future<Codec> _loadAsync(ResizeFileImage key) async { // Future<Codec> _loadAsync(ResizeFileImage key) async {
// assert(key == this); // assert(key == this);
// final Uint8List bytes = await file.readAsBytes(); // final Uint8List bytes = await file.readAsBytes();
...@@ -52,8 +65,129 @@ class AlbumPreviewModel extends BaseModel { ...@@ -52,8 +65,129 @@ class AlbumPreviewModel extends BaseModel {
// }); // });
// } // }
void getItem(String path, BuildContext context) {
List<String> temp = [path];
}
@override @override
void dispose() { void dispose() {
nextLive.dispost();
selectLive.dispost();
pageList.dispost();
imageLive.dispost(); imageLive.dispost();
titleLive.dispost();
}
void getRealPath(BuildContext context, int index) {
if(Platform.isAndroid){
pageList.notifyView(fromPage);
return;
}
GengmeiFlutterPlugin.ios_album_path([fromPage[index].path]).then((value) {
print("HEEEEEEE ");
var map = Map<String, String>.from(value[0]);
print(map);
fromPage[index].realPath = map["realImagePath"];
pageList.notifyView(fromPage);
}).catchError((error) {
Toast.show(context, error.toString());
print(error);
});
}
List<ScanImageItem> fromPage;
void setList(List<ScanImageItem> fromPage) {
this.fromPage = fromPage;
}
void init(BuildContext context) {
nextLive.notifyView(
repo.getSelectVideo().length + repo.getSelectPhoto().length);
}
void clickItem(BuildContext context) {
if (maxVideoCount == 0 && fromPage[currentIndex].isVideo) {
if (noVideoHint != null) {
Toast.show(context, noVideoHint);
}
return;
}
String path;
if (Platform.isAndroid) {
path = fromPage[currentIndex].realPath;
} else {
path = fromPage[currentIndex].path;
}
if (maxVideoCount > 0 && fromPage[currentIndex].isVideo) {
if (!repo.getSelectVideo().contains(path)) {
if (repo.getSelectVideo().length >= maxVideoCount) {
Toast.show(context, "最多选择${maxVideoCount}个视频");
return;
}
repo.addVideo(path);
selectLive.notifyView(true);
} else {
repo.removeVideo(path);
selectLive.notifyView(false);
}
} else {
if (!repo.getSelectPhoto().contains(path)) {
if (repo.getSelectPhoto().length >= _maxCount) {
Toast.show(context, "最多选择${_maxCount}张图片");
return;
}
repo.addPhoto(path);
selectLive.notifyView(true);
} else {
repo.removePhoto(path);
selectLive.notifyView(false);
}
}
nextLive.notifyView(
repo.getSelectPhoto().length + repo.getSelectVideo().length);
}
int currentIndex;
void pageIndex(int index) {
currentIndex = index;
bool haveIt = false;
repo.getSelectPhoto().forEach((value) {
if (Platform.isAndroid) {
if (value == fromPage[index].realPath) {
haveIt = true;
}
} else {
if (value == fromPage[index].path) {
haveIt = true;
}
}
});
repo.getSelectVideo().forEach((value) {
if (Platform.isAndroid) {
if (value == fromPage[index].realPath) {
haveIt = true;
}
} else {
if (value == fromPage[index].path) {
haveIt = true;
}
}
});
selectLive.notifyView(haveIt);
titleLive.notifyView("${currentIndex+1} / ${fromPage.length}");
}
void playVideo() {
if (fromPage[currentIndex].isVideo) {
String path = Platform.isAndroid
? fromPage[currentIndex].realPath
: fromPage[currentIndex].path;
GengmeiFlutterPlugin.playAlbumVideo(path);
}
}
void onNext() {
} }
} }
...@@ -2,73 +2,274 @@ ...@@ -2,73 +2,274 @@
* @author lsy * @author lsy
* @date 2019-11-01 * @date 2019-11-01
**/ **/
import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_drag_scale/core/drag_scale_widget.dart'; import 'package:flutter_drag_scale/core/drag_scale_widget.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:gengmei_flutter_plugin/ScanImagePlugn.dart';
import 'package:gmalpha_flutter/AlbumModel/page/preview/AlbumPreviewModel.dart'; import 'package:gmalpha_flutter/AlbumModel/page/preview/AlbumPreviewModel.dart';
import 'package:gmalpha_flutter/commonModel/base/BaseComponent.dart'; import 'package:gmalpha_flutter/commonModel/base/BaseComponent.dart';
import 'package:gmalpha_flutter/commonModel/toast/toast.dart';
import 'package:gmalpha_flutter/res/GMRes.dart';
class AlbumPreviewPage extends StatefulWidget { class AlbumPreviewPage extends StatefulWidget {
AlbumPreviewModel _model; AlbumPreviewModel _model;
String fromPage; List<ScanImageItem> fromPage;
int startIndex;
AlbumPreviewPage(String imgPath, int size, this.fromPage) { AlbumPreviewPage(String imgPath, int size, this.fromPage, int maxPhotoCount,
_model = AlbumPreviewModel(imgPath,size); int maxVideoCount, String hint, this.startIndex) {
_model =
AlbumPreviewModel(imgPath, size, maxPhotoCount, maxVideoCount, hint);
} }
@override @override
State<StatefulWidget> createState() => AlbumPreviewState(_model, fromPage); State<StatefulWidget> createState() => AlbumPreviewState(_model, fromPage);
} }
class AlbumPreviewState extends State<AlbumPreviewPage> { class AlbumPreviewState extends State<AlbumPreviewPage>
with SingleTickerProviderStateMixin {
AlbumPreviewModel _model; AlbumPreviewModel _model;
final String fromPage; PageController _pageController;
Size _size;
Animation<Offset> animation;
AnimationController controller;
bool showPop = true;
AlbumPreviewState(this._model, this.fromPage); AlbumPreviewState(this._model, List<ScanImageItem> fromPage) {
_model.setList(fromPage);
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_model.getPreviewImage(context); _model.init(context);
_pageController = PageController(initialPage: widget.startIndex);
_pageController.addListener(() {});
_model.pageIndex(widget.startIndex);
controller = new AnimationController(
duration: const Duration(milliseconds: 100), vsync: this);
animation =
Tween(begin: Offset(0, 0), end: Offset(0, -1)).animate(controller);
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( _size = MediaQuery.of(context).size;
onWillPop: () { return Scaffold(
Navigator.pop(context); // appBar: baseAppBar(backClick: () {
}, // Navigator.pop(context);
child: Scaffold( // }),
appBar: baseAppBar(backClick: () { body: Container(
Navigator.pop(context); color: Colors.black,
}), child: Stack(
body: Container( children: <Widget>[
alignment: Alignment.center, getPage(),
width: double.maxFinite, SlideTransition(
height: double.maxFinite, position: animation,
child: StreamBuilder( child: Container(
stream: _model.imageLive.stream, width: double.maxFinite,
initialData: _model.imageLive.data, height: 80,
builder: ((con, data) { alignment: Alignment.center,
if (data.data == null) { color: Colors.black38,
return loadingItem(); child: Stack(
} // alignment: AlignmentDirectional.topCenter,
return DragScaleContainer( children: <Widget>[
doubleTapStillScale: false, Positioned(
child: new Image.file( left: 0,
File( top: 0,
_model.imgPath, child: GestureDetector(
), onTap: () {
Navigator.pop(context, _model.currentIndex);
},
child: Container(
color: Colors.transparent,
padding: EdgeInsets.only(
left: 22,
top: 38,
),
child: SvgPicture.asset(
"images/left_arrow.svg",
color: Colors.white,
)),
),
),
Container(
alignment: Alignment.topCenter,
width: double.maxFinite,
height: 80,
padding: EdgeInsets.only(top: 41),
child: StreamBuilder<String>(
stream: _model.titleLive.stream,
initialData: _model.titleLive.data,
builder: (con, data) {
if (data.data == null) {
return baseText("", 16, ALColors.ColorFFFFFF);
}
return baseText(
data.data, 16, ALColors.ColorFFFFFF);
},
),
),
Positioned(
right: 22,
top: 39,
child: StreamBuilder<int>(
stream: _model.nextLive.stream,
initialData: _model.nextLive.data,
builder: (con, data) {
if (data.data == null || data.data == 0) {
return baseText(
"下一步", 16, ALColors.ColorC4C4C4);
}
return GestureDetector(
onTap: () {
Navigator.pop(context, -1);
},
child: baseText("下一步(${data.data})", 16,
ALColors.ColorFFFFFF));
},
)),
],
),
),
),
Positioned(
top: 100,
right: 0,
child: GestureDetector(
onTap: () {
_model.clickItem(context);
},
child: StreamBuilder<bool>(
stream: _model.selectLive.stream,
initialData: _model.selectLive.data,
builder: (con, data) {
if (data.data == null || !data.data) {
return Container(
color: Colors.transparent,
padding: EdgeInsets.only(
top: 20, right: 22, bottom: 20),
child: SvgPicture.asset(
"images/album_not_sel.svg"));
}
return Container(
padding: EdgeInsets.only(
top: 20, right: 22, bottom: 20),
color: Colors.transparent,
child:
SvgPicture.asset("images/album_sel.svg"));
})),
),
],
)));
// Container(
// alignment: Alignment.center,
// width: double.maxFinite,
// height: double.maxFinite,
// child: StreamBuilder(
// stream: _model.imageLive.stream,
// initialData: _model.imageLive.data,
// builder: ((con, data) {
// if (data.data == null) {
// return loadingItem();
// }
// return DragScaleContainer(
// doubleTapStillScale: false,
// child: new Image.file(
// File(
// _model.imgPath,
// ),
// fit: BoxFit.fitWidth,
// ));
// })))));
}
getPage() {
return StreamBuilder<List<ScanImageItem>>(
stream: _model.pageList.stream,
initialData: _model.pageList.data,
builder: (con, data) {
return PageView.builder(
onPageChanged: (index) {
_model.pageIndex(index);
},
itemBuilder: (con, index) {
print("INDEXXX $index ");
if (data.data != null && data.data[index].isVideo) {
return Stack(
alignment: AlignmentDirectional.center,
children: <Widget>[
ConstrainedBox(
constraints: BoxConstraints.expand(),
child: GestureDetector(
onTap: (){
hide();
},
child: Image.file(File(data.data[index].path),
fit: BoxFit.fitWidth),
)),
GestureDetector(
onTap: () {
_model.playVideo();
},
child: Icon(
Icons.play_circle_filled,
size: 80,
),
)
],
);
}
if (data.data == null ||
data.data[index].realPath == null ||
data.data[index].realPath.isEmpty) {
_model.getRealPath(context, index);
return loadingItem();
}
return Container(
alignment: Alignment.center,
child: ConstrainedBox(
constraints: BoxConstraints.expand(),
child: DragScaleContainer(
doubleTapStillScale: false,
child: GestureDetector(
onTap: () {
hide();
},
child: Image.file(
File(data.data[index].realPath),
fit: BoxFit.fitWidth, fit: BoxFit.fitWidth,
)); )))),
}))))); );
},
itemCount: _model.fromPage.length,
scrollDirection: Axis.horizontal,
reverse: false,
controller: _pageController,
physics: PageScrollPhysics(parent: ClampingScrollPhysics()),
);
},
);
}
hide(){
if (showPop) {
controller.forward();
} else {
controller.reverse();
}
showPop = !showPop;
} }
@override @override
void dispose() { void dispose() {
_pageController.dispose();
_model.dispose(); _model.dispose();
controller.dispose();
super.dispose(); super.dispose();
} }
// @override // @override
......
...@@ -7,6 +7,9 @@ import 'package:gengmei_flutter_plugin/ScanImagePlugn.dart'; ...@@ -7,6 +7,9 @@ import 'package:gengmei_flutter_plugin/ScanImagePlugn.dart';
import 'package:gengmei_flutter_plugin/gengmei_flutter_plugin.dart'; import 'package:gengmei_flutter_plugin/gengmei_flutter_plugin.dart';
import 'package:rxdart/rxdart.dart'; import 'package:rxdart/rxdart.dart';
const String MainDir = "IsGengmeiAlbumAllImages";
const String MainDirExplain = "全部相片";
class AlbumRepository { class AlbumRepository {
AlbumRepository._(); AlbumRepository._();
...@@ -19,30 +22,38 @@ class AlbumRepository { ...@@ -19,30 +22,38 @@ class AlbumRepository {
return _instance; return _instance;
} }
Map<String, List<ScanImageItem>> _cacheList = new Map(); Map<String, List<ScanImageItem>> _mainValue = Map();
List<String> _selectList = List();
List<String> _selectVideoList = List();
Observable<Map<String, List<ScanImageItem>>> scanPhoneImg() { Observable<Map<String, List<ScanImageItem>>> scanPhoneImg() {
return Observable.fromFuture(GengmeiFlutterPlugin.phoneImages()) return Observable.fromFuture(GengmeiFlutterPlugin.phoneImages());
.map((value) { }
// Map<String, List<ScanImageItem>> finalList = new Map();
// var all = value["IsGengmeiAlbumAllImages"]; void updataMainValue(Map<String, List<ScanImageItem>> value) {
// if (all != null) { _mainValue = value;
// value.forEach((k, v) { }
// List<ScanImageItem> newList = List();
// v.forEach((value) { Map<String, List<ScanImageItem>> getMainValue() {
// return _mainValue;
// }); }
// });
// }
//
// if (value != null) {}
return value; void updateSelectPhoto(List<String> value) {
}); _selectList.clear();
_selectList.addAll(value);
} }
void clearMemory() { void updateSelectVideo(List<String> value) {
_cacheList.clear(); _selectVideoList.clear();
_selectVideoList.addAll(value);
}
List<String> getSelectPhoto() {
return _selectList;
}
List<String> getSelectVideo() {
return _selectVideoList;
} }
Observable<Map> nativeCamera(String provider) { Observable<Map> nativeCamera(String provider) {
...@@ -52,4 +63,39 @@ class AlbumRepository { ...@@ -52,4 +63,39 @@ class AlbumRepository {
Observable<String> aiCamera() { Observable<String> aiCamera() {
// return Observable.fromFuture(GengmeiFlutterPlugin.aiCamera()); // return Observable.fromFuture(GengmeiFlutterPlugin.aiCamera());
} }
void addItem(ScanImageItem item, String foldName) {
if (_mainValue != null) {
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);
}
}
void addVideo(String path) {
_selectVideoList.add(path);
}
void removeVideo(String path) {
_selectVideoList.remove(path);
}
void addPhoto(String path) {
_selectList.add(path);
}
void removePhoto(String path) {
_selectList.remove(path);
}
void clear() {
_selectList.clear();
_selectVideoList.clear();
_mainValue.clear();
}
} }
/*
* @author lsy
* @date 2019-11-12
**/
class AlbumUtil{
static String getFormatTime(String during) {
if (during == null) {
return "";
} else {
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 "";
}
}
}
}
\ No newline at end of file
...@@ -85,8 +85,8 @@ class TestPage extends StatelessWidget { ...@@ -85,8 +85,8 @@ class TestPage extends StatelessWidget {
Navigator.push( Navigator.push(
context, context,
new CustomRoute(RouterCenterImpl().findAlbumRouter()?.getAlbumPage( new CustomRoute(RouterCenterImpl().findAlbumRouter()?.getAlbumPage(
"com.example.gmalpha_flutter", true, 1, null, false, "test", "com.example.gmalpha_flutter", true, 9, null, false, "test",
maxVideoCount: 0))); maxVideoCount: 0,noVideoHint: "测试测试测试")));
}, "相册页面"); }, "相册页面");
} }
......
...@@ -116,9 +116,9 @@ class UserSettingModel extends BaseModel { ...@@ -116,9 +116,9 @@ class UserSettingModel extends BaseModel {
if (value != null) { if (value != null) {
print("$value"); print("$value");
selectImgPath = value[0]; selectImgPath = value[0];
File txt=File(selectImgPath); File txt = File(selectImgPath);
var dir_bool=txt.exists().then((value){ var dir_bool = txt.exists().then((value) {
print("RESULT!!!!!$selectImgPath bool ${value}" ); print("RESULT!!!!!$selectImgPath bool ${value}");
}); });
headImgLive.notifyView(selectImgPath); headImgLive.notifyView(selectImgPath);
...@@ -213,7 +213,7 @@ class UserSettingModel extends BaseModel { ...@@ -213,7 +213,7 @@ class UserSettingModel extends BaseModel {
UserEntityImpl().savecountryInfoId(countryId); UserEntityImpl().savecountryInfoId(countryId);
UserEntityImpl().savecountryInfoName(cityLive.data); UserEntityImpl().savecountryInfoName(cityLive.data);
Timer(Duration(milliseconds: 100), () { Timer(Duration(milliseconds: 100), () {
FlutterBoost.singleton.closePageForContext(context); Navigator.pop(context);
// Navigator.pop(context); // Navigator.pop(context);
}); });
// FlutterBoost.singleton.closePageForContext(context); // FlutterBoost.singleton.closePageForContext(context);
......
...@@ -125,7 +125,6 @@ class _MyAppState extends State<MyApp> { ...@@ -125,7 +125,6 @@ class _MyAppState extends State<MyApp> {
?.getFindPage(params["fromPage"]); ?.getFindPage(params["fromPage"]);
}, },
}); });
FlutterBoost.handleOnStartPage();
} }
@override @override
......
...@@ -27,7 +27,11 @@ dependencies: ...@@ -27,7 +27,11 @@ dependencies:
dio: ^2.2.2 dio: ^2.2.2
rxdart: ^0.22.0 #链式编程 rxdart: ^0.22.0 #链式编程
pull_to_refresh: ^1.5.0 pull_to_refresh: ^1.5.0
flutter_boost: ^0.0.420 flutter_boost: ^0.1.60
# flutter_boost:
# git:
# url: 'https://github.com/alibaba/flutter_boost.git'
# ref: '0.1.60'
event_bus: ^1.1.0 event_bus: ^1.1.0
# gengmei_flutter_plugin: ^0.0.731 # gengmei_flutter_plugin: ^0.0.731
# flutter_boost: # flutter_boost:
...@@ -39,14 +43,16 @@ dependencies: ...@@ -39,14 +43,16 @@ dependencies:
gengmei_flutter_plugin: gengmei_flutter_plugin:
git: git:
url: 'git@git.wanmeizhensuo.com:linshengyu/flutter_plugin.git' url: 'git@git.wanmeizhensuo.com:linshengyu/flutter_plugin.git'
ref: "85f3ca475ec55464ff29e68dfaf444add58a0b64" ref: 'c4e2b08443761ea46bdef6dc8d2b93d13c2689f4'
# gengmei_flutter_plugin: # gengmei_flutter_plugin:
# path: /Users/apple/lsy/gengmei_flutter_plugin # path: /Users/apple/lsy/gengmei_flutter_plugin
flutter_drag_scale:
git: 'https://github.com/LiuC520/flutter_drag_scale.git'
protobuf: ^0.14.4 protobuf: ^0.14.4
grpc: ^2.1.2 grpc: ^2.1.2
flutter_svg: ^0.14.1 flutter_svg: ^0.14.1
flutter_drag_scale:
git:
url: 'https://github.com/LiuC520/flutter_drag_scale.git'
# ref: '33d4dfa904728e277f67d029767b833330655333'
dev_dependencies: dev_dependencies:
source_gen: '>=0.8.0' source_gen: '>=0.8.0'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment