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
026a4810
Commit
026a4810
authored
Oct 16, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
79a469d6
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
355 additions
and
55 deletions
+355
-55
ReputationsModel.dart
lib/PrestigeModel/page/reputation/ReputationsModel.dart
+6
-3
ReputationsPage.dart
lib/PrestigeModel/page/reputation/ReputationsPage.dart
+12
-10
temp.dart
lib/PrestigeModel/page/temp.dart
+0
-5
BaseComponent.dart
lib/commonModel/base/BaseComponent.dart
+16
-3
ALColors.dart
lib/res/value/ALColors.dart
+1
-1
CountryJson.dart
lib/userModel/page/country/CountryJson.dart
+264
-0
CountryModel.dart
lib/userModel/page/country/CountryModel.dart
+20
-0
CountryPage.dart
lib/userModel/page/country/CountryPage.dart
+10
-6
UserSettingModel.dart
lib/userModel/page/userSetting/UserSettingModel.dart
+8
-2
UserSettingPage.dart
lib/userModel/page/userSetting/UserSettingPage.dart
+18
-25
No files found.
lib/PrestigeModel/page/reputation/ReputationsModel.dart
View file @
026a4810
...
...
@@ -3,6 +3,7 @@
* @date 2019-09-16
**/
import
'package:flutter/material.dart'
;
import
'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart'
;
import
'package:gmalpha_flutter/PrestigeModel/service/PrestigeRepository.dart'
;
import
'package:gmalpha_flutter/PrestigeModel/service/remote/entity/PrestigeEntity.dart'
;
import
'package:gmalpha_flutter/commonModel/live/BaseModel.dart'
;
...
...
@@ -20,8 +21,6 @@ class ReputationsModel extends BaseModel {
ReputationsModel
(
this
.
userId
,
this
.
userName
,
this
.
fromPage
)
{
prestigeLive
=
new
LiveData
();
titleLive
=
new
LiveData
();
print
(
"lsy -->INIT!!!"
);
}
init
(
BuildContext
context
)
{
...
...
@@ -40,6 +39,10 @@ class ReputationsModel extends BaseModel {
void
dispose
()
{
prestigeLive
.
dispost
();
titleLive
.
dispost
();
print
(
"lsy -->DISPOST!!!"
);
}
void
pop
(
BuildContext
context
,
String
pageName
)
{
RouterCenterImpl
().
findBuriedRouter
()?.
onClick
(
pageName
,
"return"
);
Navigator
.
pop
(
context
);
}
}
lib/PrestigeModel/page/reputation/ReputationsPage.dart
View file @
026a4810
...
...
@@ -39,7 +39,8 @@ class ReputationsState extends BasePage<ReputationsPage> {
@override
Widget
build
(
BuildContext
context
)
{
screenWidth
=
MediaQuery
.
of
(
context
).
size
.
width
;
return
Scaffold
(
return
WillPopScope
(
child:
Scaffold
(
appBar:
AppBar
(
title:
StreamBuilder
<
String
>(
stream:
_model
.
titleLive
.
stream
,
...
...
@@ -58,10 +59,7 @@ class ReputationsState extends BasePage<ReputationsPage> {
centerTitle:
true
,
leading:
GestureDetector
(
onTap:
()
{
RouterCenterImpl
()
.
findBuriedRouter
()
?.
onClick
(
pageName
(),
"return"
);
Navigator
.
pop
(
context
,
""
);
_model
.
pop
(
context
,
pageName
());
},
child:
Container
(
alignment:
Alignment
.
centerLeft
,
...
...
@@ -90,8 +88,8 @@ class ReputationsState extends BasePage<ReputationsPage> {
if
(
index
==
0
)
{
return
Container
(
margin:
EdgeInsets
.
fromLTRB
(
17
,
24
,
17
,
0
),
child:
MyText
(
16.0
,
data
.
data
.
data
.
introduce
[
0
].
question
,
0xff323232
),
child:
MyText
(
16.0
,
data
.
data
.
data
.
introduce
[
0
].
question
,
0xff323232
),
);
}
if
(
index
==
1
)
{
...
...
@@ -99,8 +97,8 @@ class ReputationsState extends BasePage<ReputationsPage> {
margin:
EdgeInsets
.
fromLTRB
(
19
,
16
,
19
,
32
),
child:
Text
(
data
.
data
.
data
.
introduce
[
0
].
answer
,
style:
TextStyle
(
fontSize:
13
,
color:
Color
(
0xff8E8E8E
)),
style:
TextStyle
(
fontSize:
13
,
color:
Color
(
0xff8E8E8E
)),
));
}
if
(
index
==
data
.
data
.
data
.
reputations
.
length
+
2
)
{
...
...
@@ -114,7 +112,11 @@ class ReputationsState extends BasePage<ReputationsPage> {
],
);
},
));
)),
onWillPop:
()
{
_model
.
pop
(
context
,
pageName
());
},
);
}
Widget
listItem
(
AsyncSnapshot
<
PrestigeEntity
>
data
,
int
index
)
{
...
...
lib/PrestigeModel/page/temp.dart
deleted
100644 → 0
View file @
79a469d6
/*
* @author lsy
* @date 2019-09-16
**/
\ No newline at end of file
lib/commonModel/base/BaseComponent.dart
View file @
026a4810
...
...
@@ -4,7 +4,9 @@
**/
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:gmalpha_flutter/res/GMRes.dart'
;
AppBar
baseAppBar
(
{
String
title
,
...
...
@@ -12,7 +14,7 @@ AppBar baseAppBar(
bool
centerTitle
,
VoidCallback
backClick
})
{
return
AppBar
(
title:
title
==
null
?
Container
()
:
baseText
(
title
,
16
,
0xff
323232
),
title:
title
==
null
?
Container
()
:
baseText
(
title
,
16
,
ALColors
.
Color
323232
),
centerTitle:
centerTitle
,
leading:
GestureDetector
(
onTap:
backClick
,
...
...
@@ -30,13 +32,24 @@ AppBar baseAppBar(
);
}
Text
baseText
(
String
text
,
double
fontSize
,
int
color
)
{
Text
baseText
(
String
text
,
double
fontSize
,
Color
color
)
{
return
Text
(
text
,
style:
TextStyle
(
fontSize:
fontSize
,
color:
Color
(
color
)
),
style:
TextStyle
(
fontSize:
fontSize
,
color:
color
),
);
}
Widget
baseDivide
(
double
height
,
int
padding
,
Color
color
)
{
return
Container
(
height:
height
,
margin:
EdgeInsets
.
only
(
right:
ScreenUtil
.
instance
.
setWidth
(
padding
),
left:
ScreenUtil
.
instance
.
setWidth
(
padding
)),
child:
Container
(
color:
color
,
));
}
Widget
loadingItem
(
)
{
//TODO
return
Center
(
child:
CircularProgressIndicator
());
...
...
lib/res/value/ALColors.dart
View file @
026a4810
...
...
@@ -5,13 +5,13 @@ import 'dart:ui' show Color;
import
'package:flutter/painting.dart'
;
// 关于颜色的定义
// Color(0xFF323232);
// FF 表示透明度 323232 表示RGB颜色值
class
ALColors
{
ALColors
.
_
();
static
const
Color
Color323232
=
Color
(
0xFF323232
);
static
const
Color
Color464646
=
Color
(
0xFF464646
);
static
const
Color
Color999999
=
Color
(
0xFF999999
);
...
...
lib/userModel/page/country/CountryJson.dart
0 → 100644
View file @
026a4810
/*
* @author lsy
* @date 2019-10-16
**/
const
STATIC_COUNTRY_JSON
=
"""
{
"
error
": 0,
"
message
": "",
"
extra
": null,
"
data
": [
{
"
title
": "
A
",
"
countries
": [
{
"
id
": "
America
",
"
name
": "
美国
",
"
language
": "
en
"
},
{
"
id
": "
Argentina
",
"
name
": "
阿根廷
",
"
language
": "
en
"
},
{
"
id
": "
Australia
",
"
name
": "
澳大利亚
",
"
language
": "
en
"
}
]
},
{
"
title
": "
B
",
"
countries
": [
{
"
id
": "
Belgium
",
"
name
": "
比利时
",
"
language
": "
en
"
},
{
"
id
": "
Brazil
",
"
name
": "
巴西
",
"
language
": "
en
"
},
{
"
id
": "
Brunei
",
"
name
": "
文莱
",
"
language
": "
en
"
}
]
},
{
"
title
": "
C
",
"
countries
": [
{
"
id
": "
Canada
",
"
name
": "
加拿大
",
"
language
": "
en
"
},
{
"
id
": "
china
",
"
name
": "
中国
",
"
language
": "
zh
"
}
]
},
{
"
title
": "
E
",
"
countries
": [
{
"
id
": "
Egypt
",
"
name
": "
埃及
",
"
language
": "
en
"
},
{
"
id
": "
England
",
"
name
": "
英国
",
"
language
": "
en
"
}
]
},
{
"
title
": "
F
",
"
countries
": [
{
"
id
": "
France
",
"
name
": "
法国
",
"
language
": "
fra
"
}
]
},
{
"
title
": "
H
",
"
countries
": [
{
"
id
": "
hanguo
",
"
name
": "
韩国
",
"
language
": "
kor
"
}
]
},
{
"
title
": "
I
",
"
countries
": [
{
"
id
": "
India
",
"
name
": "
印度
",
"
language
": "
en
"
},
{
"
id
": "
Indonesia
",
"
name
": "
印度尼西亚
",
"
language
": "
en
"
},
{
"
id
": "
Ireland
",
"
name
": "
爱尔兰
",
"
language
": "
en
"
}
]
},
{
"
title
": "
J
",
"
countries
": [
{
"
id
": "
Japan
",
"
name
": "
日本
",
"
language
": "
jp
"
}
]
},
{
"
title
": "
L
",
"
countries
": [
{
"
id
": "
Libya
",
"
name
": "
利比亚
",
"
language
": "
en
"
}
]
},
{
"
title
": "
M
",
"
countries
": [
{
"
id
": "
Malaysia
",
"
name
": "
马来西亚
",
"
language
": "
en
"
},
{
"
id
": "
Maldives
",
"
name
": "
马尔代夫
",
"
language
": "
en
"
},
{
"
id
": "
Mexico
",
"
name
": "
墨西哥
",
"
language
": "
en
"
},
{
"
id
": "
Morocco
",
"
name
": "
摩洛哥
",
"
language
": "
en
"
}
]
},
{
"
title
": "
N
",
"
countries
": [
{
"
id
": "
Netherlands
",
"
name
": "
荷兰
",
"
language
": "
en
"
},
{
"
id
": "
NewZealand
",
"
name
": "
新西兰
",
"
language
": "
en
"
}
]
},
{
"
title
": "
P
",
"
countries
": [
{
"
id
": "
Pakistan
",
"
name
": "
巴基斯坦
",
"
language
": "
en
"
},
{
"
id
": "
Paraguay
",
"
name
": "
巴拉圭
",
"
language
": "
en
"
},
{
"
id
": "
Portugal
",
"
name
": "
葡萄牙
",
"
language
": "
pt
"
}
]
},
{
"
title
": "
R
",
"
countries
": [
{
"
id
": "
Russia
",
"
name
": "
俄罗斯
",
"
language
": "
ru
"
}
]
},
{
"
title
": "
S
",
"
countries
": [
{
"
id
": "
singapore
",
"
name
": "
新加坡
",
"
language
": "
en
"
},
{
"
id
": "
Spain
",
"
name
": "
西班牙
",
"
language
": "
spa
"
},
{
"
id
": "
SriLanka
",
"
name
": "
斯里兰卡
",
"
language
": "
en
"
}
]
},
{
"
title
": "
T
",
"
countries
": [
{
"
id
": "
thailand
",
"
name
": "
泰国
",
"
language
": "
en
"
}
]
},
{
"
title
": "
U
",
"
countries
": [
{
"
id
": "
Uruguay
",
"
name
": "
乌拉圭
",
"
language
": "
en
"
}
]
},
{
"
title
": "
V
",
"
countries
": [
{
"
id
": "
Vietnam
",
"
name
": "
越南
",
"
language
": "
vie
"
}
]
}
],
"
user_type
": {}
}
"""
;
lib/userModel/page/country/CountryModel.dart
View file @
026a4810
...
...
@@ -2,9 +2,12 @@
* @author lsy
* @date 2019-10-15
**/
import
'dart:convert'
;
import
'package:flutter/cupertino.dart'
;
import
'package:gmalpha_flutter/commonModel/GMBase.dart'
;
import
'package:gmalpha_flutter/commonModel/toast/toast.dart'
;
import
'package:gmalpha_flutter/userModel/page/country/CountryJson.dart'
;
import
'package:gmalpha_flutter/userModel/service/UserRepository.dart'
;
import
'package:gmalpha_flutter/userModel/service/remote/entity/CountryBean.dart'
;
...
...
@@ -17,6 +20,19 @@ class CountryModel extends BaseModel {
CountryModel
(
this
.
refer
);
getCountries
(
BuildContext
context
)
{
getStaticCountry
().
then
((
value
)
{
if
(
value
!=
null
)
{
liveData
.
notifyView
(
value
);
}
else
{
getCountryFromNet
(
context
);
}
}).
catchError
((
error
)
{
Toast
.
debugShow
(
context
,
error
);
print
(
error
);
});
}
getCountryFromNet
(
BuildContext
context
)
{
UserRepository
.
getInstance
().
getCountries
().
listen
((
value
)
{
liveData
.
notifyView
(
value
);
}).
onError
((
error
)
{
...
...
@@ -25,6 +41,10 @@ class CountryModel extends BaseModel {
});
}
Future
getStaticCountry
()
async
{
return
await
CountryBean
.
fromJson
(
json
.
decode
(
STATIC_COUNTRY_JSON
));
}
@override
void
dispose
()
{
liveData
.
dispost
();
...
...
lib/userModel/page/country/CountryPage.dart
View file @
026a4810
...
...
@@ -86,7 +86,7 @@ class CountryState extends BasePage {
padding:
EdgeInsets
.
only
(
left:
ScreenUtil
.
instance
.
setWidth
(
12
),
),
child:
baseText
(
head
,
15
,
0xFF
323232
),
child:
baseText
(
head
,
15
,
ALColors
.
Color
323232
),
);
}
...
...
@@ -101,19 +101,23 @@ class CountryState extends BasePage {
margin:
EdgeInsets
.
only
(
left:
ScreenUtil
.
instance
.
setWidth
(
12
),
),
child:
baseText
(
country
.
name
,
15
,
0xFF
323232
),
child:
baseText
(
country
.
name
,
15
,
ALColors
.
Color
323232
),
));
}
@override
void
dispose
()
{
super
.
dispose
();
_scrollController
.
dispose
();
}
@override
String
pageName
()
{
// TODO: implement pageName
return
null
;
return
"country_page"
;
}
@override
String
referrer
()
{
// TODO: implement referrer
return
null
;
return
_model
.
refer
;
}
}
lib/userModel/page/userSetting/UserSettingModel.dart
View file @
026a4810
...
...
@@ -6,6 +6,7 @@
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart'
;
import
'package:gmalpha_flutter/commonModel/GMBase.dart'
;
import
'package:gmalpha_flutter/commonModel/base/BaseUtil.dart'
;
import
'package:gmalpha_flutter/commonModel/live/BaseModel.dart'
;
import
'package:gmalpha_flutter/commonModel/net/Api.dart'
;
...
...
@@ -91,8 +92,9 @@ class UserSettingModel extends BaseModel {
saveLive
.
dispost
();
}
void
jumpToCAM
(
BuildContext
context
)
{
jumpToCamera
(
context
,
refere
,
Api
.
PROVIDER_NAME
,
true
,
1
,
null
)
void
jumpToCAM
(
BuildContext
context
,
String
pageName
)
{
clickEvent
(
pageName
,
"quit"
);
jumpToCamera
(
context
,
pageName
,
Api
.
PROVIDER_NAME
,
true
,
1
,
null
)
.
then
((
value
)
{
if
(
value
!=
null
)
{
selectImgPath
=
value
[
0
];
...
...
@@ -116,4 +118,8 @@ class UserSettingModel extends BaseModel {
print
(
error
);
});
}
void
quit
(
BuildContext
context
,
String
pageName
)
{
clickEvent
(
pageName
,
"quit"
);
}
}
lib/userModel/page/userSetting/UserSettingPage.dart
View file @
026a4810
...
...
@@ -14,6 +14,7 @@ import 'package:gmalpha_flutter/commonModel/base/BaseBuried.dart';
import
'package:gmalpha_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gmalpha_flutter/commonModel/base/BasePage.dart'
;
import
'package:gmalpha_flutter/commonModel/net/Responce/SimpleResponce.dart'
;
import
'package:gmalpha_flutter/res/GMRes.dart'
;
import
'package:gmalpha_flutter/userModel/page/userSetting/UserSettingModel.dart'
;
import
'package:gmalpha_flutter/userModel/service/remote/entity/TestUserEntity.dart'
;
import
'package:gmalpha_flutter/userModel/service/remote/entity/UserEntity.dart'
;
...
...
@@ -66,7 +67,7 @@ class UserState extends BasePage<UserSettingPage> {
padding:
EdgeInsets
.
only
(
right:
ScreenUtil
.
instance
.
setWidth
(
30
)),
child:
Center
(
child:
baseText
(
"保存"
,
14
,
0xff
C4C4C4
),
child:
baseText
(
"保存"
,
14
,
ALColors
.
Color
C4C4C4
),
),
);
}
else
{
...
...
@@ -76,7 +77,7 @@ class UserState extends BasePage<UserSettingPage> {
padding:
EdgeInsets
.
only
(
right:
ScreenUtil
.
instance
.
setWidth
(
30
)),
child:
Center
(
child:
baseText
(
"保存"
,
14
,
0xff
323232
),
child:
baseText
(
"保存"
,
14
,
ALColors
.
Color
323232
),
),
));
}
...
...
@@ -89,7 +90,7 @@ class UserState extends BasePage<UserSettingPage> {
Container
(
margin:
EdgeInsets
.
fromLTRB
(
ScreenUtil
.
instance
.
setWidth
(
29
),
ScreenUtil
.
instance
.
setWidth
(
25
),
0
,
0
),
child:
baseText
(
"设置"
,
30
,
0xff
323232
),
child:
baseText
(
"设置"
,
30
,
ALColors
.
Color
323232
),
),
Container
(
width:
ScreenUtil
.
instance
.
setWidth
(
127
),
...
...
@@ -101,7 +102,7 @@ class UserState extends BasePage<UserSettingPage> {
ScreenUtil
.
instance
.
setWidth
(
23
)),
child:
GestureDetector
(
onTap:
()
{
_model
.
jumpToCAM
(
context
);
_model
.
jumpToCAM
(
context
,
pageName
()
);
},
child:
Stack
(
alignment:
Alignment
.
bottomRight
,
...
...
@@ -114,6 +115,7 @@ class UserState extends BasePage<UserSettingPage> {
// return SvgPicture.asset("images/replace_head.svg");
return
Container
();
}
else
{
startTime
=
DateTime
.
now
().
millisecondsSinceEpoch
;
return
Container
(
alignment:
Alignment
.
center
,
width:
ScreenUtil
.
instance
.
setWidth
(
127
),
...
...
@@ -149,12 +151,12 @@ class UserState extends BasePage<UserSettingPage> {
initialData:
_model
.
nameLive
.
data
,
builder:
(
con
,
data
)
{
return
Center
(
child:
baseText
(
data
.
data
??
""
,
13
,
0xff
323232
),
child:
baseText
(
data
.
data
??
""
,
13
,
ALColors
.
Color
323232
),
);
},
),
false
),
divideLine
(
),
baseDivide
(
1
,
30
,
ALColors
.
ColorE4E4E4
),
baseItem
(()
{
_model
.
jumpToCTY
(
context
,
pageName
());
},
...
...
@@ -166,18 +168,18 @@ class UserState extends BasePage<UserSettingPage> {
return
Container
(
margin:
EdgeInsets
.
only
(
right:
ScreenUtil
.
instance
.
setWidth
(
19
)),
child:
baseText
(
data
.
data
??
""
,
13
,
0xff
323232
),
child:
baseText
(
data
.
data
??
""
,
13
,
ALColors
.
Color
323232
),
);
},
),
true
),
divideLine
(
),
baseDivide
(
1
,
30
,
ALColors
.
ColorE4E4E4
),
baseItem
(()
{
jumpToComment
(
context
,
pageName
());
},
"意见与建议"
,
null
,
true
),
divideLine
(
),
baseDivide
(
1
,
30
,
ALColors
.
ColorE4E4E4
),
baseItem
(()
{},
"隐私声明"
,
null
,
true
),
divideLine
(
),
baseDivide
(
1
,
30
,
ALColors
.
ColorE4E4E4
),
],
),
Expanded
(
...
...
@@ -191,8 +193,10 @@ class UserState extends BasePage<UserSettingPage> {
left:
ScreenUtil
.
instance
.
setWidth
(
30
),
right:
ScreenUtil
.
instance
.
setWidth
(
30
)),
child:
OutlineButton
(
onPressed:
()
{},
child:
baseText
(
"退出登入"
,
14
,
0xff323232
),
onPressed:
()
{
_model
.
quit
(
context
,
pageName
());
},
child:
baseText
(
"退出登入"
,
14
,
ALColors
.
Color323232
),
borderSide:
new
BorderSide
(
color:
Color
(
0xff323232
)),
),
)
...
...
@@ -201,17 +205,6 @@ class UserState extends BasePage<UserSettingPage> {
);
}
divideLine
()
{
return
Container
(
height:
1
,
margin:
EdgeInsets
.
only
(
right:
ScreenUtil
.
instance
.
setWidth
(
30
),
left:
ScreenUtil
.
instance
.
setWidth
(
30
)),
child:
Container
(
color:
Color
(
0xffE4E4E4
),
));
}
baseItem
(
VoidCallback
ontap
,
String
left
,
Widget
center
,
bool
needRight
)
{
return
GestureDetector
(
onTap:
()
=>
ontap
(),
...
...
@@ -223,7 +216,7 @@ class UserState extends BasePage<UserSettingPage> {
width:
double
.
maxFinite
,
child:
Row
(
children:
<
Widget
>[
baseText
(
left
,
13
,
0xff
323232
),
baseText
(
left
,
13
,
ALColors
.
Color
323232
),
Expanded
(
child:
Text
(
""
),
),
...
...
@@ -244,7 +237,7 @@ class UserState extends BasePage<UserSettingPage> {
@override
String
pageName
()
{
return
"
TODO
"
;
return
"
page_setting_up
"
;
}
@override
...
...
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