Commit 0b5e9a0d authored by jinzhu's avatar jinzhu

优化 意见与建议页面

parent f9957c52
......@@ -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.spaceBetween,
mainAxisAlignment: MainAxisAlignment.start,
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: 40,
margin: EdgeInsets.only(left: 30, right: 30, top: 30),
padding: EdgeInsets.only(bottom: 10),
height: 30,
margin: EdgeInsets.only(left: 30, right: 30, top: 40),
// 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(30),
margin: EdgeInsets.only(left: 30, right: 30, top: 90),
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: (){
},)
]
));
}
}
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 _) {
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment