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
72104934
Commit
72104934
authored
Oct 24, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
01eaf28b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
104 additions
and
86 deletions
+104
-86
flutter.sh
flutter.sh
+9
-2
AttentionPage.dart
lib/NewMessageModel/page/AttentionPage.dart
+5
-17
FocusPage.dart
lib/NewMessageModel/page/focusPage/FocusPage.dart
+0
-0
LikePage.dart
lib/NewMessageModel/page/likePage/LikePage.dart
+0
-0
MessagePage.dart
lib/NewMessageModel/page/messagePage/MessagePage.dart
+15
-6
AppBase.dart
lib/commonModel/base/AppBase.dart
+7
-0
SyncMessageEvent.dart
lib/commonModel/eventbus/event/SyncMessageEvent.dart
+7
-0
DioUtil.dart
lib/commonModel/net/DioUtil.dart
+51
-14
BaseCenterPicker.dart
lib/commonModel/picker/base/BaseCenterPicker.dart
+4
-5
main.dart
lib/main.dart
+0
-32
UserRouterImpl.dart
lib/userModel/UserRouterImpl.dart
+1
-5
UserSettingPage.dart
lib/userModel/page/userSetting/UserSettingPage.dart
+3
-3
SetUserBean.dart
lib/userModel/service/remote/entity/SetUserBean.dart
+1
-1
UserResultBean.dart
lib/userModel/service/remote/entity/UserResultBean.dart
+1
-1
No files found.
flutter.sh
View file @
72104934
...
...
@@ -60,6 +60,13 @@ function android_apk(){
rm
-rf
/Users/apple/lsy/gengmei_alpha/alpha/src/main/assets/flutter_assets
cp
-r
/Users/apple/lsy/gmalpha_flutter/build/app/outputs/apk/
${
suff
}
/assets/flutter_assets /Users/apple/lsy/gengmei_alpha/alpha/src/main/assets/
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
# cp -r /Users/apple/lsy/gmalpha_flutter/build/app/outputs/aar/app-${suff}.aar /Users/apple/lsy/MergeTest/app/libs/app.aar
# 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
...
...
@@ -243,11 +250,11 @@ mkdir /Users/apple/lsy/aar_update/androd${message}/
mkdir
/Users/apple/lsy/aar_update/ios
${
message
}
/
clean
#
android_apk
android_apk
#android
#android_publish
#upload_android_aar
ios
#
ios
#ios_publish
#notifyDingDing
...
...
lib/NewMessageModel/page/AttentionPage.dart
View file @
72104934
...
...
@@ -5,6 +5,7 @@ import 'package:flutter_svg/flutter_svg.dart';
import
'package:gmalpha_flutter/NewMessageModel/page/AttentionModel.dart'
;
import
'package:gmalpha_flutter/NewMessageModel/page/AttentionListItem.dart'
;
import
'package:gmalpha_flutter/NewMessageModel/service/remote/entity/AttentionEntity.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
'package:pull_to_refresh/pull_to_refresh.dart'
;
...
...
@@ -151,23 +152,10 @@ class _AttentionPageState extends BasePage<AttentionPage> {
ScreenUtil
.
instance
=
ScreenUtil
(
width:
375.0
,
height:
667.0
)..
init
(
context
);
return
Scaffold
(
backgroundColor:
Colors
.
white
,
appBar:
AppBar
(
elevation:
0.0
,
leading:
GestureDetector
(
onTap:
()
{
Navigator
.
pop
(
context
);
},
child:
Padding
(
padding:
EdgeInsets
.
only
(
top:
height10
,
right:
width10
,
bottom:
height10
),
child:
Center
(
child:
SvgPicture
.
asset
(
"images/left_arrow.svg"
,
color:
Color
(
0xff323232
)),
),
)
),
appBar:
baseAppBar
(
backClick:
(){
Navigator
.
pop
(
context
);
}
),
body:
SmartRefresher
(
enablePullDown:
false
,
...
...
lib/NewMessageModel/page/focusPage/FocusPage.dart
View file @
72104934
This diff is collapsed.
Click to expand it.
lib/NewMessageModel/page/likePage/LikePage.dart
View file @
72104934
This diff is collapsed.
Click to expand it.
lib/NewMessageModel/page/messagePage/MessagePage.dart
View file @
72104934
import
'dart:async'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
...
...
@@ -10,6 +12,7 @@ import 'package:gmalpha_flutter/NewMessageModel/util/Jump.dart';
import
'package:gmalpha_flutter/commonModel/GMBase.dart'
;
import
'package:gmalpha_flutter/commonModel/eventbus/GlobalEventBus.dart'
;
import
'package:gmalpha_flutter/commonModel/eventbus/event/LoginEvent.dart'
;
import
'package:gmalpha_flutter/commonModel/eventbus/event/SyncMessageEvent.dart'
;
import
'package:gmalpha_flutter/res/value/ALColors.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
...
...
@@ -29,6 +32,8 @@ class _MessagePageState extends BasePage<MessagePage> {
MessageModel
_messageModel
;
static
int
pageCount
=
10
;
static
int
pageNo
=
2
;
StreamSubscription
<
LoginEvent
>
eventBusListener
;
StreamSubscription
<
SyncMessageEvent
>
eventBusListenerSync
;
RefreshController
_refreshController
=
RefreshController
(
initialRefresh:
false
);
...
...
@@ -38,10 +43,15 @@ class _MessagePageState extends BasePage<MessagePage> {
void
initState
()
{
super
.
initState
();
_messageModel
.
init
(
context
);
GlobalEventBus
().
event
.
on
<
LoginEvent
>().
listen
((
event
)
{
eventBusListener
=
GlobalEventBus
().
event
.
on
<
LoginEvent
>().
listen
((
event
)
{
print
(
"flutter EVENT BUS LoginEvent
${event}
"
);
_messageModel
.
init
(
context
);
});
eventBusListenerSync
=
GlobalEventBus
().
event
.
on
<
SyncMessageEvent
>().
listen
((
event
)
{
print
(
"flutter EVENT BUS SyncMessageEvent
${event}
"
);
_messageModel
.
init
(
context
);
});
}
void
_onLoading
(
BuildContext
context
)
async
{
...
...
@@ -67,10 +77,8 @@ class _MessagePageState extends BasePage<MessagePage> {
ScreenUtil
.
instance
=
ScreenUtil
(
width:
375
,
height:
667
)..
init
(
context
);
return
Scaffold
(
appBar:
AppBar
(
centerTitle:
false
,
title:
messageTitle
(
'消息'
),
elevation:
0
,
backgroundColor:
ALColors
.
ColorFFFFFF
,
leading:
baseText
(
"消息"
,
ScreenUtil
.
instance
.
setSp
(
20.0
),
ALColors
.
Color323232
),
),
body:
SmartRefresher
(
enablePullDown:
false
,
...
...
@@ -234,7 +242,8 @@ class _MessagePageState extends BasePage<MessagePage> {
void
dispose
()
{
super
.
dispose
();
_refreshController
.
dispose
();
GlobalEventBus
().
event
.
destroy
();
eventBusListener
?.
cancel
();
eventBusListenerSync
?.
cancel
();
pageNo
=
2
;
}
...
...
lib/commonModel/base/AppBase.dart
View file @
72104934
...
...
@@ -11,6 +11,7 @@ import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart';
import
'package:gmalpha_flutter/commonModel/cache/CacheManager.dart'
;
import
'package:gmalpha_flutter/commonModel/eventbus/GlobalEventBus.dart'
;
import
'package:gmalpha_flutter/commonModel/eventbus/event/LoginEvent.dart'
;
import
'package:gmalpha_flutter/commonModel/eventbus/event/SyncMessageEvent.dart'
;
import
'package:gmalpha_flutter/commonModel/net/Api.dart'
;
import
'package:gmalpha_flutter/commonModel/net/DioUtil.dart'
;
import
'package:rxdart/rxdart.dart'
;
...
...
@@ -87,6 +88,12 @@ void _onEvent(Object event) {
if
(
event
==
null
)
{
return
;
}
Map
map
=
event
as
Map
;
if
(
map
[
"syncMessage"
]
!=
null
&&
map
[
"syncMessage"
])
{
GlobalEventBus
().
event
.
fire
(
SyncMessageEvent
());
return
;
}
String
cookie
=
(
event
as
Map
)[
"Cookie"
];
if
(
cookie
!=
null
)
{
...
...
lib/commonModel/eventbus/event/SyncMessageEvent.dart
0 → 100644
View file @
72104934
/*
* @author lsy
* @date 2019-10-24
**/
class
SyncMessageEvent
{
SyncMessageEvent
();
}
lib/commonModel/net/DioUtil.dart
View file @
72104934
import
'dart:convert'
;
import
'dart:io'
;
import
'package:dio/dio.dart'
;
import
'package:gmalpha_flutter/commonModel/cache/CacheManager.dart'
;
import
'package:gmalpha_flutter/commonModel/net/Api.dart'
;
import
'package:gmalpha_flutter/commonModel/toast/toast.dart'
;
...
...
@@ -105,15 +106,57 @@ class DioUtil {
}
static
var
interceptor
=
InterceptorsWrapper
(
onRequest:
(
opt
)
{
var
headers
=
opt
.
headers
;
if
(
addHeadMap
!=
null
)
{
print
(
"请求之前"
);
print
(
"BASEURL!!
${opt.baseUrl}
"
);
addHeadMap
.
forEach
((
k
,
v
)
{
headers
.
putIfAbsent
(
k
,
()
=>
v
);
print
(
"HEADDD
${k}
${v}
"
);
});
var
queryParameters
=
opt
.
queryParameters
;
Map
<
String
,
dynamic
>
map
;
if
(
queryParameters
!=
null
)
{
map
=
queryParameters
;
}
else
{
map
=
new
Map
<
String
,
dynamic
>();
}
map
.
putIfAbsent
(
"app_name"
,
()
=>
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
get
(
"app_name"
)
??
""
);
map
.
putIfAbsent
(
"version"
,
()
=>
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
get
(
"version"
)
??
""
);
map
.
putIfAbsent
(
"platform"
,
()
=>
Platform
.
isAndroid
?
"android"
:
"ios"
);
map
.
putIfAbsent
(
"device_id"
,
()
=>
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
get
(
"device_id"
)
??
""
);
map
.
putIfAbsent
(
"os_version"
,
()
=>
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
get
(
"os_version"
)
??
""
);
map
.
putIfAbsent
(
"model"
,
()
=>
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
get
(
"model"
)
??
""
);
map
.
putIfAbsent
(
"lat"
,
()
=>
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
get
(
"lat"
)
??
""
);
map
.
putIfAbsent
(
"lng"
,
()
=>
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
get
(
"lng"
)
??
""
);
map
.
putIfAbsent
(
"channel"
,
()
=>
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
get
(
"channel"
)
??
""
);
map
.
putIfAbsent
(
"current_city_id"
,
()
=>
CacheManager
.
getInstance
()
.
get
(
MEMORY_CACHE
)
.
get
(
"current_city_id"
)
??
""
);
map
.
putIfAbsent
(
"manufacturer"
,
()
=>
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
get
(
"manufacturer"
)
??
""
);
map
.
putIfAbsent
(
"uuid"
,
()
=>
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
get
(
"uuid"
)
??
""
);
opt
.
queryParameters
=
map
;
},
onResponse:
(
response
)
{
print
(
"响应之前 response
${response}
"
);
},
onError:
(
e
)
{
...
...
@@ -125,12 +168,6 @@ class DioUtil {
_dio
.
interceptors
.
add
(
interceptor
);
}
set
addHead
(
Map
<
String
,
dynamic
>
map
)
{
if
(
map
!=
null
)
{
addHeadMap
=
map
;
}
}
void
setProxy
(
String
proxy
)
{
(
_dio
.
httpClientAdapter
as
DefaultHttpClientAdapter
).
onHttpClientCreate
=
(
client
)
{
...
...
lib/commonModel/picker/base/BaseCenterPicker.dart
View file @
72104934
...
...
@@ -2,6 +2,7 @@
* @author lsy
* @date 2019-10-18
**/
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:gmalpha_flutter/ActivityReportModel/page/ActivityReportPage.dart'
;
...
...
@@ -12,7 +13,6 @@ class BaseCenterPicker extends StatefulWidget {
ICenterPicker
picker
;
bool
cancelOutSide
=
true
;
setPicker
(
ICenterPicker
picker
)
{
this
.
picker
=
picker
;
centerState
?.
setState
(()
{});
...
...
@@ -39,12 +39,11 @@ class BaseCenterPicker extends StatefulWidget {
}
class
BaseCenterPickerState
extends
State
<
BaseCenterPicker
>
{
@override
Widget
build
(
BuildContext
context
)
{
ScreenUtil
.
instance
=
ScreenUtil
(
width:
375
,
height:
667
)..
init
(
context
);
return
Container
(
return
CupertinoFullscreenDialogTransition
(
child:
Container
(
color:
Colors
.
black54
,
width:
double
.
maxFinite
,
height:
double
.
maxFinite
,
...
...
@@ -64,7 +63,7 @@ class BaseCenterPickerState extends State<BaseCenterPicker> {
))
],
),
);
)
)
;
}
}
...
...
lib/main.dart
View file @
72104934
...
...
@@ -45,20 +45,12 @@ class _MyAppState extends State<MyApp> {
super
.
initState
();
FlutterBoost
.
singleton
.
registerPageBuilders
({
'comment_suggest'
:
(
pageName
,
params
,
_
)
{
// if (!Api.getInstance().setDioCookie(params) ||
// params["fromPage"] == null) {
// return ErrorPage("出错:需要传递的参数为空");
// }
return
RouterCenterImpl
()
.
findUserRouter
()
?.
getCommentPage
(
params
[
"fromPage"
]);
},
'message_home'
:
(
pageName
,
params
,
_
)
{
print
(
"PARAMS!!
${params}
"
);
// if (!Api.getInstance().setDioCookie(params) ||
// params["fromPage"] == null) {
// return ErrorPage("出错:需要传递的参数为空");
// }
return
RouterCenterImpl
()
.
findNewMessageRouter
()
?.
getMessagePage
(
params
[
"fromPage"
]);
...
...
@@ -80,30 +72,18 @@ class _MyAppState extends State<MyApp> {
},
"prestige"
:
(
pageName
,
params
,
_
)
{
print
(
"PARAMS!!
${params}
"
);
// if (!Api.getInstance().setDioCookie(params) ||
// params["fromPage"] == null) {
// return ErrorPage("出错:需要传递的参数为空");
// }
int
userId
=
int
.
parse
(
params
[
"userId"
]);
return
RouterCenterImpl
().
findPrestigeRouter
()?.
getReputationsPage
(
userId
,
params
[
"userName"
],
params
[
"fromPage"
]);
},
"user_setting"
:
(
pageName
,
params
,
_
)
{
print
(
"PARAMS!!
${params}
"
);
// if (!Api.getInstance().setDioCookie(params) ||
// params["fromPage"] == null) {
// return ErrorPage("出错:需要传递的参数为空");
// }
return
RouterCenterImpl
()
.
findUserRouter
()
?.
getUserSettingPage
(
params
[
"userId"
]
??
""
,
params
[
"fromPage"
]);
},
"activity_report"
:
(
pageName
,
params
,
_
)
{
print
(
"PARAMS!!
${params}
"
);
// if (!Api.getInstance().setDioCookie(params) ||
// params["fromPage"] == null) {
// return ErrorPage("出错:需要传递的参数为空");
// }
return
RouterCenterImpl
()
.
findActivityReportRouter
()
?.
getActivityReportPage
(
...
...
@@ -116,28 +96,16 @@ class _MyAppState extends State<MyApp> {
params
[
"fromPage"
]);
},
"message_focus"
:
(
pageName
,
params
,
_
)
{
// if (!Api.getInstance().setDioCookie(params) ||
// params["fromPage"] == null) {
// return ErrorPage("出错:需要传递的参数为空");
// }
return
RouterCenterImpl
()
.
findNewMessageRouter
()
?.
getFocusPage
(
params
[
"fromPage"
]);
},
"message_attention"
:
(
pageName
,
params
,
_
)
{
// if (!Api.getInstance().setDioCookie(params) ||
// params["fromPage"] == null) {
// return ErrorPage("出错:需要传递的参数为空");
// }
return
RouterCenterImpl
()
.
findNewMessageRouter
()
?.
getAttentionPage
(
params
[
"fromPage"
]);
},
"message_like"
:
(
pageName
,
params
,
_
)
{
// if (!Api.getInstance().setDioCookie(params) ||
// params["fromPage"] == null) {
// return ErrorPage("出错:需要传递的参数为空");
// }
return
RouterCenterImpl
()
.
findNewMessageRouter
()
?.
getLikePage
(
params
[
"fromPage"
]);
...
...
lib/userModel/UserRouterImpl.dart
View file @
72104934
...
...
@@ -24,10 +24,6 @@ class UserRouterImpl implements UserRouter {
@override
void
loginChangeUserID
(
String
userId
)
{
UserEntityImpl
().
getuserId
().
listen
((
value
)
{
if
(
value
!=
userId
)
{
UserEntityImpl
().
saveuserId
(
""
);
}
});
UserEntityImpl
().
saveuserId
(
""
);
}
}
lib/userModel/page/userSetting/UserSettingPage.dart
View file @
72104934
...
...
@@ -59,6 +59,7 @@ class UserState extends BasePage<UserSettingPage> {
},
()
{
logoutPicker
.
dismiss
(
context
);
});
logoutPicker
.
setPicker
(
userLogoutPicker
);
}
@override
...
...
@@ -93,8 +94,8 @@ class UserState extends BasePage<UserSettingPage> {
}
else
{
return
GestureDetector
(
onTap:
()
{
logoutPicker
.
setPicker
(
baseLoadingItem
);
logoutPicker
.
show
(
context
);
BaseCenterPicker
()..
setPicker
(
BaseLoadingItem
(
"加载中"
))
..
setCancelOutside
(
true
).
.
show
(
context
);
_model
.
save
(
context
);
},
child:
Padding
(
...
...
@@ -245,7 +246,6 @@ class UserState extends BasePage<UserSettingPage> {
right:
ScreenUtil
.
instance
.
setWidth
(
30
)),
child:
OutlineButton
(
onPressed:
()
{
logoutPicker
.
setPicker
(
userLogoutPicker
);
logoutPicker
.
show
(
context
);
},
child:
baseText
(
"退出登入"
,
14
,
ALColors
.
Color323232
),
...
...
lib/userModel/service/remote/entity/SetUserBean.dart
View file @
72104934
...
...
@@ -44,7 +44,7 @@ class Data {
String
profilePic
;
int
gender
;
String
age
;
Null
cityId
;
String
cityId
;
String
countryId
;
double
birth
;
bool
isBind
;
...
...
lib/userModel/service/remote/entity/UserResultBean.dart
View file @
72104934
...
...
@@ -52,7 +52,7 @@ class Data {
bool
logined
;
bool
hasAnswered
;
bool
hasScanFace
;
Null
insBindId
;
String
insBindId
;
String
questionUrl
;
bool
detailSetted
;
CountryInfo
countryInfo
;
...
...
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