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
0b5e9a0d
Commit
0b5e9a0d
authored
May 21, 2019
by
jinzhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化 意见与建议页面
parent
f9957c52
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
69 deletions
+44
-69
comment_suggest.dart
lib/comment_suggest.dart
+22
-40
main.dart
lib/main.dart
+20
-25
pubspec.yaml
pubspec.yaml
+2
-4
No files found.
lib/comment_suggest.dart
View file @
0b5e9a0d
...
...
@@ -22,7 +22,7 @@ class CommentSuggest extends StatelessWidget {
return
MaterialApp
(
debugShowCheckedModeBanner:
false
,
title:
'意见与建议'
,
color:
ALColors
.
Color323232
,
color:
Color
(
0xFFffffff
)
,
theme:
ThemeData
(
splashColor:
Colors
.
white10
,
//水波纹的颜色
),
...
...
@@ -50,27 +50,31 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
backgroundColor:
Colors
.
white10
,
backgroundColor:
Color
(
0xFFffffff
),
title:
Text
(
'意见与建议'
,
style:
new
TextStyle
(
fontSize:
16.0
,
color:
ALColors
.
Color323232
),
),
elevation:
0
,
brightness:
Brightness
.
light
,
leading:
new
GestureDetector
(
child:
new
Icon
(
Icons
.
keyboard_backspace
),
child:
new
ImageIcon
(
AssetImage
(
'images/nav_back.png'
),
color:
ALColors
.
Color323232
,
),
onTap:
()
{
FlutterBoost
.
singleton
.
closePageForContext
(
context
);
}),
title:
new
Text
(
widget
.
title
),
),
body:
Container
(
height:
ALDevice
.
height
,
width:
ALDevice
.
width
,
body:
new
SingleChildScrollView
(
child:
Center
(
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
s
paceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
s
tart
,
children:
<
Widget
>[
Container
(
alignment:
Alignment
.
topCenter
,
margin:
EdgeInsets
.
only
(
left:
30
,
top:
42
,
right:
30
,
bottom:
0
),
EdgeInsets
.
only
(
left:
30
,
top:
50
,
right:
30
,
bottom:
0
),
height:
215
,
width:
ALDevice
.
width
,
decoration:
BoxDecoration
(
border:
Border
.
all
(
color:
ALColors
.
ColorC4C4C4
,
width:
1
),
),
...
...
@@ -91,11 +95,11 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
),
),
Container
(
height:
4
0
,
margin:
EdgeInsets
.
only
(
left:
30
,
right:
30
,
top:
3
0
),
padding:
EdgeInsets
.
only
(
bottom:
10
),
height:
3
0
,
margin:
EdgeInsets
.
only
(
left:
30
,
right:
30
,
top:
4
0
),
//
padding: EdgeInsets.only(bottom: 10),
decoration:
BoxDecoration
(
border:
Border
(
border:
Border
(
bottom:
BorderSide
(
color:
ALColors
.
ColorC4C4C4
),
)),
alignment:
Alignment
.
centerLeft
,
...
...
@@ -118,7 +122,7 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
decoration:
BoxDecoration
(
border:
Border
.
all
(
color:
ALColors
.
Color323232
,
width:
1.5
)),
margin:
EdgeInsets
.
all
(
3
0
),
margin:
EdgeInsets
.
only
(
left:
30
,
right:
30
,
top:
9
0
),
padding:
EdgeInsets
.
all
(
0
),
constraints:
BoxConstraints
(
minWidth:
ALDevice
.
width
,
minHeight:
45
),
...
...
@@ -144,18 +148,14 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
}
void
confimSuggestInfo
()
{
print
(
'11111111----come----confimSuggestInfo'
);
BaseOptions
options
=
DioUtil
.
getDefOptions
();
final
cookie
=
new
Map
<
String
,
dynamic
>.
from
(
widget
.
nativeCookie
);
HttpConfig
config
=
new
HttpConfig
(
options:
options
,
nativeCookie:
cookie
);
DioUtil
.
openDebug
();
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
){
String
content
=
(
this
.
opinionCtrl
.
text
.
length
>
0
)?
this
.
opinionCtrl
.
text
:
''
;
String
phone
=
(
this
.
telCtrl
.
text
.
length
>
0
)?
this
.
telCtrl
.
text
:
''
;
DioUtil
().
requestR
(
Method
.
post
,
"api/v1/suggestion"
,
data:
{
"content"
:
content
,
"phone"
:
phone
}).
then
((
res
){
if
(
res
.
code
==
0
)
{
Toast
.
show
(
context
,
'请求成功'
);
}
else
{
...
...
@@ -167,23 +167,5 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
});
}
void
showAlertDialog
(
BuildContext
context
,
String
textStr
)
{
showDialog
(
context:
context
,
builder:
(
_
)
=>
new
AlertDialog
(
title:
new
Text
(
textStr
),
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:
(){
},)
]
));
}
}
lib/main.dart
View file @
0b5e9a0d
import
'package:flutter/material.dart'
;
import
'package:flutter_boost/flutter_boost.dart'
;
import
'package:gmalpha_flutter/macros/ALColors.dart'
;
import
'simple_page_widgets.dart'
;
import
'comment_suggest.dart'
;
...
...
@@ -27,7 +28,6 @@ class _MyAppState extends State<MyApp> {
///可以在native层通过 getContainerParams 来传递参数
'flutterPage'
:
(
pageName
,
params
,
_
)
{
print
(
"flutterPage params:
$params
"
);
return
FlutterRouteWidget
();
},
});
...
...
@@ -39,32 +39,27 @@ class _MyAppState extends State<MyApp> {
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
title:
'Flutter Boost example'
,
debugShowCheckedModeBanner:
false
,
initialRoute:
'/test'
,
//调试的时候可以打开
routes:
{
'/'
:
(
context
)
=>
CommentSuggest
({
'cookie'
:
'124'
}),
},
//调试的时候可以打开
builder:
FlutterBoost
.
init
(
postPush:
_onRoutePushed
),
home:
Container
());
theme:
new
ThemeData
(
primaryColor:
Colors
.
white
,
backgroundColor:
Color
(
0xFFEFEFEF
),
accentColor:
Color
(
0xFF888888
),
textTheme:
TextTheme
(
//设置Material的默认字体样式
body1:
TextStyle
(
color:
Color
(
0xFF888888
),
fontSize:
16.0
),
),
iconTheme:
IconThemeData
(
color:
Color
(
0xFFEFEFEF
),
size:
35.0
,
),
),
);
}
// @override
// Widget build(BuildContext context) {
// return MaterialApp(
// locale: Locale('en', 'US'),
// supportedLocales: [
// Locale('en', 'US'),
// Locale('zh', 'CN'),
// ],
// debugShowCheckedModeBanner: false,
// // home: NavigatorDemo(),
// initialRoute: '/test',
// routes: {
// '/': (context) => CommentSuggest({'cookie': '124'}),
// },
// builder: FlutterBoost.init(postPush: _onRoutePushed),
// theme: ThemeData(
// primarySwatch: Colors.yellow,
// highlightColor: Color.fromRGBO(255, 255, 255, 0.5),
// splashColor: Colors.white70,
// accentColor: Color.fromRGBO(3, 54, 255, 1.0),
// )
// );
// }
void
_onRoutePushed
(
String
pageName
,
String
uniqueId
,
Map
params
,
Route
route
,
Future
_
)
{
...
...
pubspec.yaml
View file @
0b5e9a0d
...
...
@@ -49,10 +49,8 @@ flutter:
# To add Flutter specific assets to your application, add an assets section,
# like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
assets
:
-
images/nav_back.png
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.io/assets-and-images/#resolution-aware.
...
...
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