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
26a89835
Commit
26a89835
authored
May 20, 2019
by
jinzhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
6582f33b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
28 deletions
+19
-28
comment_suggest.dart
lib/comment_suggest.dart
+13
-16
main.dart
lib/main.dart
+2
-11
DioUtil.dart
lib/netWork/DioUtil.dart
+4
-1
No files found.
lib/comment_suggest.dart
View file @
26a89835
...
...
@@ -9,12 +9,10 @@
import
'package:dio/dio.dart'
;
import
'package:flutter_boost/flutter_boost.dart'
;
import
'package:flutter/material.dart'
;
import
'package:gmalpha_flutter/netWork/DioUtil.dart'
as
prefix0
;
import
'macros/ALColors.dart'
import
'macros/ALColors.dart'
;
import
'macros/ALDevice.dart'
;
import
'netWork/DioUtil.dart'
;
class
CommentSuggest
extends
StatelessWidget
{
final
Map
params
;
CommentSuggest
(
this
.
params
);
...
...
@@ -27,7 +25,7 @@ class CommentSuggest extends StatelessWidget {
theme:
ThemeData
(
splashColor:
Colors
.
white10
,
//水波纹的颜色
),
home:
CommentSuggestPage
(
title:
'意见和建议'
,
nativeCookie:
this
.
params
),
home:
CommentSuggestPage
(
nativeCookie:
this
.
params
,
title:
'意见与建议'
,)
);
}
}
...
...
@@ -35,9 +33,10 @@ class CommentSuggest extends StatelessWidget {
class
CommentSuggestPage
extends
StatefulWidget
{
final
String
title
;
final
String
content
;
final
String
tel
;
final
Map
nativeCookie
;
CommentSuggestPage
({
Key
key
,
this
.
title
,
this
.
nativeCookie
})
:
super
(
key:
key
);
@override
_CommentSuggestPageState
createState
()
=>
_CommentSuggestPageState
();
}
...
...
@@ -50,20 +49,13 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
// backgroundColor: ALColors.ColorFFFFFF,
backgroundColor:
Colors
.
white10
,
leading:
new
GestureDetector
(
child:
new
Icon
(
Icons
.
keyboard_backspace
),
onTap:
()
{
FlutterBoost
.
singleton
.
closePageForContext
(
context
);
}),
title:
this
.
title
,
style:
TextStyle
(
color:
ALColors
.
Color323232
,
fontSize:
16
,
fontWeight:
FontWeight
.
bold
),
),
title:
new
Text
(
widget
.
title
),
),
body:
Container
(
height:
ALDevice
.
height
,
...
...
@@ -151,11 +143,16 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
}
void
confimSuggestInfo
()
{
print
(
'11111111----come----confimSuggestInfo'
);
BaseOptions
options
=
DioUtil
.
getDefOptions
();
HttpConfig
config
=
new
HttpConfig
(
options:
options
,
nativeCookie:
this
.
);
HttpConfig
config
=
new
HttpConfig
(
options:
options
,
nativeCookie:
widget
.
nativeCookie
);
DioUtil
().
setConfig
(
config
);
print
(
'aaaaaaaa----come----config'
);
print
(
config
.
nativeCookie
);
print
(
'bbbb----come----cookie'
);
print
(
widget
.
nativeCookie
);
DioUtil
().
requestR
(
Method
.
post
,
"
/
api/v1/suggestion"
,
data:
{
"content"
:
"add"
,
"phone"
:
"aaa"
}).
then
((
res
){
DioUtil
().
requestR
(
Method
.
post
,
"api/v1/suggestion"
,
data:
{
"content"
:
"add"
,
"phone"
:
"aaa"
}).
then
((
res
){
showAlertDialog
(
context
,
res
.
data
);
}
).
then
((
error
){
...
...
lib/main.dart
View file @
26a89835
...
...
@@ -22,7 +22,7 @@ class _MyAppState extends State<MyApp> {
'second'
:
(
pageName
,
params
,
_
)
=>
SecondRouteWidget
(),
'tab'
:
(
pageName
,
params
,
_
)
=>
TabRouteWidget
(),
'flutterFragment'
:
(
pageName
,
params
,
_
)
=>
FragmentRouteWidget
(
params
),
'comment_suggest'
:
(
pageName
,
params
,
_
)
=>
CommentSuggest
(
params
),
'comment_suggest'
:
(
pageName
,
params
,
_
)
=>
CommentSuggest
(
params
),
///可以在native层通过 getContainerParams 来传递参数
'flutterPage'
:
(
pageName
,
params
,
_
)
{
...
...
@@ -39,15 +39,6 @@ class _MyAppState extends State<MyApp> {
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
locale:
Locale
(
'en'
,
'US'
),
// locale: Locale('zh', 'CN'),
// localeResolutionCallback: (Locale locale, Iterable<Locale> supportedLocales) {
// return Locale('en', 'US');
// },
// localizationsDelegates: [
// NinghaoDemoLocalizationsDelegate(),
// GlobalMaterialLocalizations.delegate,
// GlobalWidgetsLocalizations.delegate,
// ],
supportedLocales:
[
Locale
(
'en'
,
'US'
),
Locale
(
'zh'
,
'CN'
),
...
...
@@ -56,7 +47,7 @@ class _MyAppState extends State<MyApp> {
// home: NavigatorDemo(),
initialRoute:
'/test'
,
routes:
{
'/'
:
(
context
)
=>
CommentSuggest
(),
'/'
:
(
context
)
=>
CommentSuggest
(
{
'cookie'
:
'124'
}
),
},
theme:
ThemeData
(
primarySwatch:
Colors
.
yellow
,
...
...
lib/netWork/DioUtil.dart
View file @
26a89835
...
...
@@ -67,6 +67,7 @@ class HttpConfig {
this
.
pem
,
this
.
pKCSPath
,
this
.
pKCSPwd
,
this
.
nativeCookie
,
});
/// BaseResp [String status]字段 key, 默认:status.
...
...
@@ -95,6 +96,8 @@ class HttpConfig {
/// 详细使用请查看dio官网 https://github.com/flutterchina/dio/blob/flutter/README-ZH.md#Https证书校验.
/// PKCS12 证书密码.
String
pKCSPwd
;
//缓存
Map
nativeCookie
;
}
/// 单例 DioUtil.
...
...
@@ -403,7 +406,7 @@ class DioUtil {
options
.
connectTimeout
=
10
*
1000
;
options
.
receiveTimeout
=
20
*
1000
;
options
.
contentType
=
ContentType
.
parse
(
'application/x-www-form-urlencoded'
);
options
.
baseUrl
=
'http
s://earth.iyanzhi.com
'
;
options
.
baseUrl
=
'http
://earth.igengmei.com/
'
;
Map
<
String
,
dynamic
>
headers
=
Map
<
String
,
dynamic
>();
headers
[
'Accept'
]
=
'application/json'
;
return
options
;
...
...
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