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
You need to sign in or sign up before continuing.
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 {
...
@@ -22,7 +22,7 @@ class CommentSuggest extends StatelessWidget {
return
MaterialApp
(
return
MaterialApp
(
debugShowCheckedModeBanner:
false
,
debugShowCheckedModeBanner:
false
,
title:
'意见与建议'
,
title:
'意见与建议'
,
color:
ALColors
.
Color323232
,
color:
Color
(
0xFFffffff
)
,
theme:
ThemeData
(
theme:
ThemeData
(
splashColor:
Colors
.
white10
,
//水波纹的颜色
splashColor:
Colors
.
white10
,
//水波纹的颜色
),
),
...
@@ -50,27 +50,31 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
...
@@ -50,27 +50,31 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
Scaffold
(
appBar:
AppBar
(
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
(
leading:
new
GestureDetector
(
child:
new
Icon
(
Icons
.
keyboard_backspace
),
child:
new
ImageIcon
(
AssetImage
(
'images/nav_back.png'
),
color:
ALColors
.
Color323232
,
),
onTap:
()
{
onTap:
()
{
FlutterBoost
.
singleton
.
closePageForContext
(
context
);
FlutterBoost
.
singleton
.
closePageForContext
(
context
);
}),
}),
title:
new
Text
(
widget
.
title
),
),
),
body:
Container
(
body:
new
SingleChildScrollView
(
height:
ALDevice
.
height
,
width:
ALDevice
.
width
,
child:
Center
(
child:
Center
(
child:
Column
(
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
s
paceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
s
tart
,
children:
<
Widget
>[
children:
<
Widget
>[
Container
(
Container
(
alignment:
Alignment
.
topCenter
,
alignment:
Alignment
.
topCenter
,
margin:
margin:
EdgeInsets
.
only
(
left:
30
,
top:
42
,
right:
30
,
bottom:
0
),
EdgeInsets
.
only
(
left:
30
,
top:
50
,
right:
30
,
bottom:
0
),
height:
215
,
height:
215
,
width:
ALDevice
.
width
,
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
border:
Border
.
all
(
color:
ALColors
.
ColorC4C4C4
,
width:
1
),
border:
Border
.
all
(
color:
ALColors
.
ColorC4C4C4
,
width:
1
),
),
),
...
@@ -91,11 +95,11 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
...
@@ -91,11 +95,11 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
),
),
),
),
Container
(
Container
(
height:
4
0
,
height:
3
0
,
margin:
EdgeInsets
.
only
(
left:
30
,
right:
30
,
top:
3
0
),
margin:
EdgeInsets
.
only
(
left:
30
,
right:
30
,
top:
4
0
),
padding:
EdgeInsets
.
only
(
bottom:
10
),
//
padding: EdgeInsets.only(bottom: 10),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
border:
Border
(
border:
Border
(
bottom:
BorderSide
(
color:
ALColors
.
ColorC4C4C4
),
bottom:
BorderSide
(
color:
ALColors
.
ColorC4C4C4
),
)),
)),
alignment:
Alignment
.
centerLeft
,
alignment:
Alignment
.
centerLeft
,
...
@@ -118,7 +122,7 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
...
@@ -118,7 +122,7 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
border:
border:
Border
.
all
(
color:
ALColors
.
Color323232
,
width:
1.5
)),
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
),
padding:
EdgeInsets
.
all
(
0
),
constraints:
constraints:
BoxConstraints
(
minWidth:
ALDevice
.
width
,
minHeight:
45
),
BoxConstraints
(
minWidth:
ALDevice
.
width
,
minHeight:
45
),
...
@@ -144,18 +148,14 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
...
@@ -144,18 +148,14 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
}
}
void
confimSuggestInfo
()
{
void
confimSuggestInfo
()
{
print
(
'11111111----come----confimSuggestInfo'
);
BaseOptions
options
=
DioUtil
.
getDefOptions
();
BaseOptions
options
=
DioUtil
.
getDefOptions
();
final
cookie
=
new
Map
<
String
,
dynamic
>.
from
(
widget
.
nativeCookie
);
final
cookie
=
new
Map
<
String
,
dynamic
>.
from
(
widget
.
nativeCookie
);
HttpConfig
config
=
new
HttpConfig
(
options:
options
,
nativeCookie:
cookie
);
HttpConfig
config
=
new
HttpConfig
(
options:
options
,
nativeCookie:
cookie
);
DioUtil
.
openDebug
();
DioUtil
.
openDebug
();
DioUtil
().
setConfig
(
config
);
DioUtil
().
setConfig
(
config
);
print
(
'aaaaaaaa----come----config'
);
String
content
=
(
this
.
opinionCtrl
.
text
.
length
>
0
)?
this
.
opinionCtrl
.
text
:
''
;
print
(
config
.
nativeCookie
);
String
phone
=
(
this
.
telCtrl
.
text
.
length
>
0
)?
this
.
telCtrl
.
text
:
''
;
print
(
'bbbb----come----cookie'
);
DioUtil
().
requestR
(
Method
.
post
,
"api/v1/suggestion"
,
data:
{
"content"
:
content
,
"phone"
:
phone
}).
then
((
res
){
print
(
widget
.
nativeCookie
);
DioUtil
().
requestR
(
Method
.
post
,
"api/v1/suggestion"
,
data:
{
"content"
:
"add"
,
"phone"
:
"aaa"
}).
then
((
res
){
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
Toast
.
show
(
context
,
'请求成功'
);
Toast
.
show
(
context
,
'请求成功'
);
}
else
{
}
else
{
...
@@ -167,23 +167,5 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
...
@@ -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/material.dart'
;
import
'package:flutter_boost/flutter_boost.dart'
;
import
'package:flutter_boost/flutter_boost.dart'
;
import
'package:gmalpha_flutter/macros/ALColors.dart'
;
import
'simple_page_widgets.dart'
;
import
'simple_page_widgets.dart'
;
import
'comment_suggest.dart'
;
import
'comment_suggest.dart'
;
...
@@ -27,7 +28,6 @@ class _MyAppState extends State<MyApp> {
...
@@ -27,7 +28,6 @@ class _MyAppState extends State<MyApp> {
///可以在native层通过 getContainerParams 来传递参数
///可以在native层通过 getContainerParams 来传递参数
'flutterPage'
:
(
pageName
,
params
,
_
)
{
'flutterPage'
:
(
pageName
,
params
,
_
)
{
print
(
"flutterPage params:
$params
"
);
print
(
"flutterPage params:
$params
"
);
return
FlutterRouteWidget
();
return
FlutterRouteWidget
();
},
},
});
});
...
@@ -39,32 +39,27 @@ class _MyAppState extends State<MyApp> {
...
@@ -39,32 +39,27 @@ class _MyAppState extends State<MyApp> {
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
return
MaterialApp
(
title:
'Flutter Boost example'
,
title:
'Flutter Boost example'
,
debugShowCheckedModeBanner:
false
,
initialRoute:
'/test'
,
//调试的时候可以打开
routes:
{
'/'
:
(
context
)
=>
CommentSuggest
({
'cookie'
:
'124'
}),
},
//调试的时候可以打开
builder:
FlutterBoost
.
init
(
postPush:
_onRoutePushed
),
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
(
void
_onRoutePushed
(
String
pageName
,
String
uniqueId
,
Map
params
,
Route
route
,
Future
_
)
{
String
pageName
,
String
uniqueId
,
Map
params
,
Route
route
,
Future
_
)
{
...
...
pubspec.yaml
View file @
0b5e9a0d
...
@@ -49,10 +49,8 @@ flutter:
...
@@ -49,10 +49,8 @@ flutter:
# To add Flutter specific assets to your application, add an assets section,
# To add Flutter specific assets to your application, add an assets section,
# like this:
# like this:
# assets:
assets
:
# - images/a_dot_burr.jpeg
-
images/nav_back.png
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.io/assets-and-images/#resolution-aware.
# 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