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
f3eadb2c
Commit
f3eadb2c
authored
May 20, 2019
by
Q14
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aaa
parent
079d3247
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
30 deletions
+46
-30
comment_suggest.dart
lib/comment_suggest.dart
+45
-29
main.dart
lib/main.dart
+1
-1
No files found.
lib/comment_suggest.dart
View file @
f3eadb2c
...
...
@@ -6,18 +6,19 @@
// Copyright © 2019 Gengmei. All rights reserved.
// 意见与建议页面
import
'package:dio/dio.dart'
;
import
'package:flutter_boost/flutter_boost.dart'
;
import
'package:flutter/material.dart'
;
import
'macros/ALColors.dart'
;
import
'package:gmalpha_flutter/netWork/DioUtil.dart'
as
prefix0
;
import
'macros/ALColors.dart'
import
'macros/ALDevice.dart'
;
import
'netWork/ALNetWork.dart'
;
// import 'services/ALNetClient.dart';
// import 'hybrid_stack/hybrid_stack_manager_plugin.dart';
import
'netWork/DioUtil.dart'
;
class
CommentSuggest
extends
StatelessWidget
{
// RouterOption routeOption;
// Opinion(RouterOption option, {Key key}) : super(key: key) {
// routeOption = option;
// }
final
Map
params
;
CommentSuggest
(
this
.
params
);
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
debugShowCheckedModeBanner:
false
,
...
...
@@ -26,18 +27,17 @@ class CommentSuggest extends StatelessWidget {
theme:
ThemeData
(
splashColor:
Colors
.
white10
,
//水波纹的颜色
),
home:
CommentSuggestPage
(
title:
'意见和建议'
,
userId:
'123'
),
home:
CommentSuggestPage
(
title:
'意见和建议'
,
nativeCookie:
this
.
params
),
);
}
}
class
CommentSuggestPage
extends
StatefulWidget
{
CommentSuggestPage
({
Key
key
,
this
.
title
,
this
.
userId
,
this
.
content
,
this
.
tel
})
:
super
(
key:
key
);
final
String
title
;
final
String
userId
;
final
String
content
;
final
String
tel
;
final
Map
nativeCookie
;
@override
_CommentSuggestPageState
createState
()
=>
_CommentSuggestPageState
();
}
...
...
@@ -56,10 +56,9 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
leading:
new
GestureDetector
(
child:
new
Icon
(
Icons
.
keyboard_backspace
),
onTap:
()
{
// HybridStackManagerPlugin.hybridStackManagerPlugin.popCurPage(
);
FlutterBoost
.
singleton
.
closePageForContext
(
context
);
}),
title:
new
Text
(
"意见与建议"
,
title:
this
.
title
,
style:
TextStyle
(
color:
ALColors
.
Color323232
,
fontSize:
16
,
...
...
@@ -148,26 +147,43 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
void
confirmClick
()
{
confimSuggestInfo
();
print
(
'confirmClick'
);
}
void
confimSuggestInfo
()
{
ALNetwork
(
success:
(
NetworkSuccess
success
){
setState
(()
{
});
},
error:
(
NetworkError
error
){
setState
(()
{
});
},
api:
'/api/v1/suggestion'
,
params:
{
'content'
:
'aaa'
,
'phone'
:
'bbb'
}
);
BaseOptions
options
=
DioUtil
.
getDefOptions
();
HttpConfig
config
=
new
HttpConfig
(
options:
options
,
nativeCookie:
this
.);
DioUtil
().
setConfig
(
config
);
DioUtil
().
requestR
(
Method
.
post
,
"/api/v1/suggestion"
,
data:
{
"content"
:
"add"
,
"phone"
:
"aaa"
}).
then
((
res
){
showAlertDialog
(
context
,
res
.
data
);
}
).
then
((
error
){
print
(
error
);
});
}
void
showAlertDialog
(
BuildContext
context
,
Text
testStr
)
{
showDialog
(
context:
context
,
builder:
(
_
)
=>
new
AlertDialog
(
title:
testStr
,
content:
new
Text
(
"This is my content"
),
actions:
<
Widget
>[
new
FlatButton
(
child:
new
Text
(
"CANCEL"
),
onPressed:
(){
// Navigator.of(context).pop();
},),
new
FlatButton
(
child:
new
Text
(
"OK"
),
onPressed:
(){
// Navigator.of(context).pop();
},)
]
));
}
}
lib/main.dart
View file @
f3eadb2c
...
...
@@ -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
(),
'comment_suggest'
:
(
pageName
,
params
,
_
)
=>
CommentSuggest
(
params
),
///可以在native层通过 getContainerParams 来传递参数
'flutterPage'
:
(
pageName
,
params
,
_
)
{
...
...
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