Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gm_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
林生雨
gm_flutter
Commits
f1739869
Commit
f1739869
authored
Jul 14, 2020
by
朱翠翠
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' of
http://git.wanmeizhensuo.com/linshengyu/gm_flutter
into zcc/flutter
parents
efeffffb
299c4797
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
48 additions
and
41 deletions
+48
-41
PlanCompareDetailPage.dart
...ueModel/page/PlanCompareDetail/PlanCompareDetailPage.dart
+1
-1
PlansCompareFeedPage.dart
...ClueModel/page/PlansCompareFeed/PlansCompareFeedPage.dart
+1
-1
ProjectDetailsPage.dart
lib/ClueModel/page/ProjectDetails/ProjectDetailsPage.dart
+1
-1
LevelOneItem.dart
lib/ClueModel/page/levelOne/LevelOneItem.dart
+6
-4
LevelOnePage.dart
lib/ClueModel/page/levelOne/LevelOnePage.dart
+4
-4
LevelTwoPage.dart
lib/ClueModel/page/levelTwo/LevelTwoPage.dart
+2
-2
MechanismBoxPage.dart
lib/ClueModel/page/mechanismBox/MechanismBoxPage.dart
+0
-1
PlanPage.dart
lib/ClueModel/page/plan/PlanPage.dart
+2
-1
TopPage.dart
lib/ClueModel/page/top/TopPage.dart
+2
-2
MainManager.dart
lib/MainRouter/manager/MainManager.dart
+2
-1
BaseComponent.dart
lib/commonModel/base/BaseComponent.dart
+14
-6
BaseUtil.dart
lib/commonModel/base/BaseUtil.dart
+0
-6
ShareCache.dart
lib/commonModel/cache/ShareCache.dart
+7
-6
Api.dart
lib/commonModel/net/Api.dart
+2
-1
DioUtil.dart
lib/commonModel/net/DioUtil.dart
+0
-1
main.dart
lib/main.dart
+4
-3
No files found.
lib/ClueModel/page/PlanCompareDetail/PlanCompareDetailPage.dart
View file @
f1739869
...
...
@@ -53,7 +53,7 @@ class PlanCompareDetailPageState extends BaseState<PlanCompareDetailPage> {
screenWidth
=
MediaQuery
.
of
(
context
).
size
.
width
;
return
Scaffold
(
appBar:
baseAppBar
(
title
:
"对比详情"
,
title
Widget:
baseText
(
"对比详情"
,
18
,
Color
(
0xff333333
),
bold:
true
)
,
centerTitle:
true
,
backClick:
()
{
if
(
RouterCenterImpl
().
findMainRouter
().
isWithNative
())
{
...
...
lib/ClueModel/page/PlansCompareFeed/PlansCompareFeedPage.dart
View file @
f1739869
...
...
@@ -54,7 +54,7 @@ class _PlansCompareFeedState extends BaseState<PlansCompareFeedPage>
return
Scaffold
(
backgroundColor:
Colors
.
white
,
appBar:
baseAppBar
(
title
:
"方案对比"
,
title
Widget:
baseText
(
"方案对比"
,
18
,
Color
(
0xff333333
),
bold:
true
)
,
centerTitle:
true
,
backClick:
()
{
if
(
RouterCenterImpl
().
findMainRouter
().
isWithNative
())
{
...
...
lib/ClueModel/page/ProjectDetails/ProjectDetailsPage.dart
View file @
f1739869
...
...
@@ -47,7 +47,7 @@ class _ProjectDetailsState extends BaseState<ProjectDetailsPage> {
Widget
buildItem
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
baseAppBar
(
title
:
"项目说明"
,
title
Widget:
baseText
(
"项目说明"
,
18
,
Color
(
0xff333333
),
bold:
true
)
,
centerTitle:
true
,
backClick:
()
{
if
(
RouterCenterImpl
().
findMainRouter
().
isWithNative
())
{
...
...
lib/ClueModel/page/levelOne/LevelOneItem.dart
View file @
f1739869
...
...
@@ -14,6 +14,8 @@ import 'package:gm_flutter/commonModel/util/DartUtil.dart';
import
'package:gm_flutter/commonModel/util/NumberUtil.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
import
'../../../main.dart'
;
class
LevelOneItem
extends
StatelessWidget
{
final
Cards
cards
;
VoidCallback
lowPrice
;
...
...
@@ -66,7 +68,7 @@ class LevelOneItem extends StatelessWidget {
}
Widget
DoctorItem
(
BuildContext
context
)
{
if
(
cards
.
doctor
==
null
&&
isDebug
)
{
if
(
cards
.
doctor
==
null
&&
!
inProduction
)
{
throw
new
Exception
();
}
var
price
=
...
...
@@ -194,7 +196,7 @@ class LevelOneItem extends StatelessWidget {
}
Widget
HospitalItem
(
BuildContext
context
)
{
if
(
cards
.
hospital
==
null
&&
isDebug
)
{
if
(
cards
.
hospital
==
null
&&
!
inProduction
)
{
throw
new
Exception
();
}
var
price
=
...
...
@@ -330,7 +332,7 @@ class LevelOneItem extends StatelessWidget {
}
Widget
PlanItem
(
BuildContext
context
)
{
if
(
cards
.
plan
==
null
&&
isDebug
)
{
if
(
cards
.
plan
==
null
&&
!
inProduction
)
{
throw
new
Exception
();
}
String
price
=
...
...
@@ -477,7 +479,7 @@ class LevelOneItem extends StatelessWidget {
}
Widget
DiaryItem
(
BuildContext
context
)
{
if
(
cards
.
diary
==
null
&&
isDebug
)
{
if
(
cards
.
diary
==
null
&&
!
inProduction
)
{
throw
new
Exception
();
}
return
Container
(
...
...
lib/ClueModel/page/levelOne/LevelOnePage.dart
View file @
f1739869
...
...
@@ -183,14 +183,14 @@ class LevelOneState extends BaseState<LevelOnePage>
child:
newHome
(),
)),
baseSliverTitle
(
"
${widget.title}
"
,
MediaQuery
.
of
(
context
).
size
.
width
,
_model
.
textLive
),
_model
.
textLive
,
context
),
baseSliverBack
(()
{
if
(
RouterCenterImpl
().
findMainRouter
().
isWithNative
())
{
FlutterBoost
.
singleton
.
closeCurrent
();
}
else
{
Navigator
.
of
(
context
).
pop
();
}
}),
}
,
context
),
],
);
}
...
...
@@ -221,7 +221,7 @@ class LevelOneState extends BaseState<LevelOnePage>
handle:
extend
.
NestedScrollView
.
sliverOverlapAbsorberHandleFor
(
context
),
sliver:
baseSliverAppBar
(
_model
.
imageUrl
,
height:
ScreenUtil
().
setHeight
(
200
)
)),
height:
200
)),
SliverList
(
delegate:
SliverChildBuilderDelegate
((
BuildContext
c
,
int
i
)
{
if
(
i
==
0
)
{
...
...
@@ -283,7 +283,7 @@ class LevelOneState extends BaseState<LevelOnePage>
return
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
54
,
margin:
EdgeInsets
.
only
(
top:
1
9
,
bottom:
12
),
margin:
EdgeInsets
.
only
(
top:
1
0
,
bottom:
12
),
child:
Stack
(
children:
<
Widget
>[
Positioned
(
...
...
lib/ClueModel/page/levelTwo/LevelTwoPage.dart
View file @
f1739869
...
...
@@ -174,14 +174,14 @@ class LevelTwoState extends BaseState<LevelTwoPage>
child:
newHome
(),
)),
baseSliverTitle
(
"
${_model.name}
"
,
MediaQuery
.
of
(
context
).
size
.
width
,
_model
.
textLive
),
_model
.
textLive
,
context
),
baseSliverBack
(()
{
if
(
RouterCenterImpl
().
findMainRouter
().
isWithNative
())
{
FlutterBoost
.
singleton
.
closeCurrent
();
}
else
{
Navigator
.
of
(
context
).
pop
();
}
}),
}
,
context
),
],
);
}
...
...
lib/ClueModel/page/mechanismBox/MechanismBoxPage.dart
View file @
f1739869
...
...
@@ -88,7 +88,6 @@ class MechanismBox implements IBottomPicker {
textController
.
dispose
();
refreshController
.
dispose
();
_model
.
dispose
();
_model
.
dispose
();
focusNode
.
dispose
();
}
...
...
lib/ClueModel/page/plan/PlanPage.dart
View file @
f1739869
...
...
@@ -36,6 +36,7 @@ import 'package:gm_flutter/commonModel/view/baseRefreshIndicator.dart';
import
'package:gm_flutter/main.mark.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
import
'../../../main.dart'
;
import
'PlanModel.dart'
;
import
'ProjectView.dart'
;
...
...
@@ -65,7 +66,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
@override
void
initState
()
{
super
.
initState
();
if
(
bool
.
fromEnvironment
(
"dart.vm.product"
)
&&
if
(
inProduction
&&
Platform
.
isIOS
&&
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
get
(
BASE_URL
)
==
null
)
{
func
=
(
str
)
{
...
...
lib/ClueModel/page/top/TopPage.dart
View file @
f1739869
...
...
@@ -148,9 +148,9 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
}
else
{
Navigator
.
of
(
context
).
pop
();
}
}),
}
,
context
),
baseSliverTitle
(
"
${widget.title}
"
,
MediaQuery
.
of
(
context
).
size
.
width
,
_model
.
textLive
)
_model
.
textLive
,
context
)
],
);
}
...
...
lib/MainRouter/manager/MainManager.dart
View file @
f1739869
...
...
@@ -16,6 +16,7 @@ import 'package:gm_flutter/commonModel/eventbus/SimpleEventBus.dart';
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
import
'../../commonModel/App.dart'
;
import
'../../main.dart'
;
class
MainManager
{
MethodChannel
flutterChannel
;
...
...
@@ -75,7 +76,7 @@ class MainManager {
innerSetData
(
map
,
BASE_URL
);
DioUtil
.
getInstance
();
if
(
bool
.
fromEnvironment
(
"dart.vm.product"
)
)
{
if
(
inProduction
)
{
if
(
map
[
BASE_URL
]
!=
null
&&
map
[
BASE_URL
]
!=
Api
.
getInstance
().
getBaseUrl
())
{
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
save
(
URL_ISCHANE
,
"yes"
);
...
...
lib/commonModel/base/BaseComponent.dart
View file @
f1739869
...
...
@@ -151,7 +151,7 @@ Widget netErrorItem() {}
Widget
errorItem
(
double
width
,
double
height
,
VoidCallback
retry
,
{
String
errorText
,
String
retryText
,
double
paddingTop
})
{
return
Container
(
color:
Colors
.
white
,
color:
Colors
.
white
,
width:
width
,
height:
height
,
padding:
EdgeInsets
.
only
(
top:
paddingTop
??
0
),
...
...
@@ -504,20 +504,27 @@ Widget baseSliverAppBar(String url,
elevation:
elevation
??
0
,
expandedHeight:
height
??
200
,
automaticallyImplyLeading:
false
,
bottom:
PreferredSize
(
preferredSize:
Size
.
fromHeight
(
Platform
.
isIOS
?
-
12
:
-
6
),
child:
SizedBox
(
height:
0
,
),
),
flexibleSpace:
FlexibleSpaceBar
(
background:
needpic
?
CachedNetworkImage
(
imageUrl:
url
??
''
,
fit:
BoxFit
.
cover
,
fit:
BoxFit
.
fitHeight
,
)
:
Container
(),
),
);
}
Widget
baseSliverBack
(
VoidCallback
tap
)
{
Widget
baseSliverBack
(
VoidCallback
tap
,
context
)
{
final
double
topPadding
=
MediaQuery
.
of
(
context
).
padding
.
top
;
return
Positioned
(
top:
45
,
top:
topPadding
+
12
,
left:
7
,
child:
GestureDetector
(
behavior:
HitTestBehavior
.
opaque
,
...
...
@@ -538,9 +545,10 @@ Widget baseSliverBack(VoidCallback tap) {
);
}
Widget
baseSliverTitle
(
String
text
,
double
width
,
LiveData
liveData
)
{
Widget
baseSliverTitle
(
String
text
,
double
width
,
LiveData
liveData
,
context
)
{
final
double
topPadding
=
MediaQuery
.
of
(
context
).
padding
.
top
;
return
Positioned
(
top:
46
,
top:
topPadding
+
13
,
child:
StreamBuilder
(
stream:
liveData
.
stream
,
initialData:
liveData
.
data
??
0.0
,
...
...
lib/commonModel/base/BaseUtil.dart
View file @
f1739869
...
...
@@ -3,9 +3,3 @@
* @date 2019-10-14
**/
import
'dart:ui'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
const
bool
isDebug
=
!
const
bool
.
fromEnvironment
(
"dart.vm.product"
);
lib/commonModel/cache/ShareCache.dart
View file @
f1739869
...
...
@@ -7,6 +7,7 @@
import
'package:gm_flutter/commonModel/base/BaseUtil.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
import
'../../main.dart'
;
import
'CacheManager.dart'
;
class
ShareCache
implements
ICache
{
...
...
@@ -19,36 +20,36 @@ class ShareCache implements ICache {
void
save
(
String
key
,
value
)
{
if
(
value
is
String
)
{
sharedPreferences
.
setString
(
key
,
value
).
whenComplete
(()
{
if
(
isDebug
)
{
if
(
!
inProduction
)
{
print
(
"save String
${value}
success"
);
}
});
}
else
if
(
value
is
bool
)
{
sharedPreferences
.
setBool
(
key
,
value
).
whenComplete
(()
{
if
(
isDebug
)
{
if
(
!
inProduction
)
{
print
(
"save bool
${value}
success"
);
}
});
}
else
if
(
value
is
double
)
{
sharedPreferences
.
setDouble
(
key
,
value
).
whenComplete
(()
{
if
(
isDebug
)
{
if
(
!
inProduction
)
{
print
(
"save double
${value}
success"
);
}
});
}
else
if
(
value
is
int
)
{
sharedPreferences
.
setInt
(
key
,
value
).
whenComplete
(()
{
if
(
isDebug
)
{
if
(
!
inProduction
)
{
print
(
"save int
${value}
success"
);
}
});
}
else
if
(
value
is
List
<
String
>)
{
sharedPreferences
.
setStringList
(
key
,
value
).
whenComplete
(()
{
if
(
isDebug
)
{
if
(
!
inProduction
)
{
print
(
"save StringList
${value}
success"
);
}
});
}
else
{
if
(
isDebug
)
{
if
(
!
inProduction
)
{
throw
Exception
(
"save error type"
);
}
}
...
...
lib/commonModel/net/Api.dart
View file @
f1739869
...
...
@@ -8,6 +8,7 @@ import 'dart:math';
import
'package:dio/dio.dart'
;
import
'package:gm_flutter/commonModel/base/BaseUtil.dart'
;
import
'../../main.dart'
;
import
'DioUtil.dart'
;
/**
...
...
@@ -42,7 +43,7 @@ class Api {
}
String
getBaseUrl
()
{
if
(
bool
.
fromEnvironment
(
"dart.vm.product"
)
)
{
if
(
inProduction
)
{
return
APP_HOST_RELEASE
;
}
else
{
return
APP_HOST_DEBUG
;
...
...
lib/commonModel/net/DioUtil.dart
View file @
f1739869
...
...
@@ -69,7 +69,6 @@ class DioUtil {
headers
[
'User-Agent'
]
=
agent
;
}
_options
.
headers
=
headers
;
print
(
"ISEMPTY ??
${baseUrl}
${Api.getInstance().getBaseUrl()}
"
);
_options
.
baseUrl
=
baseUrl
??
"
${Api.getInstance().getBaseUrl()}
/"
;
}
}
lib/main.dart
View file @
f1739869
...
...
@@ -15,13 +15,14 @@ import 'commonModel/nav/NavigationService.dart';
import
'main.mark.dart'
;
NavigationService
navigationService
;
const
bool
inProduction
=
true
;
bool
inProduction
=
true
;
void
main
(
)
{
inProduction
=
bool
.
fromEnvironment
(
"dart.vm.product"
);
navigationService
=
NavigationService
();
WidgetsFlutterBinding
.
ensureInitialized
();
FlutterError
.
onError
=
(
FlutterErrorDetails
details
)
async
{
if
(
isDebug
)
{
if
(
!
inProduction
)
{
FlutterError
.
dumpErrorToConsole
(
details
);
}
else
{
Zone
.
current
.
handleUncaughtError
(
details
.
exception
,
details
.
stack
);
...
...
@@ -123,7 +124,7 @@ class HomeState extends State<Home> {
@override
Widget
build
(
BuildContext
context
)
{
ScreenUtil
.
init
(
context
,
width:
375
,
height:
667
);
return
isDebug
return
!
inProduction
?
RouterCenterImpl
().
findMainRouter
().
getTestPage
()
:
Container
(
color:
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