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
fb0001a3
Commit
fb0001a3
authored
Jul 13, 2020
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
w
parent
1ec9376c
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
238 additions
and
89 deletions
+238
-89
DiscussLowPriceModel.dart
lib/ClueModel/page/DiscussLowPrice/DiscussLowPriceModel.dart
+1
-1
PlanCompareDetailModel.dart
...eModel/page/PlanCompareDetail/PlanCompareDetailModel.dart
+1
-1
PlansCompareFeedItemView.dart
...Model/page/PlansCompareFeed/PlansCompareFeedItemView.dart
+1
-1
ProjectDetailsModel.dart
lib/ClueModel/page/ProjectDetails/ProjectDetailsModel.dart
+1
-1
LevelOneList.dart
lib/ClueModel/page/levelOne/LevelOneList.dart
+1
-1
LevelOneListModel.dart
lib/ClueModel/page/levelOne/LevelOneListModel.dart
+1
-1
LevelOneModel.dart
lib/ClueModel/page/levelOne/LevelOneModel.dart
+1
-1
LevelTwoModel.dart
lib/ClueModel/page/levelTwo/LevelTwoModel.dart
+1
-1
MechanismBoxPage.dart
lib/ClueModel/page/mechanismBox/MechanismBoxPage.dart
+1
-1
MechanismModel.dart
lib/ClueModel/page/mechanismBox/MechanismModel.dart
+1
-1
FilterView.dart
lib/ClueModel/page/plan/FilterView.dart
+171
-70
PlanModel.dart
lib/ClueModel/page/plan/PlanModel.dart
+3
-3
TopListModel.dart
lib/ClueModel/page/top/TopListModel.dart
+1
-1
TopModel.dart
lib/ClueModel/page/top/TopModel.dart
+1
-1
MainRouter.dart
lib/MainRouter/MainRouter.dart
+2
-0
MainRouterImpl.dart
lib/MainRouter/MainRouterImpl.dart
+5
-0
MainManager.dart
lib/MainRouter/manager/MainManager.dart
+10
-0
NativeToast.dart
lib/commonModel/util/NativeToast.dart
+31
-0
PrintUtil.dart
lib/commonModel/util/PrintUtil.dart
+1
-1
pubspec.lock
pubspec.lock
+2
-2
pubspec.yaml
pubspec.yaml
+1
-1
No files found.
lib/ClueModel/page/DiscussLowPrice/DiscussLowPriceModel.dart
View file @
fb0001a3
...
...
@@ -11,9 +11,9 @@ import 'package:flutter_common/commonModel/live/LiveData.dart';
import
'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart'
;
import
'package:gm_flutter/commonModel/GMBase.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceModelBean.dart'
;
import
'package:gm_flutter/commonModel/util/NativeToast.dart'
;
class
DiscussLowPriceModel
extends
BaseModel
{
LiveData
<
Pair
<
int
,
DiscussLowPriceModelBean
>>
popViewLive
=
LiveData
();
...
...
lib/ClueModel/page/PlanCompareDetail/PlanCompareDetailModel.dart
View file @
fb0001a3
...
...
@@ -10,8 +10,8 @@ import 'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart';
import
'package:gm_flutter/ClueModel/server/entity/PlanCompareDetail.dart'
;
import
'package:gm_flutter/commonModel/GMBase.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/util/NativeToast.dart'
;
import
'package:gm_flutter/commonModel/util/PrintUtil.dart'
;
class
PlanCompareDetailModel
extends
BaseModel
{
...
...
lib/ClueModel/page/PlansCompareFeed/PlansCompareFeedItemView.dart
View file @
fb0001a3
import
'package:cached_network_image/cached_network_image.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlansCompareFeed.dart'
;
import
'package:gm_flutter/ClueModel/util/NumPlanUtil.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gm_flutter/commonModel/base/BaseState.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
import
'package:gm_flutter/commonModel/util/NativeToast.dart'
;
import
'CallBackCompareItem.dart'
;
...
...
lib/ClueModel/page/ProjectDetails/ProjectDetailsModel.dart
View file @
fb0001a3
...
...
@@ -5,10 +5,10 @@
**/
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart'
;
import
'package:gm_flutter/commonModel/GMBase.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.dart'
;
import
'package:gm_flutter/commonModel/util/NativeToast.dart'
;
import
'package:gm_flutter/commonModel/util/PrintUtil.dart'
;
import
'../../server/entity/ProjectDetailsItem.dart'
;
...
...
lib/ClueModel/page/levelOne/LevelOneList.dart
View file @
fb0001a3
...
...
@@ -5,7 +5,6 @@
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_common/commonModel/picker/base/BaseBottomPicker.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/ClueModel/page/DiscussLowPrice/DiscussLowPricePopView.dart'
;
import
'package:gm_flutter/ClueModel/page/levelOne/LevelOneListModel.dart'
;
import
'package:gm_flutter/ClueModel/page/mechanismBox/MechanismBoxPage.dart'
;
...
...
@@ -15,6 +14,7 @@ import 'package:gm_flutter/commonModel/base/BaseComponent.dart';
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/cache/CacheManager.dart'
;
import
'package:gm_flutter/commonModel/eventbus/SimpleEventBus.dart'
;
import
'package:gm_flutter/commonModel/util/NativeToast.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
...
...
lib/ClueModel/page/levelOne/LevelOneListModel.dart
View file @
fb0001a3
...
...
@@ -4,12 +4,12 @@
**/
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/LevelOneFeedList.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/net/DioUtil.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.dart'
;
import
'package:gm_flutter/commonModel/util/NativeToast.dart'
;
import
'package:gm_flutter/commonModel/util/PrintUtil.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
...
...
lib/ClueModel/page/levelOne/LevelOneModel.dart
View file @
fb0001a3
...
...
@@ -5,7 +5,6 @@
import
'package:flutter/material.dart'
;
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart'
;
import
'package:gm_flutter/ClueModel/server/api/ClueTApi.serv.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/LevelOneFeedList.dart'
;
...
...
@@ -13,6 +12,7 @@ import 'package:gm_flutter/ClueModel/server/entity/PlanOverViewBean.dart';
import
'package:gm_flutter/commonModel/GMBase.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.dart'
;
import
'package:gm_flutter/commonModel/util/NativeToast.dart'
;
import
'package:gm_flutter/commonModel/util/PrintUtil.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
...
...
lib/ClueModel/page/levelTwo/LevelTwoModel.dart
View file @
fb0001a3
...
...
@@ -5,13 +5,13 @@
import
'package:flutter/material.dart'
;
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart'
;
import
'package:gm_flutter/ClueModel/server/api/ClueTApi.serv.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanOverViewBean.dart'
;
import
'package:gm_flutter/commonModel/GMBase.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.dart'
;
import
'package:gm_flutter/commonModel/util/NativeToast.dart'
;
import
'package:gm_flutter/commonModel/util/PrintUtil.dart'
;
class
LevelOneModel
extends
BaseModel
{
...
...
lib/ClueModel/page/mechanismBox/MechanismBoxPage.dart
View file @
fb0001a3
import
'package:cached_network_image/cached_network_image.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_common/commonModel/picker/base/BaseBottomPicker.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/ClueModel/page/levelOne/LevelOneListModel.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/ConsultHospitalsBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/LevelOneFeedList.dart'
;
...
...
@@ -10,6 +9,7 @@ import 'package:gm_flutter/commonModel/base/BaseComponent.dart';
import
'package:gm_flutter/ClueModel/page/mechanismBox/MechanismModel.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
import
'package:gm_flutter/commonModel/util/NativeToast.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
...
...
lib/ClueModel/page/mechanismBox/MechanismModel.dart
View file @
fb0001a3
...
...
@@ -5,12 +5,12 @@
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/ConsultHospitalsBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/LevelOneFeedList.dart'
;
import
'package:gm_flutter/commonModel/net/DioUtil.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.dart'
;
import
'package:gm_flutter/commonModel/util/NativeToast.dart'
;
import
'package:gm_flutter/commonModel/util/PrintUtil.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
...
...
lib/ClueModel/page/plan/FilterView.dart
View file @
fb0001a3
...
...
@@ -52,49 +52,73 @@ class FilterViewState extends State<FilterView> {
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
color:
Colors
.
white
,
height:
186
,
child:
Stack
(
children:
<
Widget
>[
// Positioned(
// top: 0,
// child: Container(
// width: MediaQuery.of(context).size.width,
// height: 6,
// child: Image.asset("assets/shadow.png"),
// ),
// ),
Positioned
(
top:
54.5
,
right:
15
,
child:
StreamBuilder
(
stream:
highLive
.
stream
,
initialData:
highLive
.
data
??
(
widget
.
high
>=
19600
?
"无限"
:
"
${widget.high}
"
),
builder:
(
c
,
data
)
{
return
baseText
(
"
${data.data}
"
,
12
,
Color
(
0xff3FB5AF
));
},
color:
Colors
.
white
,
child:
ListView
(
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
children:
<
Widget
>[
Container
(
alignment:
Alignment
.
topLeft
,
margin:
EdgeInsets
.
only
(
top:
23
,
left:
15
,
bottom:
8
),
child:
baseText
(
"价格区间:"
,
13
,
Color
(
0xff666666
)),
),
),
Positioned
(
top:
54.5
,
left:
15
,
child:
StreamBuilder
(
stream:
lowLive
.
stream
,
initialData:
lowLive
.
data
??
"¥
${widget.low}
"
,
builder:
(
c
,
data
)
{
return
baseText
(
"
${data.data}
"
,
12
,
Color
(
0xff3FB5AF
));
},
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
67
,
child:
Stack
(
children:
<
Widget
>[
Positioned
(
top:
8.5
,
right:
15
,
child:
StreamBuilder
(
stream:
highLive
.
stream
,
initialData:
highLive
.
data
??
(
widget
.
high
>=
19600
?
"无限"
:
"
${widget.high}
"
),
builder:
(
c
,
data
)
{
return
baseText
(
"
${data.data}
"
,
12
,
Color
(
0xff3FB5AF
));
},
),
),
Positioned
(
top:
8.5
,
left:
15
,
child:
StreamBuilder
(
stream:
lowLive
.
stream
,
initialData:
lowLive
.
data
??
"¥
${widget.low}
"
,
builder:
(
c
,
data
)
{
return
baseText
(
"
${data.data}
"
,
12
,
Color
(
0xff3FB5AF
));
},
),
),
Positioned
(
bottom:
0
,
left:
0
,
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
child:
PlanProgressBar
(
widget
.
low
,
widget
.
high
,
0
,
20010
,
widget
.
call
,
lowLive
,
highLive
,
padding:
15
,
),
),
),
],
),
),
Container
(
height:
28
,
),
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
0.5
,
color:
Color
(
0xff51CDC7
),
),
),
Positioned
(
top:
25
,
left:
15
,
child:
baseText
(
"价格区间:"
,
13
,
Color
(
0xff666666
)),
),
Positioned
(
bottom:
0
,
child:
Container
(
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
44.5
,
child:
Row
(
...
...
@@ -121,34 +145,111 @@ class FilterViewState extends State<FilterView> {
],
),
),
),
Positioned
(
bottom:
44.5
,
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
0.5
,
color:
Color
(
0xff51CDC7
),
),
),
Positioned
(
bottom:
74.5
,
left:
0
,
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
child:
PlanProgressBar
(
widget
.
low
,
widget
.
high
,
0
,
20010
,
widget
.
call
,
lowLive
,
highLive
,
padding:
15
,
),
),
),
],
),
);
],
));
// return Container(
// color: Colors.white,
// height: 186,
// child: Column(
// children: <Widget>[
//
// ],
// )
//// Stack(
//// children: <Widget>[
////// Positioned(
////// top: 0,
////// child: Container(
////// width: MediaQuery.of(context).size.width,
////// height: 6,
////// child: Image.asset("assets/shadow.png"),
////// ),
////// ),
//// Positioned(
//// top: 54.5,
//// right: 15,
//// child: StreamBuilder(
//// stream: highLive.stream,
//// initialData: highLive.data ??
//// (widget.high >= 19600 ? "无限" : "${widget.high}"),
//// builder: (c, data) {
//// return baseText("${data.data}", 12, Color(0xff3FB5AF));
//// },
//// ),
//// ),
//// Positioned(
//// top: 54.5,
//// left: 15,
//// child: StreamBuilder(
//// stream: lowLive.stream,
//// initialData: lowLive.data ?? "¥${widget.low}",
//// builder: (c, data) {
//// return baseText("${data.data}", 12, Color(0xff3FB5AF));
//// },
//// ),
//// ),
//// Positioned(
//// top: 25,
//// left: 15,
//// child: baseText("价格区间:", 13, Color(0xff666666)),
//// ),
//// Positioned(
//// bottom: 0,
//// child: Container(
//// width: MediaQuery.of(context).size.width,
//// height: 44.5,
//// child: Row(
//// children: <Widget>[
//// Expanded(
//// child: Container(
//// child: baseText("重置", 16, Color(0xff3FB5AF)),
//// alignment: Alignment.center,
//// ).gestureDetector(() {
//// SimpleEventBus.instance()
//// .notifyListener("FilterViewState", "reset");
//// }),
//// ),
//// Expanded(
//// child: Container(
//// color: Color(0xff3FB5AF),
//// alignment: Alignment.center,
//// child: baseText("确定", 16, Colors.white),
//// ).gestureDetector(() {
//// SimpleEventBus.instance()
//// .notifyListener("PlanProgressBarState", "sure");
//// }),
//// )
//// ],
//// ),
//// ),
//// ),
//// Positioned(
//// bottom: 44.5,
//// child: Container(
//// width: MediaQuery.of(context).size.width,
//// height: 0.5,
//// color: Color(0xff51CDC7),
//// ),
//// ),
//// Positioned(
//// bottom: 74.5,
//// left: 0,
//// child: Container(
//// width: MediaQuery.of(context).size.width,
//// child: PlanProgressBar(
//// widget.low,
//// widget.high,
//// 0,
//// 20010,
//// widget.call,
//// lowLive,
//// highLive,
//// padding: 15,
//// ),
//// ),
//// ),
//// ],
//// ),
// );
}
}
lib/ClueModel/page/plan/PlanModel.dart
View file @
fb0001a3
...
...
@@ -8,7 +8,6 @@ import 'package:flutter/foundation.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/ClueModel/page/plan/PlanModelInstance.dart'
;
import
'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanBean.dart'
;
...
...
@@ -18,6 +17,7 @@ import 'package:gm_flutter/commonModel/bean/Pair.dart';
import
'package:gm_flutter/commonModel/cache/CacheManager.dart'
;
import
'package:gm_flutter/commonModel/eventbus/SimpleEventBus.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.dart'
;
import
'package:gm_flutter/commonModel/util/NativeToast.dart'
;
import
'package:gm_flutter/commonModel/util/PrintUtil.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
...
...
@@ -43,7 +43,7 @@ class PlanModel extends BaseModel {
String
tag_id
=
"0"
;
String
order_by
=
""
;
String
min_price
=
"
0
"
;
String
min_price
=
""
;
String
max_price
=
"100000000"
;
int
low
=
0
;
int
high
=
20100
;
...
...
@@ -95,7 +95,7 @@ class PlanModel extends BaseModel {
sortList
=
event
.
data
.
orders
;
order_by
=
"
${sortList[0].id}
"
;
PlanModelInstance
.
getInstance
().
order_by
=
order_by
;
min_price
=
"
0
"
;
min_price
=
""
;
max_price
=
"100000000"
;
PlanModelInstance
.
getInstance
().
min_price
=
min_price
;
PlanModelInstance
.
getInstance
().
max_price
=
max_price
;
...
...
lib/ClueModel/page/top/TopListModel.dart
View file @
fb0001a3
...
...
@@ -4,12 +4,12 @@
**/
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanFeedBean.dart'
;
import
'package:gm_flutter/commonModel/GMBase.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.dart'
;
import
'package:gm_flutter/commonModel/util/NativeToast.dart'
;
import
'package:gm_flutter/commonModel/util/PrintUtil.dart'
;
class
TopListModel
extends
BaseModel
{
...
...
lib/ClueModel/page/top/TopModel.dart
View file @
fb0001a3
...
...
@@ -6,12 +6,12 @@ import 'package:dio/dio.dart';
import
'package:flutter/cupertino.dart'
;
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanBarBean.dart'
;
import
'package:gm_flutter/commonModel/GMBase.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.dart'
;
import
'package:gm_flutter/commonModel/util/NativeToast.dart'
;
import
'package:gm_flutter/commonModel/util/PrintUtil.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
...
...
lib/MainRouter/MainRouter.dart
View file @
fb0001a3
...
...
@@ -25,4 +25,6 @@ abstract class MainRouter extends RouterBaser {
bool
isWithNative
();
void
jumpToSetting
();
void
showToast
(
String
text
);
}
lib/MainRouter/MainRouterImpl.dart
View file @
fb0001a3
...
...
@@ -52,4 +52,9 @@ class MainRouterImpl implements MainRouter {
void
jumpToSetting
()
{
MainManager
.
getInstance
().
jumpToSetting
();
}
@override
void
showToast
(
String
text
)
{
MainManager
.
getInstance
().
showToast
(
text
);
}
}
lib/MainRouter/manager/MainManager.dart
View file @
fb0001a3
...
...
@@ -7,6 +7,8 @@ import 'dart:async';
import
'package:dio/dio.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_boost/flutter_boost.dart'
;
import
'package:flutter_common/commonModel/toast/NativeToastUtil.dart'
;
import
'package:flutter_common/commonModel/toast/toast.dart'
;
import
'package:gm_flutter/commonModel/GMBase.dart'
;
import
'package:gm_flutter/commonModel/base/BaseUtil.dart'
;
import
'package:gm_flutter/commonModel/cache/CacheManager.dart'
;
...
...
@@ -126,4 +128,12 @@ class MainManager {
flutterChannel
.
invokeMethod
(
"check_system_settings"
,
""
);
}
}
void
showToast
(
String
text
)
{
if
(
isInit
)
{
flutterChannel
.
invokeMethod
(
"toast_message"
,
text
);
}
else
{
NativeToastUtil
.
showNativeToast
(
text
);
}
}
}
lib/commonModel/util/NativeToast.dart
0 → 100644
View file @
fb0001a3
/*
* @author lsy
* @date 2020/5/8
**/
import
'package:flutter/material.dart'
;
import
'package:fluttertoast/fluttertoast.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
class
NativeToast
{
static
int
lastTime
;
static
String
lastWorld
;
static
void
showNativeToast
(
String
text
)
{
showNativeToastWithTime
(
text
,
false
);
}
static
void
showNativeToastWithTime
(
String
text
,
bool
long
)
{
if
(
text
==
null
)
{
text
=
"null"
;
}
if
(
lastTime
!=
null
&&
lastWorld
!=
null
&&
DateTime
.
now
().
millisecondsSinceEpoch
-
lastTime
<
1000
&&
lastWorld
==
text
)
{
return
;
}
lastTime
=
DateTime
.
now
().
millisecondsSinceEpoch
;
lastWorld
=
text
;
RouterCenterImpl
().
findMainRouter
().
showToast
(
text
);
}
}
lib/commonModel/util/PrintUtil.dart
View file @
fb0001a3
...
...
@@ -2,8 +2,8 @@
* @author lsy
* @date 2020/5/22
**/
import
'package:flutter_common/commonModel/toast/NativeToast.dart'
;
import
'package:flutter_common/commonModel/toast/toast.dart'
;
import
'NativeToast.dart'
;
class
PrintUtil
{
static
void
printBug
(
err
)
{
...
...
pubspec.lock
View file @
fb0001a3
...
...
@@ -264,8 +264,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "
8175a0900ac0244040289488b86c5a98c45b0e94
"
resolved-ref: "
8175a0900ac0244040289488b86c5a98c45b0e94
"
ref: "
9f27f75fb103fc194744d8ec9c321f57edb8f836
"
resolved-ref: "
9f27f75fb103fc194744d8ec9c321f57edb8f836
"
url: "https://github.com/asd451398533/flutter_common.git"
source: git
version: "0.0.1"
...
...
pubspec.yaml
View file @
fb0001a3
...
...
@@ -17,7 +17,7 @@ dependencies:
flutter_common
:
git
:
url
:
"
https://github.com/asd451398533/flutter_common.git"
ref
:
"
8175a0900ac0244040289488b86c5a98c45b0e94
"
ref
:
"
9f27f75fb103fc194744d8ec9c321f57edb8f836
"
#网络库
dio
:
^3.0.0
dio_cookie_manager
:
^1.0.0
...
...
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