Skip to content

Commit

Permalink
Merge pull request #144 from Nesteo/new-box-screen-data-input
Browse files Browse the repository at this point in the history
added attributes and methods to rerive inputs from textfields. #131
  • Loading branch information
SimonOyen authored Nov 13, 2019
2 parents 061734d + 5fe95db commit 37acde3
Showing 1 changed file with 44 additions and 6 deletions.
50 changes: 44 additions & 6 deletions lib/screens/newbox_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ class NewBoxData extends StatefulWidget {
}

class _NewBoxDataState extends State<NewBoxData> {
String id;
String oldId;
DateTime hangDate;
String material;

String _id;
String _oldId;
String _foreignId;
DateTime _hangDate;
String _regionId;
String _regionName;
String _owner;
String _comment;
String _dropDownMaterial;
double _slideHoleSize = 1;

Expand Down Expand Up @@ -70,6 +73,11 @@ class _NewBoxDataState extends State<NewBoxData> {
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: TextFormField(
onChanged: (String value) {
setState(() {
_id = value;
});
},
textAlign: TextAlign.left,
decoration: InputDecoration(
labelText: "ID - optional",
Expand All @@ -84,6 +92,11 @@ class _NewBoxDataState extends State<NewBoxData> {
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: TextFormField(
onChanged: (String value) {
setState(() {
_oldId = value;
});
},
textAlign: TextAlign.left,
decoration: InputDecoration(
labelText: "old ID - optional",
Expand All @@ -98,6 +111,11 @@ class _NewBoxDataState extends State<NewBoxData> {
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: TextFormField(
onChanged: (String value) {
setState(() {
_foreignId = value;
});
},
textAlign: TextAlign.left,
decoration: InputDecoration(
labelText: "foreign ID - optional",
Expand Down Expand Up @@ -131,7 +149,7 @@ class _NewBoxDataState extends State<NewBoxData> {
initialDate: DateTime.now(),
editable: false,
onChanged: (dt) {
setState(() => hangDate = dt);
setState(() => _hangDate = dt);
},
),
))),
Expand Down Expand Up @@ -177,6 +195,11 @@ class _NewBoxDataState extends State<NewBoxData> {
),
subtitle: Column(children: <Widget>[
TextFormField(
onChanged: (String value) {
setState(() {
_regionId = value;
});
},
maxLines: 1,
textAlign: TextAlign.left,
decoration: InputDecoration(
Expand All @@ -186,6 +209,11 @@ class _NewBoxDataState extends State<NewBoxData> {
),
),
TextFormField(
onChanged: (String value) {
setState(() {
_regionName = value;
});
},
maxLines: 1,
textAlign: TextAlign.left,
decoration: InputDecoration(
Expand Down Expand Up @@ -257,6 +285,11 @@ class _NewBoxDataState extends State<NewBoxData> {
],
),
subtitle: TextFormField(
onChanged: (String value) {
setState(() {
_owner = value;
});
},
maxLines: 1,
textAlign: TextAlign.left,
decoration: InputDecoration(
Expand All @@ -278,6 +311,11 @@ class _NewBoxDataState extends State<NewBoxData> {
],
),
subtitle: TextFormField(
onChanged: (String value) {
setState(() {
_comment = value;
});
},
maxLines: 3,
textAlign: TextAlign.left,
),
Expand Down

0 comments on commit 37acde3

Please sign in to comment.