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
9426b40d
Commit
9426b40d
authored
Jul 16, 2019
by
jinzhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
a19a09de
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
33 deletions
+26
-33
main.dart
lib/main.dart
+2
-26
DioUtil.dart
lib/netWork/DioUtil.dart
+5
-5
message_home.dart
lib/pages/message/home/message_home.dart
+19
-2
No files found.
lib/main.dart
View file @
9426b40d
...
...
@@ -25,7 +25,7 @@ class _MyAppState extends State<MyApp> {
FlutterBoost
.
singleton
.
registerPageBuilders
({
'comment_suggest'
:
(
pageName
,
params
,
_
)
=>
CommentSuggest
(
params
),
'message_home'
:
(
pageName
,
params
,
_
)
=>
MessageHomePage
(),
'message_home'
:
(
pageName
,
params
,
_
)
=>
MessageHomePage
(
params
),
});
FlutterBoost
.
handleOnStartPage
();
}
...
...
@@ -44,7 +44,7 @@ class _MyAppState extends State<MyApp> {
initialRoute:
'/test'
,
//调试的时候可以打开
routes:
{
// '/': (context) => CommentSuggest({"Cookie":" _gm_token=7e48641558699683; sessionid=nb3ze4ur7ucosln8sd8pzwojddenv9ym; _gtid=a1bc0a387e1911e996b9525400fa516d4094"}),
'/'
:
(
context
)
=>
MessageHomePage
()
,
'/'
:
(
context
)
=>
MessageHomePage
(
{}
)
,
},
//调试的时候可以打开
builder:
FlutterBoost
.
init
(
postPush:
_onRoutePushed
),
theme:
new
ThemeData
(
...
...
@@ -65,29 +65,5 @@ class _MyAppState extends State<MyApp> {
void
_onRoutePushed
(
String
pageName
,
String
uniqueId
,
Map
params
,
Route
route
,
Future
_
)
{
// List<OverlayEntry> newEntries = route.overlayEntries
// .map((OverlayEntry entry) => OverlayEntry(
// builder: (BuildContext context) {
// final pageWidget = entry.builder(context);
// return Stack(
// children: <Widget>[
// pageWidget,
// Positioned(
// child: Text(
// "pageName:$pageName\npageWidget:${pageWidget.toStringShort()}",
// style: TextStyle(fontSize: 12.0, color: Colors.red),
// ),
// left: 8.0,
// top: 8.0,
// )
// ],
// );
// },
// opaque: entry.opaque,
// maintainState: entry.maintainState))
// .toList(growable: true);
//
// route.overlayEntries.clear();
// route.overlayEntries.addAll(newEntries);
}
}
lib/netWork/DioUtil.dart
View file @
9426b40d
...
...
@@ -179,11 +179,11 @@ class DioUtil {
if
(
_dio
!=
null
)
{
_dio
.
options
=
_options
;
(
_dio
.
httpClientAdapter
as
DefaultHttpClientAdapter
).
onHttpClientCreate
=
(
client
)
{
client
.
findProxy
=
(
url
)
{
return
_isDebug
?
'PROXY
$_proxy
'
:
'DIRECT'
;
};
};
//
(_dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (client) {
//
client.findProxy = (url) {
//
return _isDebug ? 'PROXY $_proxy' : 'DIRECT';
//
};
//
};
if
(
_pem
!=
null
)
{
// httpClientAdapter
(
_dio
.
httpClientAdapter
as
DefaultHttpClientAdapter
).
onHttpClientCreate
=
(
client
)
{
...
...
lib/pages/message/home/message_home.dart
View file @
9426b40d
import
'package:flutter/material.dart'
;
import
'package:dio/dio.dart'
;
// import 'package:gmalpha_flutter/model/message/message.dart' as prefix0;
import
'package:gmalpha_flutter/pages/message/home/message_notification_item.dart'
;
import
'message_item.dart'
;
...
...
@@ -8,16 +9,32 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
class
MessageHomePage
extends
StatefulWidget
{
final
Map
params
;
MessageHomePage
(
this
.
params
);
@override
_MessageHomePageState
createState
()
=>
_MessageHomePageState
();
_MessageHomePageState
createState
()
=>
_MessageHomePageState
(
params
);
}
class
_MessageHomePageState
extends
State
<
MessageHomePage
>
{
final
Map
nativeCookie
;
_MessageHomePageState
(
this
.
nativeCookie
);
List
<
ListItem
>
messageList
=
List
<
ListItem
>();
List
<
ListItem
>
dataArr
=
List
<
ListItem
>();
int
pageIndex
=
1
;
List
<
String
>
data1
=
[];
@override
void
initState
()
{
if
(
nativeCookie
.
keys
.
length
>
0
)
{
BaseOptions
options
=
DioUtil
.
getDefOptions
();
Map
<
String
,
dynamic
>
cookie
=
{
'cookie'
:
'_gm_token=4cabd51562739648; _gtid=fac513b6a2bf11e9acfd525400e5c7a38141; sessionid=7j7s902fmro0pvybwrp374khvva6l3xf;'
};
HttpConfig
config
=
new
HttpConfig
(
options:
options
,
nativeCookie:
cookie
);
DioUtil
().
setConfig
(
config
);
}
super
.
initState
();
}
RefreshController
_refreshController
=
RefreshController
(
initialRefresh:
true
);
...
...
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