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
7177940b
Commit
7177940b
authored
Nov 01, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
92480998
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
257 additions
and
74 deletions
+257
-74
GeneratedPluginRegistrant.java
...in/java/io/flutter/plugins/GeneratedPluginRegistrant.java
+2
-0
GeneratedPluginRegistrant.m
ios/Runner/GeneratedPluginRegistrant.m
+2
-0
ActivityReportPage.dart
lib/ActivityReportModel/page/ActivityReportPage.dart
+2
-2
AlbumModel.dart
lib/AlbumModel/page/album/AlbumModel.dart
+90
-35
AlbumPage.dart
lib/AlbumModel/page/album/AlbumPage.dart
+29
-11
AlbumPreviewModel.dart
lib/AlbumModel/page/preview/AlbumPreviewModel.dart
+28
-0
AlbumPreviewPage.dart
lib/AlbumModel/page/preview/AlbumPreviewPage.dart
+61
-0
BaseComponent.dart
lib/commonModel/base/BaseComponent.dart
+16
-12
main.dart
lib/main.dart
+6
-6
Anim.dart
lib/res/anim/Anim.dart
+18
-7
pubspec.yaml
pubspec.yaml
+3
-1
No files found.
android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
View file @
7177940b
...
@@ -2,6 +2,7 @@ package io.flutter.plugins;
...
@@ -2,6 +2,7 @@ package io.flutter.plugins;
import
io.flutter.plugin.common.PluginRegistry
;
import
io.flutter.plugin.common.PluginRegistry
;
import
com.taobao.idlefish.flutterboost.FlutterBoostPlugin
;
import
com.taobao.idlefish.flutterboost.FlutterBoostPlugin
;
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
;
...
@@ -16,6 +17,7 @@ public final class GeneratedPluginRegistrant {
...
@@ -16,6 +17,7 @@ public final class GeneratedPluginRegistrant {
return
;
return
;
}
}
FlutterBoostPlugin
.
registerWith
(
registry
.
registrarFor
(
"com.taobao.idlefish.flutterboost.FlutterBoostPlugin"
));
FlutterBoostPlugin
.
registerWith
(
registry
.
registrarFor
(
"com.taobao.idlefish.flutterboost.FlutterBoostPlugin"
));
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"
));
...
...
ios/Runner/GeneratedPluginRegistrant.m
View file @
7177940b
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
#import "GeneratedPluginRegistrant.h"
#import "GeneratedPluginRegistrant.h"
#import <flutter_boost/FlutterBoostPlugin.h>
#import <flutter_boost/FlutterBoostPlugin.h>
#import <flutter_drag_scale/FlutterDragScalePlugin.h>
#import <gengmei_flutter_plugin/GengmeiFlutterPlugin.h>
#import <gengmei_flutter_plugin/GengmeiFlutterPlugin.h>
#import <path_provider/PathProviderPlugin.h>
#import <path_provider/PathProviderPlugin.h>
#import <sqflite/SqflitePlugin.h>
#import <sqflite/SqflitePlugin.h>
...
@@ -13,6 +14,7 @@
...
@@ -13,6 +14,7 @@
+
(
void
)
registerWithRegistry
:(
NSObject
<
FlutterPluginRegistry
>*
)
registry
{
+
(
void
)
registerWithRegistry
:(
NSObject
<
FlutterPluginRegistry
>*
)
registry
{
[
FlutterBoostPlugin
registerWithRegistrar
:[
registry
registrarForPlugin
:
@"FlutterBoostPlugin"
]];
[
FlutterBoostPlugin
registerWithRegistrar
:[
registry
registrarForPlugin
:
@"FlutterBoostPlugin"
]];
[
FlutterDragScalePlugin
registerWithRegistrar
:[
registry
registrarForPlugin
:
@"FlutterDragScalePlugin"
]];
[
GengmeiFlutterPlugin
registerWithRegistrar
:[
registry
registrarForPlugin
:
@"GengmeiFlutterPlugin"
]];
[
GengmeiFlutterPlugin
registerWithRegistrar
:[
registry
registrarForPlugin
:
@"GengmeiFlutterPlugin"
]];
[
FLTPathProviderPlugin
registerWithRegistrar
:[
registry
registrarForPlugin
:
@"FLTPathProviderPlugin"
]];
[
FLTPathProviderPlugin
registerWithRegistrar
:[
registry
registrarForPlugin
:
@"FLTPathProviderPlugin"
]];
[
SqflitePlugin
registerWithRegistrar
:[
registry
registrarForPlugin
:
@"SqflitePlugin"
]];
[
SqflitePlugin
registerWithRegistrar
:[
registry
registrarForPlugin
:
@"SqflitePlugin"
]];
...
...
lib/ActivityReportModel/page/ActivityReportPage.dart
View file @
7177940b
...
@@ -49,7 +49,7 @@ class ActivityReportState extends BasePage<ActivityReportPage> {
...
@@ -49,7 +49,7 @@ class ActivityReportState extends BasePage<ActivityReportPage> {
.
findBuriedRouter
()
.
findBuriedRouter
()
?.
onClick
(
pageName
(),
"return"
);
?.
onClick
(
pageName
(),
"return"
);
Navigator
.
pop
(
context
,
""
);
Navigator
.
pop
(
context
,
""
);
jumpToNative
(
"search"
,
null
);
//
jumpToNative("search", null);
},
},
action:
<
Widget
>[
action:
<
Widget
>[
GestureDetector
(
GestureDetector
(
...
@@ -124,7 +124,7 @@ class ActivityReportState extends BasePage<ActivityReportPage> {
...
@@ -124,7 +124,7 @@ class ActivityReportState extends BasePage<ActivityReportPage> {
animationNumberState
.
clearState
();
animationNumberState
.
clearState
();
animationCharacterState
.
clearState
();
animationCharacterState
.
clearState
();
_model
.
dispose
();
_model
.
dispose
();
jumpToNative
(
"search"
,
null
);
//
jumpToNative("search", null);
}
}
@override
@override
...
...
lib/AlbumModel/page/album/AlbumModel.dart
View file @
7177940b
...
@@ -11,11 +11,14 @@ import 'package:flutter/foundation.dart';
...
@@ -11,11 +11,14 @@ import 'package:flutter/foundation.dart';
import
'package:gengmei_flutter_plugin/ScanImagePlugn.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/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/repository/AlbumRepository.dart'
;
import
'package:gmalpha_flutter/AlbumModel/repository/AlbumRepository.dart'
;
import
'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart'
;
import
'package:gmalpha_flutter/commonModel/GMBase.dart'
;
import
'package:gmalpha_flutter/commonModel/GMBase.dart'
;
import
'package:gmalpha_flutter/commonModel/live/BaseModel.dart'
;
import
'package:gmalpha_flutter/commonModel/live/BaseModel.dart'
;
import
'package:gmalpha_flutter/commonModel/live/LiveData.dart'
;
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'
;
const
String
MainDir
=
"IsGengmeiAlbumAllImages"
;
const
String
MainDir
=
"IsGengmeiAlbumAllImages"
;
const
String
MainDirExplain
=
"全部相片"
;
const
String
MainDirExplain
=
"全部相片"
;
...
@@ -32,17 +35,21 @@ Map<String, List<ScanImageItem>> paseAlbum(Object event) {
...
@@ -32,17 +35,21 @@ Map<String, List<ScanImageItem>> paseAlbum(Object event) {
item
.
path
=
map2
[
"path"
];
item
.
path
=
map2
[
"path"
];
item
.
isVideo
=
map2
[
"isVideo"
]
==
"T"
?
true
:
false
;
item
.
isVideo
=
map2
[
"isVideo"
]
==
"T"
?
true
:
false
;
item
.
during
=
map2
[
"during"
]
??
"0"
;
item
.
during
=
map2
[
"during"
]
??
"0"
;
item
.
realPath
=
map2
[
"realPath"
]
??
""
;
item
.
size
=
map2
[
"size"
]
??
0
;
item
.
dataToken
=
item
.
dataToken
=
map2
[
"dataToken"
]
==
null
?
0
:
int
.
parse
(
map2
[
"dataToken"
]);
map2
[
"dataToken"
]
==
null
?
0
:
int
.
parse
(
map2
[
"dataToken"
]);
scanList
.
add
(
item
);
scanList
.
add
(
item
);
});
});
newMap
[
k
]
=
scanList
;
newMap
[
k
]
=
scanList
;
});
});
newMap
.
forEach
((
k
,
eachValue
)
{
if
(
Platform
.
isIOS
)
{
eachValue
.
sort
((
a
,
b
)
{
newMap
.
forEach
((
k
,
eachValue
)
{
return
b
.
dataToken
-
a
.
dataToken
;
eachValue
.
sort
((
a
,
b
)
{
return
b
.
dataToken
-
a
.
dataToken
;
});
});
});
}
);
}
return
newMap
;
return
newMap
;
}
}
...
@@ -109,35 +116,35 @@ class AlbumModel extends BaseModel {
...
@@ -109,35 +116,35 @@ class AlbumModel extends BaseModel {
}
}
void
_onEvent
(
Object
event
)
{
void
_onEvent
(
Object
event
)
{
if
(
Platform
.
isAndroid
)
{
// if (Platform.isAndroid) {
var
map
=
(
event
as
Map
);
// var map = (event as Map);
if
(
_mainValue
==
null
||
_mainValue
.
length
==
0
)
{
// if (_mainValue == null || _mainValue.length == 0) {
_mainValue
=
map
;
// _mainValue = map;
}
else
{
// } else {
_mainValue
.
forEach
((
k
,
itemList
)
{
// _mainValue.forEach((k, itemList) {
var
key
=
map
[
k
];
// var key = map[k];
if
(
key
!=
null
)
{
// if (key != null) {
for
(
int
i
=
0
;
i
<
itemList
.
length
;
i
++)
{
// for (int i = 0; i < itemList.length; i++) {
if
(
key
[
i
]
==
null
)
{
// if (key[i] == null) {
continue
;
// continue;
}
// }
itemList
[
i
].
path
=
key
[
i
][
"path"
];
// itemList[i].path = key[i]["path"];
itemList
[
i
].
realPath
=
key
[
i
][
"realPath"
];
// itemList[i].realPath = key[i]["realPath"];
}
// }
}
// }
});
// });
}
// }
albumLive
.
notifyView
(
_mainValue
[
_nowDirName
]);
// albumLive.notifyView(_mainValue[_nowDirName]);
}
else
{
// } else {
compute
(
paseAlbum
,
event
).
then
((
value
)
{
compute
(
paseAlbum
,
event
).
then
((
value
)
{
_mainValue
=
value
;
_mainValue
=
value
;
_dirList
.
clear
();
_dirList
.
clear
();
_mainValue
.
forEach
((
k
,
v
)
{
_mainValue
.
forEach
((
k
,
v
)
{
_dirList
.
add
(
DirBean
(
k
,
v
.
length
,
File
(
v
[
0
].
path
)));
_dirList
.
add
(
DirBean
(
k
,
v
.
length
,
File
(
v
[
0
].
path
)));
});
albumLive
.
notifyView
(
_mainValue
[
_nowDirName
]);
});
});
}
albumLive
.
notifyView
(
_mainValue
[
_nowDirName
]);
});
// }
}
}
void
_onError
(
Object
error
)
{
void
_onError
(
Object
error
)
{
...
@@ -284,6 +291,9 @@ class AlbumModel extends BaseModel {
...
@@ -284,6 +291,9 @@ class AlbumModel extends BaseModel {
}
}
void
onNext
(
BuildContext
context
)
{
void
onNext
(
BuildContext
context
)
{
RouterCenterImpl
()
.
findBuriedRouter
()
?.
onEvent
(
"post_add_pic_click_next"
,
{
"page_name"
:
"post_add_pic"
});
if
(
_selectList
.
isEmpty
&&
_selectVideoList
.
isEmpty
)
{
if
(
_selectList
.
isEmpty
&&
_selectVideoList
.
isEmpty
)
{
Navigator
.
pop
(
context
,
null
);
Navigator
.
pop
(
context
,
null
);
}
else
{
}
else
{
...
@@ -357,6 +367,9 @@ class AlbumModel extends BaseModel {
...
@@ -357,6 +367,9 @@ class AlbumModel extends BaseModel {
void
iosAlbumGetImagePath
(
String
path
,
int
index
)
{}
void
iosAlbumGetImagePath
(
String
path
,
int
index
)
{}
void
nativeCamera
(
BuildContext
context
)
{
void
nativeCamera
(
BuildContext
context
)
{
RouterCenterImpl
()
.
findBuriedRouter
()
?.
onEvent
(
"post_add_pic_click_camera"
,
{
"page_name"
:
"post_add_pic"
});
if
(
_selectList
.
length
==
maxCount
)
{
if
(
_selectList
.
length
==
maxCount
)
{
Toast
.
show
(
context
,
"最多选择
${_maxCount}
张图片"
);
Toast
.
show
(
context
,
"最多选择
${_maxCount}
张图片"
);
return
;
return
;
...
@@ -439,6 +452,9 @@ class AlbumModel extends BaseModel {
...
@@ -439,6 +452,9 @@ class AlbumModel extends BaseModel {
void
selectDir
(
int
index
)
{
void
selectDir
(
int
index
)
{
String
dirName
=
_dirList
[
index
].
dirName
;
String
dirName
=
_dirList
[
index
].
dirName
;
RouterCenterImpl
()
.
findBuriedRouter
()
?.
onClick
(
"post_add_pic"
,
"album_name"
);
titleData
.
notifyView
(
dirName
);
titleData
.
notifyView
(
dirName
);
if
(
dirName
==
MainDirExplain
)
{
if
(
dirName
==
MainDirExplain
)
{
dirName
=
MainDir
;
dirName
=
MainDir
;
...
@@ -467,9 +483,6 @@ class AlbumModel extends BaseModel {
...
@@ -467,9 +483,6 @@ class AlbumModel extends BaseModel {
if
(
during
==
null
)
{
if
(
during
==
null
)
{
return
""
;
return
""
;
}
else
{
}
else
{
if
(
Platform
.
isIOS
)
{
return
during
;
}
try
{
try
{
var
parse
=
int
.
parse
(
during
);
var
parse
=
int
.
parse
(
during
);
String
min
;
String
min
;
...
@@ -499,4 +512,46 @@ class AlbumModel extends BaseModel {
...
@@ -499,4 +512,46 @@ class AlbumModel extends BaseModel {
}
}
}
}
}
}
bool
previewItemClick
=
false
;
void
previewItem
(
BuildContext
context
,
int
index
,
String
pageName
)
{
String
path
;
if
(
Platform
.
isAndroid
)
{
path
=
albumLive
.
data
[
index
].
realPath
;
if
(
albumLive
.
data
[
index
].
isVideo
)
{
GengmeiFlutterPlugin
.
playAlbumVideo
(
path
);
}
else
{
Navigator
.
push
(
context
,
CustomRoute
(
AlbumPreviewPage
(
path
,
pageName
)));
}
}
else
{
path
=
albumLive
.
data
[
index
].
path
;
if
(
albumLive
.
data
[
index
].
isVideo
)
{
GengmeiFlutterPlugin
.
playAlbumVideo
(
path
);
}
else
{
if
(
previewItemClick
)
{
return
;
}
previewItemClick
=
true
;
iosItem
(
path
,
context
,
(
value
)
{
var
realPath
=
value
[
"realImagePath"
];
Navigator
.
push
(
context
,
CustomRoute
(
AlbumPreviewPage
(
realPath
,
pageName
)));
});
}
}
}
void
iosItem
(
String
path
,
BuildContext
context
,
Function
fun
)
{
GengmeiFlutterPlugin
.
ios_album_item
(
path
).
then
((
value
)
{
if
(
value
!=
null
)
{
fun
(
Map
<
String
,
String
>.
from
(
value
));
}
previewItemClick
=
false
;
}).
catchError
((
error
)
{
Toast
.
debugShow
(
context
,
error
.
toString
());
previewItemClick
=
false
;
print
(
error
);
});
}
}
}
lib/AlbumModel/page/album/AlbumPage.dart
View file @
7177940b
...
@@ -5,11 +5,15 @@
...
@@ -5,11 +5,15 @@
import
'dart:io'
;
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
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/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'
;
import
'package:gmalpha_flutter/res/GMRes.dart'
;
import
'package:gmalpha_flutter/res/value/ALColors.dart'
;
import
'package:gmalpha_flutter/res/value/ALColors.dart'
;
import
'AlbumModel.dart'
;
import
'AlbumModel.dart'
;
...
@@ -25,10 +29,10 @@ class AlbumPage extends StatefulWidget {
...
@@ -25,10 +29,10 @@ class AlbumPage extends StatefulWidget {
bool
fromNative
,
bool
fromNative
,
int
maxVideo
,
int
maxVideo
,
List
<
String
>
videoSelectPath
,
List
<
String
>
videoSelectPath
,
String
fromPage
String
fromPage
,
,
String
iosPushedPage
)
{
String
iosPushedPage
)
{
model
=
new
AlbumModel
(
provider
,
showCamera
,
maxCount
,
selectedList
,
model
=
new
AlbumModel
(
provider
,
showCamera
,
maxCount
,
selectedList
,
fromNative
,
maxVideo
,
videoSelectPath
,
fromPage
,
iosPushedPage
);
fromNative
,
maxVideo
,
videoSelectPath
,
fromPage
,
iosPushedPage
);
}
}
@override
@override
...
@@ -59,9 +63,12 @@ class AlbumState extends BasePage<AlbumPage>
...
@@ -59,9 +63,12 @@ class AlbumState extends BasePage<AlbumPage>
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
ScreenUtil
.
instance
=
ScreenUtil
(
width:
375.0
,
height:
667.0
)
..
init
(
context
);
return
Scaffold
(
return
Scaffold
(
appBar:
baseAppBarChangeTitle
(
appBar:
baseAppBarChangeTitle
(
backClick:
()
{
backClick:
()
{
RouterCenterImpl
().
findBuriedRouter
()?.
onClick
(
pageName
(),
"next"
);
Navigator
.
pop
(
context
,
null
);
Navigator
.
pop
(
context
,
null
);
},
},
centerTitle:
true
,
centerTitle:
true
,
...
@@ -125,7 +132,7 @@ class AlbumState extends BasePage<AlbumPage>
...
@@ -125,7 +132,7 @@ class AlbumState extends BasePage<AlbumPage>
child:
GestureDetector
(
child:
GestureDetector
(
onTap:
()
{
onTap:
()
{
print
(
"LSY
${_model.allSelectSize()}
"
);
print
(
"LSY
${_model.allSelectSize()}
"
);
if
(
_model
.
allSelectSize
()>
0
)
{
if
(
_model
.
allSelectSize
()
>
0
)
{
_model
.
onNext
(
context
);
_model
.
onNext
(
context
);
}
}
},
},
...
@@ -216,10 +223,11 @@ class AlbumState extends BasePage<AlbumPage>
...
@@ -216,10 +223,11 @@ class AlbumState extends BasePage<AlbumPage>
String
during
;
String
during
;
if
(
_model
.
maxVideoCount
>
0
&&
_model
.
isVideo
(
newIndex
))
{
if
(
_model
.
maxVideoCount
>
0
&&
_model
.
isVideo
(
newIndex
))
{
during
=
_model
.
getFormatTime
(
imgList
.
data
[
newIndex
].
during
);
during
=
_model
.
getFormatTime
(
imgList
.
data
[
newIndex
].
during
);
// print("druing ${imgList.data[newIndex].during} dur ${during}");
}
}
return
GestureDetector
(
return
GestureDetector
(
onTap:
()
=>
_model
.
clickItem
(
context
,
newIndex
),
onTap:
()
{
_model
.
previewItem
(
context
,
newIndex
,
pageName
());
},
child:
Container
(
child:
Container
(
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
image:
DecorationImage
(
image:
DecorationImage
(
...
@@ -254,12 +262,22 @@ class AlbumState extends BasePage<AlbumPage>
...
@@ -254,12 +262,22 @@ class AlbumState extends BasePage<AlbumPage>
)
)
:
Container
(),
:
Container
(),
_model
.
maxVideoCount
>
0
&&
_model
.
isVideo
(
newIndex
)
_model
.
maxVideoCount
>
0
&&
_model
.
isVideo
(
newIndex
)
?
Positioned
(
?
Container
(
left:
50
,
width:
double
.
maxFinite
,
top:
70
,
height:
double
.
maxFinite
,
alignment:
Alignment
.
bottomRight
,
padding:
EdgeInsets
.
only
(
right:
5
,
bottom:
2
),
child:
baseText
(
during
,
15
,
ALColors
.
ColorF8F8F8
),
child:
baseText
(
during
,
15
,
ALColors
.
ColorF8F8F8
),
)
)
:
Container
()
:
Container
(),
GestureDetector
(
onTap:
()
=>
_model
.
clickItem
(
context
,
newIndex
),
child:
Container
(
width:
40
,
height:
40
,
color:
Colors
.
transparent
,
),
)
],
],
),
),
));
));
...
@@ -330,7 +348,7 @@ class AlbumState extends BasePage<AlbumPage>
...
@@ -330,7 +348,7 @@ class AlbumState extends BasePage<AlbumPage>
@override
@override
String
pageName
()
{
String
pageName
()
{
return
"
album
"
;
return
"
post_add_pic
"
;
}
}
@override
@override
...
...
lib/AlbumModel/page/preview/AlbumPreviewModel.dart
0 → 100644
View file @
7177940b
/*
* @author lsy
* @date 2019-11-01
**/
import
'dart:io'
;
import
'dart:typed_data'
;
import
'dart:ui'
;
import
'package:gmalpha_flutter/commonModel/GMBase.dart'
;
class
AlbumPreviewModel
extends
BaseModel
{
final
String
imgPath
;
AlbumPreviewModel
(
this
.
imgPath
);
// scareImage() async{
// final Uint8List bytes = await File(imgPath).readAsBytes();
// return await instantiateImageCodec(bytes,targetHeight: 520,targetWidth: 520);
// }
@override
void
dispose
()
{
// TODO: implement dispose
}
}
\ No newline at end of file
lib/AlbumModel/page/preview/AlbumPreviewPage.dart
0 → 100644
View file @
7177940b
/*
* @author lsy
* @date 2019-11-01
**/
import
'dart:io'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_drag_scale/core/drag_scale_widget.dart'
;
import
'package:gmalpha_flutter/AlbumModel/page/preview/AlbumPreviewModel.dart'
;
import
'package:gmalpha_flutter/commonModel/base/BaseComponent.dart'
;
class
AlbumPreviewPage
extends
StatefulWidget
{
AlbumPreviewModel
_model
;
String
fromPage
;
AlbumPreviewPage
(
String
imgPath
,
this
.
fromPage
)
{
_model
=
AlbumPreviewModel
(
imgPath
);
}
@override
State
<
StatefulWidget
>
createState
()
=>
AlbumPreviewState
(
_model
,
fromPage
);
}
class
AlbumPreviewState
extends
State
<
AlbumPreviewPage
>
{
AlbumPreviewModel
_model
;
final
String
fromPage
;
AlbumPreviewState
(
this
.
_model
,
this
.
fromPage
);
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
baseAppBar
(
backClick:
()
{
Navigator
.
pop
(
context
);
}),
body:
Container
(
alignment:
Alignment
.
center
,
width:
double
.
maxFinite
,
height:
double
.
maxFinite
,
child:
DragScaleContainer
(
doubleTapStillScale:
false
,
child:
new
Image
.
file
(
File
(
_model
.
imgPath
,
),
fit:
BoxFit
.
fitWidth
,
)),
));
}
// @override
// String pageName() {
// return "album_preview";
// }
//
// @override
// String referrer() {
// return fromPage;
// }
}
lib/commonModel/base/BaseComponent.dart
View file @
7177940b
...
@@ -12,36 +12,40 @@ AppBar baseAppBar(
...
@@ -12,36 +12,40 @@ AppBar baseAppBar(
{
String
title
,
{
String
title
,
List
<
Widget
>
action
,
List
<
Widget
>
action
,
bool
centerTitle
,
bool
centerTitle
,
VoidCallback
backClick
})
{
VoidCallback
backClick
,
Color
backgroundColor
})
{
return
baseAppBarChangeTitle
(
return
baseAppBarChangeTitle
(
title:
title
==
null
title:
title
==
null
?
Container
()
?
Container
()
:
baseText
(
title
,
16
,
ALColors
.
Color323232
),
:
baseText
(
title
,
16
,
ALColors
.
Color323232
),
action:
action
,
action:
action
,
centerTitle:
centerTitle
,
centerTitle:
centerTitle
,
backClick:
backClick
);
backClick:
backClick
,
backgroundColor:
backgroundColor
);
}
}
AppBar
baseAppBarChangeTitle
(
AppBar
baseAppBarChangeTitle
(
{
Widget
title
,
{
Widget
title
,
List
<
Widget
>
action
,
List
<
Widget
>
action
,
bool
centerTitle
,
bool
centerTitle
,
VoidCallback
backClick
})
{
VoidCallback
backClick
,
Color
backgroundColor
})
{
return
AppBar
(
return
AppBar
(
backgroundColor:
ALColors
.
ColorFFFFFF
,
backgroundColor:
backgroundColor
==
null
?
ALColors
.
ColorFFFFFF
:
backgroundColor
,
title:
title
,
title:
title
,
centerTitle:
centerTitle
,
centerTitle:
centerTitle
,
elevation:
0.0
,
elevation:
0.0
,
leading:
GestureDetector
(
leading:
GestureDetector
(
onTap:
backClick
,
onTap:
backClick
,
child:
Container
(
child:
Hero
(
color:
ALColors
.
ColorFFFFFF
,
tag:
"left_arrow"
,
alignment:
Alignment
.
centerLeft
,
child:
Container
(
padding:
EdgeInsets
.
only
(
left:
22
)
,
color:
ALColors
.
ColorFFFFFF
,
width:
30
,
alignment:
Alignment
.
centerLeft
,
height:
double
.
maxFinite
,
padding:
EdgeInsets
.
only
(
left:
22
)
,
child:
Hero
(
width:
30
,
tag:
"left_arrow"
,
height:
double
.
maxFinite
,
child:
SvgPicture
.
asset
(
child:
SvgPicture
.
asset
(
"images/left_arrow.svg"
,
"images/left_arrow.svg"
,
color:
Color
(
0xff323232
),
color:
Color
(
0xff323232
),
...
...
lib/main.dart
View file @
7177940b
...
@@ -126,16 +126,16 @@ class _MyAppState extends State<MyApp> {
...
@@ -126,16 +126,16 @@ class _MyAppState extends State<MyApp> {
return
MaterialApp
(
return
MaterialApp
(
title:
'Flutter Boost example'
,
title:
'Flutter Boost example'
,
debugShowCheckedModeBanner:
false
,
debugShowCheckedModeBanner:
false
,
routes:
{
//
routes: {
'/'
:
(
context
)
{
//
'/': (context) {
return
TestPage
();
//
return TestPage();
},
//
},
},
//
},
builder:
buildOnce
,
builder:
buildOnce
,
theme:
new
ThemeData
(
theme:
new
ThemeData
(
primaryColor:
Colors
.
white
,
primaryColor:
Colors
.
white
,
backgroundColor:
ALColors
.
ColorFFFFFF
,
backgroundColor:
ALColors
.
ColorFFFFFF
,
accentColor:
Color
(
0xFF888888
)
,
accentColor:
ALColors
.
ColorFFFFFF
,
textTheme:
TextTheme
(
textTheme:
TextTheme
(
//设置Material的默认字体样式
//设置Material的默认字体样式
body1:
TextStyle
(
color:
Color
(
0xFF888888
),
fontSize:
16.0
),
body1:
TextStyle
(
color:
Color
(
0xFF888888
),
fontSize:
16.0
),
...
...
lib/res/anim/Anim.dart
View file @
7177940b
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
* @date 2019-10-14
* @date 2019-10-14
**/
**/
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
enum
RouteWay
{
enum
RouteWay
{
...
@@ -48,13 +50,22 @@ class CustomRoute extends PageRouteBuilder {
...
@@ -48,13 +50,22 @@ class CustomRoute extends PageRouteBuilder {
child:
child
,
child:
child
,
);
);
}
else
if
(
routeWay
.
index
==
1
)
{
}
else
if
(
routeWay
.
index
==
1
)
{
return
SlideTransition
(
return
SlideTransition
(
position:
Tween
<
Offset
>(
position:
Tween
<
Offset
>(
begin:
Offset
(
1.0
,
0.0
),
end:
Offset
(
0.0
,
0.0
))
begin:
Offset
(
1.0
,
0.0
),
end:
Offset
(
0.0
,
0.0
))
.
animate
(
CurvedAnimation
(
.
animate
(
CurvedAnimation
(
parent:
animaton1
,
curve:
Curves
.
fastOutSlowIn
)),
parent:
animaton1
,
curve:
Curves
.
fastOutSlowIn
)),
child:
child
,
child:
child
,
);
);
// } else {
// return SlideTransition(
// position: Tween<Offset>(
// begin: Offset(0.0, 1.0), end: Offset(0.0, 0.0))
// .animate(CurvedAnimation(
// parent: animaton1, curve: Curves.fastOutSlowIn)),
// child: child,
// );
// }
}
else
{
}
else
{
return
ScaleTransition
(
return
ScaleTransition
(
scale:
Tween
(
begin:
0.0
,
end:
1.0
).
animate
(
CurvedAnimation
(
scale:
Tween
(
begin:
0.0
,
end:
1.0
).
animate
(
CurvedAnimation
(
...
...
pubspec.yaml
View file @
7177940b
...
@@ -39,7 +39,9 @@ dependencies:
...
@@ -39,7 +39,9 @@ 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
:
"
f5a11ea753541e0e4e7a6da6260e6f308f94ccf6"
ref
:
"
2f543feff272cfe6d0f6a4954b60f79b990a0903"
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
...
...
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