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
ed947605
Commit
ed947605
authored
Oct 24, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix android
parent
72104934
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
31 deletions
+63
-31
MainActivity.kt
...c/main/kotlin/com/example/gmalpha_flutter/MainActivity.kt
+12
-3
AlbumModel.dart
lib/AlbumModel/page/album/AlbumModel.dart
+2
-0
AlbumPage.dart
lib/AlbumModel/page/album/AlbumPage.dart
+44
-23
main.dart
lib/main.dart
+5
-5
No files found.
android/app/src/main/kotlin/com/example/gmalpha_flutter/MainActivity.kt
View file @
ed947605
...
@@ -13,6 +13,7 @@ import com.taobao.idlefish.flutterboost.containers.BoostFlutterActivity
...
@@ -13,6 +13,7 @@ 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
import
io.flutter.plugin.common.EventChannel
import
io.flutter.plugin.common.MethodCall
import
io.flutter.plugin.common.MethodCall
import
io.flutter.plugin.common.MethodChannel
import
io.flutter.plugin.common.MethodChannel
import
io.flutter.plugin.common.PluginRegistry
import
io.flutter.plugin.common.PluginRegistry
...
@@ -25,8 +26,16 @@ class MainActivity : FlutterActivity() {
...
@@ -25,8 +26,16 @@ class MainActivity : FlutterActivity() {
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
GeneratedPluginRegistrant
.
registerWith
(
this
)
GeneratedPluginRegistrant
.
registerWith
(
this
)
EventChannel
(
flutterView
,
"flutter_channel_event"
).
setStreamHandler
(
object
:
EventChannel
.
StreamHandler
{
override
fun
onListen
(
p0
:
Any
?,
p1
:
EventChannel
.
EventSink
?)
{
}
MethodChannel
(
flutterView
,
"flutter_bury_channel"
).
setMethodCallHandler
{
call
,
result
->
override
fun
onCancel
(
p0
:
Any
?)
{
}
}
)
MethodChannel
(
flutterView
,
"flutter_channel"
).
setMethodCallHandler
{
call
,
result
->
if
(
call
.
method
==
"FLUTTER_TO_H5"
)
{
if
(
call
.
method
==
"FLUTTER_TO_H5"
)
{
}
else
if
(
call
.
method
==
"FLUTTER_TO_NATIVE"
)
{
}
else
if
(
call
.
method
==
"FLUTTER_TO_NATIVE"
)
{
...
@@ -70,9 +79,9 @@ class MainActivity : FlutterActivity() {
...
@@ -70,9 +79,9 @@ class MainActivity : FlutterActivity() {
result
.
success
(
map
)
result
.
success
(
map
)
}
else
if
(
call
.
method
==
"UPLOAD_IMG"
)
{
}
else
if
(
call
.
method
==
"UPLOAD_IMG"
)
{
result
.
success
(
"2019/10/17/1156/44dbb13ac6d9"
);
result
.
success
(
"2019/10/17/1156/44dbb13ac6d9"
);
}
else
if
(
call
.
method
==
"USER_LOGOUT"
)
{
}
else
if
(
call
.
method
==
"USER_LOGOUT"
)
{
result
.
success
(
true
)
result
.
success
(
true
)
}
else
{
}
else
{
result
.
notImplemented
()
result
.
notImplemented
()
}
}
}
}
...
...
lib/AlbumModel/page/album/AlbumModel.dart
View file @
ed947605
...
@@ -20,6 +20,7 @@ const String MainDirExplain = "全部相片";
...
@@ -20,6 +20,7 @@ const String MainDirExplain = "全部相片";
class
AlbumModel
extends
BaseModel
{
class
AlbumModel
extends
BaseModel
{
LiveData
<
List
<
ScanImageItem
>>
albumLive
=
LiveData
();
LiveData
<
List
<
ScanImageItem
>>
albumLive
=
LiveData
();
LiveData
<
int
>
selectSizeLive
=
LiveData
();
LiveData
<
List
<
DirBean
>>
dirLive
=
LiveData
();
LiveData
<
List
<
DirBean
>>
dirLive
=
LiveData
();
LiveData
<
String
>
titleData
=
LiveData
();
LiveData
<
String
>
titleData
=
LiveData
();
...
@@ -157,6 +158,7 @@ class AlbumModel extends BaseModel {
...
@@ -157,6 +158,7 @@ class AlbumModel extends BaseModel {
_selectList
.
remove
(
path
);
_selectList
.
remove
(
path
);
}
}
albumLive
.
notifyView
(
albumLive
.
data
);
albumLive
.
notifyView
(
albumLive
.
data
);
selectSizeLive
.
notifyView
(
_selectList
.
length
);
}
}
void
onNext
(
BuildContext
context
)
{
void
onNext
(
BuildContext
context
)
{
...
...
lib/AlbumModel/page/album/AlbumPage.dart
View file @
ed947605
...
@@ -7,6 +7,8 @@ import 'dart:io';
...
@@ -7,6 +7,8 @@ import 'dart:io';
import
'package:flutter/material.dart'
;
import
'package:flutter/material.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/commonModel/base/BaseComponent.dart'
;
import
'package:gmalpha_flutter/res/value/ALColors.dart'
;
import
'AlbumModel.dart'
;
import
'AlbumModel.dart'
;
...
@@ -22,30 +24,30 @@ class AlbumPage extends StatefulWidget {
...
@@ -22,30 +24,30 @@ class AlbumPage extends StatefulWidget {
State
<
StatefulWidget
>
createState
()
=>
AlbumState
(
model
);
State
<
StatefulWidget
>
createState
()
=>
AlbumState
(
model
);
}
}
class
AlbumState
extends
State
<
AlbumPage
>
{
class
AlbumState
extends
State
<
AlbumPage
>
with
SingleTickerProviderStateMixin
{
final
AlbumModel
_model
;
final
AlbumModel
_model
;
AlbumState
(
this
.
_model
);
AlbumState
(
this
.
_model
);
Animation
<
double
>
animation
;
AnimationController
controller
;
@override
@override
void
initState
()
{
void
initState
()
{
super
.
initState
();
super
.
initState
();
_model
.
initScanImages
(
context
);
_model
.
initScanImages
(
context
);
controller
=
new
AnimationController
(
duration:
const
Duration
(
milliseconds:
2000
),
vsync:
this
);
animation
=
new
Tween
(
begin:
0.0
,
end:
1.0
).
animate
(
controller
)
..
addListener
(()
{
print
(
"LISTEN!!
${animation.value}
"
);
});
}
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
Scaffold
(
appBar:
AppBar
(
appBar:
baseAppBarChangeTitle
(
leading:
GestureDetector
(
onTap:
()
=>
Navigator
.
pop
(
context
,
null
),
child:
Center
(
child:
Container
(
padding:
EdgeInsets
.
fromLTRB
(
16
,
0
,
0
,
0
),
child:
Text
(
"取消"
),
),
)),
centerTitle:
true
,
title:
GestureDetector
(
title:
GestureDetector
(
onTap:
()
{
onTap:
()
{
_model
.
changPopState
();
_model
.
changPopState
();
...
@@ -54,22 +56,29 @@ class AlbumState extends State<AlbumPage> {
...
@@ -54,22 +56,29 @@ class AlbumState extends State<AlbumPage> {
stream:
_model
.
titleData
.
stream
,
stream:
_model
.
titleData
.
stream
,
initialData:
_model
.
titleData
.
data
,
initialData:
_model
.
titleData
.
data
,
builder:
(
context
,
data
)
{
builder:
(
context
,
data
)
{
Widget
text
;
if
(
data
.
data
==
null
)
{
text
=
Text
(
""
);
}
else
{
String
showText
;
if
(
data
.
data
.
length
>
10
)
{
showText
=
"
${data.data.substring(0, 10)}
..."
;
}
else
{
showText
=
data
.
data
;
}
text
=
baseText
(
showText
,
18
,
ALColors
.
Color323232
);
}
return
Row
(
return
Row
(
children:
<
Widget
>[
children:
<
Widget
>[
Expanded
(
Expanded
(
child:
Container
(),
child:
Container
(),
),
),
data
.
data
==
null
text
,
?
Text
(
MainDirExplain
,
style:
TextStyle
(
fontSize:
18
),
)
:
Text
(
data
.
data
,
style:
TextStyle
(
fontSize:
18
)),
Container
(
Container
(
margin:
EdgeInsets
.
fromLTRB
(
1
,
0
,
0
,
0
),
margin:
EdgeInsets
.
fromLTRB
(
1
,
0
,
0
,
0
),
child:
Transform
(
child:
Transform
(
transform:
Matrix4
.
identity
()
transform:
Matrix4
.
identity
()
..
rotateZ
(
_model
.
showPop
?
1.6
:
4.7
),
// 旋转的角度
..
rotateZ
(
!
_model
.
showPop
?
1.6
:
4.7
),
// 旋转的角度
origin:
Offset
(
10
,
10
),
// 旋转的中心点
origin:
Offset
(
10
,
10
),
// 旋转的中心点
child:
Icon
(
child:
Icon
(
Icons
.
chevron_right
,
Icons
.
chevron_right
,
...
@@ -83,17 +92,27 @@ class AlbumState extends State<AlbumPage> {
...
@@ -83,17 +92,27 @@ class AlbumState extends State<AlbumPage> {
],
],
);
);
})),
})),
actions:
<
Widget
>[
action:
<
Widget
>[
Center
(
StreamBuilder
<
int
>(
stream:
_model
.
selectSizeLive
.
stream
,
initialData:
_model
.
selectSizeLive
.
data
,
builder:
(
c
,
data
)
{
String
showText
=
"下一步"
;
if
(
data
!=
0
)
{
showText
=
"
$showText
(
$data
)"
;
}
return
Center
(
child:
GestureDetector
(
child:
GestureDetector
(
onTap:
()
=>
_model
.
onNext
(
context
),
onTap:
()
=>
_model
.
onNext
(
context
),
child:
Container
(
child:
Container
(
margin:
EdgeInsets
.
fromLTRB
(
0
,
0
,
16
,
0
),
margin:
EdgeInsets
.
fromLTRB
(
0
,
0
,
16
,
0
),
child:
Text
(
child:
Text
(
"下一步"
,
showText
,
style:
TextStyle
(
fontSize:
16
),
style:
TextStyle
(
fontSize:
16
),
),
),
)))
)));
},
)
],
],
),
),
body:
Stack
(
body:
Stack
(
...
@@ -106,6 +125,7 @@ class AlbumState extends State<AlbumPage> {
...
@@ -106,6 +125,7 @@ class AlbumState extends State<AlbumPage> {
@override
@override
void
dispose
()
{
void
dispose
()
{
controller
.
dispose
();
super
.
dispose
();
super
.
dispose
();
_model
.
dispose
();
_model
.
dispose
();
}
}
...
@@ -211,6 +231,7 @@ class AlbumState extends State<AlbumPage> {
...
@@ -211,6 +231,7 @@ class AlbumState extends State<AlbumPage> {
if
(
snapshot
.
data
==
null
)
{
if
(
snapshot
.
data
==
null
)
{
return
Container
();
return
Container
();
}
else
{
}
else
{
controller
.
forward
();
return
Stack
(
return
Stack
(
children:
<
Widget
>[
children:
<
Widget
>[
Container
(
Container
(
...
@@ -229,7 +250,7 @@ class AlbumState extends State<AlbumPage> {
...
@@ -229,7 +250,7 @@ class AlbumState extends State<AlbumPage> {
return
Container
(
return
Container
(
padding:
EdgeInsets
.
fromLTRB
(
16
,
3
,
16
,
3
),
padding:
EdgeInsets
.
fromLTRB
(
16
,
3
,
16
,
3
),
color:
Colors
.
white
,
color:
Colors
.
white
,
height:
280
,
height:
280
*
animation
.
value
,
child:
ListView
.
separated
(
child:
ListView
.
separated
(
separatorBuilder:
(
context
,
index
)
{
separatorBuilder:
(
context
,
index
)
{
return
Divider
();
return
Divider
();
...
...
lib/main.dart
View file @
ed947605
...
@@ -119,11 +119,11 @@ class _MyAppState extends State<MyApp> {
...
@@ -119,11 +119,11 @@ 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:
FlutterBoost
.
init
(),
builder:
FlutterBoost
.
init
(),
theme:
new
ThemeData
(
theme:
new
ThemeData
(
primaryColor:
Colors
.
white
,
primaryColor:
Colors
.
white
,
...
...
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