-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 2.10Found to occur in 2.10Found to occur in 2.10found in release: 2.13Found to occur in 2.13Found to occur in 2.13frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.good first issueRelatively approachable for first-time contributorsRelatively approachable for first-time contributorshas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
Description
Update: For updated state of this issue, see #101620 (comment) .
i am using autocomplete bar in windows and web. if autocomplete bar in the bottom of screen then suggestion are invisible. if i scroll then suggestion disappeared. i want if autocomplete is in bottom the suggestion will show on above side.
code
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const autocomplete_widget(),
);
}
}
class autocomplete_widget extends StatefulWidget {
const autocomplete_widget({Key? key}) : super(key: key);
@override
State<autocomplete_widget> createState() => _autocomplete_widgetState();
}
class _autocomplete_widgetState extends State<autocomplete_widget> {
// This will be displayed below the autocomplete field
String? _selectedAnimal;
// This list holds all the suggestions
final List<String> _suggestions = [
'Alligator',
'Buffalo',
'Chicken',
'Dog',
'Eagle',
'Frog'
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Kindacode.com'),
),
body:
SingleChildScrollView(child:
Column(
children: [
Autocomplete<String>(
optionsBuilder: (TextEditingValue value) {
// When the field is empty
if (value.text.isEmpty) {
return [];
}
// The logic to find out which ones should appear
return _suggestions.where((suggestion) =>
suggestion.toLowerCase().contains(value.text.toLowerCase()));
},
onSelected: (value) {
setState(() {
_selectedAnimal = value;
});
},
),
const SizedBox(
height: 30,
),
Autocomplete<String>(
optionsBuilder: (TextEditingValue value) {
// When the field is empty
if (value.text.isEmpty) {
return [];
}
// The logic to find out which ones should appear
return _suggestions.where((suggestion) =>
suggestion.toLowerCase().contains(value.text.toLowerCase()));
},
onSelected: (value) {
setState(() {
_selectedAnimal = value;
});
},
),
const SizedBox(
height: 30,
),
Autocomplete<String>(
optionsBuilder: (TextEditingValue value) {
// When the field is empty
if (value.text.isEmpty) {
return [];
}
// The logic to find out which ones should appear
return _suggestions.where((suggestion) =>
suggestion.toLowerCase().contains(value.text.toLowerCase()));
},
onSelected: (value) {
setState(() {
_selectedAnimal = value;
});
},
),
const SizedBox(
height: 30,
),
Autocomplete<String>(
optionsBuilder: (TextEditingValue value) {
// When the field is empty
if (value.text.isEmpty) {
return [];
}
// The logic to find out which ones should appear
return _suggestions.where((suggestion) =>
suggestion.toLowerCase().contains(value.text.toLowerCase()));
},
onSelected: (value) {
setState(() {
_selectedAnimal = value;
});
},
),
const SizedBox(
height: 30,
),
Autocomplete<String>(
optionsBuilder: (TextEditingValue value) {
// When the field is empty
if (value.text.isEmpty) {
return [];
}
// The logic to find out which ones should appear
return _suggestions.where((suggestion) =>
suggestion.toLowerCase().contains(value.text.toLowerCase()));
},
onSelected: (value) {
setState(() {
_selectedAnimal = value;
});
},
),
const SizedBox(
height: 30,
),
Autocomplete<String>(
optionsBuilder: (TextEditingValue value) {
// When the field is empty
if (value.text.isEmpty) {
return [];
}
// The logic to find out which ones should appear
return _suggestions.where((suggestion) =>
suggestion.toLowerCase().contains(value.text.toLowerCase()));
},
onSelected: (value) {
setState(() {
_selectedAnimal = value;
});
},
),
const SizedBox(
height: 30,
),
Autocomplete<String>(
optionsBuilder: (TextEditingValue value) {
// When the field is empty
if (value.text.isEmpty) {
return [];
}
// The logic to find out which ones should appear
return _suggestions.where((suggestion) =>
suggestion.toLowerCase().contains(value.text.toLowerCase()));
},
onSelected: (value) {
setState(() {
_selectedAnimal = value;
});
},
),
const SizedBox(
height: 30,
),
Autocomplete<String>(
optionsBuilder: (TextEditingValue value) {
// When the field is empty
if (value.text.isEmpty) {
return [];
}
// The logic to find out which ones should appear
return _suggestions.where((suggestion) =>
suggestion.toLowerCase().contains(value.text.toLowerCase()));
},
onSelected: (value) {
setState(() {
_selectedAnimal = value;
});
},
),
const SizedBox(
height: 30,
), Autocomplete<String>(
optionsBuilder: (TextEditingValue value) {
// When the field is empty
if (value.text.isEmpty) {
return [];
}
// The logic to find out which ones should appear
return _suggestions.where((suggestion) =>
suggestion.toLowerCase().contains(value.text.toLowerCase()));
},
onSelected: (value) {
setState(() {
_selectedAnimal = value;
});
},
),
const SizedBox(
height: 30,
),
Autocomplete<String>(
optionsBuilder: (TextEditingValue value) {
// When the field is empty
if (value.text.isEmpty) {
return [];
}
// The logic to find out which ones should appear
return _suggestions.where((suggestion) =>
suggestion.toLowerCase().contains(value.text.toLowerCase()));
},
onSelected: (value) {
setState(() {
_selectedAnimal = value;
});
},
),
const SizedBox(
height: 30,
),
Autocomplete<String>(
optionsBuilder: (TextEditingValue value) {
// When the field is empty
if (value.text.isEmpty) {
return [];
}
// The logic to find out which ones should appear
return _suggestions.where((suggestion) =>
suggestion.toLowerCase().contains(value.text.toLowerCase()));
},
onSelected: (value) {
setState(() {
_selectedAnimal = value;
});
},
),
const SizedBox(
height: 30,
), Autocomplete<String>(
optionsBuilder: (TextEditingValue value) {
// When the field is empty
if (value.text.isEmpty) {
return [];
}
// The logic to find out which ones should appear
return _suggestions.where((suggestion) =>
suggestion.toLowerCase().contains(value.text.toLowerCase()));
},
onSelected: (value) {
setState(() {
_selectedAnimal = value;
});
},
),
const SizedBox(
height: 30,
),
Autocomplete<String>(
optionsBuilder: (TextEditingValue value) {
// When the field is empty
if (value.text.isEmpty) {
return [];
}
// The logic to find out which ones should appear
return _suggestions.where((suggestion) =>
suggestion.toLowerCase().contains(value.text.toLowerCase()));
},
onSelected: (value) {
setState(() {
_selectedAnimal = value;
});
},
),
const SizedBox(
height: 30,
),
Autocomplete<String>(
optionsBuilder: (TextEditingValue value) {
// When the field is empty
if (value.text.isEmpty) {
return [];
}
// The logic to find out which ones should appear
return _suggestions.where((suggestion) =>
suggestion.toLowerCase().contains(value.text.toLowerCase()));
},
onSelected: (value) {
setState(() {
_selectedAnimal = value;
});
},
),
const SizedBox(
height: 30,
),
Autocomplete<String>(
optionsBuilder: (TextEditingValue value) {
// When the field is empty
if (value.text.isEmpty) {
return [];
}
// The logic to find out which ones should appear
return _suggestions.where((suggestion) =>
suggestion.toLowerCase().contains(value.text.toLowerCase()));
},
onSelected: (value) {
setState(() {
_selectedAnimal = value;
});
},
),
const SizedBox(
height: 30,
),
],
),),
);
}
}
dkbast, sarbogast, legolas108, harkairt, RobertOdrowaz and 4 more
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 2.10Found to occur in 2.10Found to occur in 2.10found in release: 2.13Found to occur in 2.13Found to occur in 2.13frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.good first issueRelatively approachable for first-time contributorsRelatively approachable for first-time contributorshas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team