Skip to content

Commit 370df87

Browse files
committed
修复输入框挤压问题
1 parent e798b2b commit 370df87

File tree

1 file changed

+88
-86
lines changed

1 file changed

+88
-86
lines changed

lib/widget/IssueEditDIalog.dart

Lines changed: 88 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class IssueEditDialog extends StatefulWidget {
3232
}
3333

3434
class _IssueEditDialogState extends State<IssueEditDialog> {
35-
3635
_IssueEditDialogState();
3736

3837
///标题输入框
@@ -84,99 +83,102 @@ class _IssueEditDialogState extends State<IssueEditDialog> {
8483
Widget build(BuildContext context) {
8584
return new Scaffold(
8685
backgroundColor: Colors.transparent,
87-
body: new Container(
88-
height: MediaQuery.of(context).size.height,
89-
width: MediaQuery.of(context).size.width,
90-
color: Colors.black12,
91-
///触摸收起键盘
92-
child: new GestureDetector(
93-
behavior: HitTestBehavior.translucent,
94-
onTap: () {
95-
FocusScope.of(context).requestFocus(new FocusNode());
96-
},
97-
child: new Center(
98-
child: new GSYCardItem(
99-
margin: EdgeInsets.only(left:50.0, right: 50.0),
100-
shape: new RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))),
101-
child: new Padding(
102-
padding: new EdgeInsets.all(12.0),
103-
child: new Column(
104-
mainAxisSize: MainAxisSize.min,
105-
children: <Widget>[
106-
///dialog标题
107-
new Padding(
108-
padding: new EdgeInsets.only(top: 5.0, bottom: 15.0),
109-
child: new Center(
110-
child: new Text(widget.dialogTitle, style: GSYConstant.normalTextBold),
111-
)),
112-
113-
///标题输入框
114-
renderTitleInput(),
115-
116-
///内容输入框
117-
new Container(
118-
height: MediaQuery.of(context).size.width * 3 / 4,
119-
decoration: new BoxDecoration(
120-
borderRadius: BorderRadius.all(Radius.circular(4.0)),
121-
color: Color(GSYColors.white),
122-
border: new Border.all(color: Color(GSYColors.subTextColor), width: .3),
123-
),
124-
padding: new EdgeInsets.only(left: 20.0, top: 12.0, right: 20.0, bottom: 12.0),
125-
child: new Column(
126-
children: <Widget>[
127-
new Expanded(
128-
child: new TextField(
129-
autofocus: false,
130-
maxLines: 999,
131-
onChanged: widget.onContentChanged,
132-
controller: widget.valueController,
133-
decoration: new InputDecoration.collapsed(
134-
hintText: CommonUtils.getLocale(context).issue_edit_issue_title_tip,
135-
hintStyle: GSYConstant.middleSubText,
136-
),
137-
style: GSYConstant.middleText,
138-
),
86+
body: SafeArea(
87+
child: SingleChildScrollView(
88+
child: new Container(
89+
height: MediaQuery.of(context).size.height,
90+
width: MediaQuery.of(context).size.width,
91+
color: Colors.black12,
92+
///触摸收起键盘
93+
child: new GestureDetector(
94+
behavior: HitTestBehavior.translucent,
95+
onTap: () {
96+
FocusScope.of(context).requestFocus(new FocusNode());
97+
},
98+
child: new Center(
99+
child: new GSYCardItem(
100+
margin: EdgeInsets.only(left: 50.0, right: 50.0),
101+
shape: new RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))),
102+
child: new Padding(
103+
padding: new EdgeInsets.all(12.0),
104+
child: new Column(
105+
mainAxisSize: MainAxisSize.min,
106+
children: <Widget>[
107+
///dialog标题
108+
new Padding(
109+
padding: new EdgeInsets.only(top: 5.0, bottom: 15.0),
110+
child: new Center(
111+
child: new Text(widget.dialogTitle, style: GSYConstant.normalTextBold),
112+
)),
113+
114+
///标题输入框
115+
renderTitleInput(),
116+
117+
///内容输入框
118+
new Container(
119+
height: MediaQuery.of(context).size.width * 3 / 4,
120+
decoration: new BoxDecoration(
121+
borderRadius: BorderRadius.all(Radius.circular(4.0)),
122+
color: Color(GSYColors.white),
123+
border: new Border.all(color: Color(GSYColors.subTextColor), width: .3),
139124
),
125+
padding: new EdgeInsets.only(left: 20.0, top: 12.0, right: 20.0, bottom: 12.0),
126+
child: new Column(
127+
children: <Widget>[
128+
new Expanded(
129+
child: new TextField(
130+
autofocus: false,
131+
maxLines: 999,
132+
onChanged: widget.onContentChanged,
133+
controller: widget.valueController,
134+
decoration: new InputDecoration.collapsed(
135+
hintText: CommonUtils.getLocale(context).issue_edit_issue_title_tip,
136+
hintStyle: GSYConstant.middleSubText,
137+
),
138+
style: GSYConstant.middleText,
139+
),
140+
),
140141

141-
///快速输入框
142-
_renderFastInputContainer(),
143-
],
144-
),
145-
),
146-
new Container(height: 10.0),
147-
new Row(
148-
crossAxisAlignment: CrossAxisAlignment.center,
149-
children: <Widget>[
150-
///取消
151-
new Expanded(
152-
child: new RawMaterialButton(
153-
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
154-
padding: EdgeInsets.all(4.0),
155-
constraints: const BoxConstraints(minWidth: 0.0, minHeight: 0.0),
156-
child: new Text(CommonUtils.getLocale(context).app_cancel, style: GSYConstant.normalSubText),
157-
onPressed: () {
158-
Navigator.pop(context);
159-
})),
160-
new Container(width: 0.3, height: 25.0, color: Color(GSYColors.subTextColor)),
161-
162-
///确定
163-
new Expanded(
164-
child: new RawMaterialButton(
165-
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
166-
padding: EdgeInsets.all(4.0),
167-
constraints: const BoxConstraints(minWidth: 0.0, minHeight: 0.0),
168-
child: new Text(CommonUtils.getLocale(context).app_ok, style: GSYConstant.normalTextBold),
169-
onPressed: widget.onPressed)),
142+
///快速输入框
143+
_renderFastInputContainer(),
144+
],
145+
),
146+
),
147+
new Container(height: 10.0),
148+
new Row(
149+
crossAxisAlignment: CrossAxisAlignment.center,
150+
children: <Widget>[
151+
///取消
152+
new Expanded(
153+
child: new RawMaterialButton(
154+
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
155+
padding: EdgeInsets.all(4.0),
156+
constraints: const BoxConstraints(minWidth: 0.0, minHeight: 0.0),
157+
child: new Text(CommonUtils.getLocale(context).app_cancel, style: GSYConstant.normalSubText),
158+
onPressed: () {
159+
Navigator.pop(context);
160+
})),
161+
new Container(width: 0.3, height: 25.0, color: Color(GSYColors.subTextColor)),
162+
163+
///确定
164+
new Expanded(
165+
child: new RawMaterialButton(
166+
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
167+
padding: EdgeInsets.all(4.0),
168+
constraints: const BoxConstraints(minWidth: 0.0, minHeight: 0.0),
169+
child: new Text(CommonUtils.getLocale(context).app_ok, style: GSYConstant.normalTextBold),
170+
onPressed: widget.onPressed)),
171+
],
172+
)
170173
],
171-
)
172-
],
174+
),
175+
),
173176
),
174177
),
175178
),
176179
),
177180
),
178-
)
179-
);
181+
));
180182
}
181183
}
182184

0 commit comments

Comments
 (0)