不确定如何消除这个错误(An InputDecorator, which is typically created by a TextField, cannot have an unbounded width.),但也要让两个内部文本字段占据整个列的宽度.
Column(mainAxisSize: MainAxisSize.min, children: [
Container(
margin: const EdgeInsets.only(left: 50, right: 50),
child: AutoCompleteTextView(
suggestionsApiFetchDelay: 300,
focusGained: () {},
onTapCallback: (_) async {
},
focusLost: () {
},
onValueChanged: (String text) {
},
controller: startEditingController,
suggestionStyle:
Theme.of(context).textTheme.bodyText2,
getSuggestionsMethod: getLocationSuggestionsList,
tfTextAlign: TextAlign.left,
tfStyle: TextStyle(
fontSize: 16,
color: Theme.of(context).textTheme.bodyText2.color,
),
tfTextDecoration: InputDecoration(
contentPadding: EdgeInsets.only(top: 0, left: 8.0),
filled: true,
fillColor: Colors.white,
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.grey[800], width: 1.0),
borderRadius: BorderRadius.zero,
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.deepPurple[600], width: 1.0),
borderRadius: BorderRadius.zero,
),
hintText: "Current Location",
labelText: 'Start',
labelStyle: kcarPurpleLabelStyle,
),
),
),
Container(
margin:
const EdgeInsets.only(top: 5, left: 50, right: 50),
child: AutoCompleteTextView(
suggestionsApiFetchDelay: 300,
focusGained: () {},
onTapCallback: (_) async {
},
focusLost: () {
},
onValueChanged: (String text) {
},
controller: startEditingController,
suggestionStyle:
Theme.of(context).textTheme.bodyText2,
getSuggestionsMethod: getLocationSuggestionsList,
tfTextAlign: TextAlign.left,
tfStyle: TextStyle(
fontSize: 16,
color: Theme.of(context).textTheme.bodyText2.color,
),
tfTextDecoration: InputDecoration(
contentPadding: EdgeInsets.only(top: 0, left: 8.0),
filled: true,
fillColor: Colors.white,
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.grey[800], width: 1.0),
borderRadius: BorderRadius.zero,
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.deepPurple[600], width: 1.0),
borderRadius: BorderRadius.zero,
),
hintText: "Current Location",
labelText: 'Destination',
labelStyle: kcarPurpleLabelStyle,
),
),
)
]),