admin管理员组文章数量:1125075
I am getting this issue and tried to fix this but cannot able to find what is the problem and how to do this can anyone help me in this My locations sugggestions list is overlapping the use current location button and i dont know how to fix this and also when i try to scroll its not scrolling also
body: GestureDetector(
onTap: () {
FocusScope.of(context).unfocus();
setState(() {
showSuggestions = false;
showAddressDetails = false;
});
},
child: Stack(
children: [
IgnorePointer(
ignoring: _isLoading,
child: GoogleMap(
initialCameraPosition: CameraPosition(
target: currentPinPosition,
zoom: 15,
),
onMapCreated: (GoogleMapController controller) {
mapController = controller;
},
onTap: (LatLng position) {
FocusScope.of(context).unfocus();
setState(() {
showSuggestions = false;
});
},
onCameraMove: (CameraPosition position) {
setState(() {
currentPinPosition = position.target;
});
},
onCameraIdle: () {
_getAddressFromLatLng(currentPinPosition);
},
),
),
const Center(
child: Icon(Icons.location_pin, size: 50, color: Colors.red),
),
Positioned(
top: 20,
left: 16,
right: 16,
child: Column(
children: <Widget>[
IgnorePointer(
ignoring: _isLoading,
child: TextFormField(
style: TextStyle(color: Colors.black),
controller: _controller,
decoration: InputDecoration(
filled: true,
fillColor: Colors.white,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(50),
),
enabledBorder: OutlineInputBorder(
borderSide:
BorderSide(color: AppColors.buttonColor),
borderRadius: BorderRadius.circular(30)),
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: AppColors.buttonColor),
borderRadius: BorderRadius.circular(30)),
hintText: "Search your location here",
hintStyle: GoogleFonts.poppins(
color: Colors.grey.shade400, fontSize: 14),
prefixIcon: Icon(Icons.search_outlined,
color: AppColors.buttonColor),
suffixIcon: IconButton(
icon: const Icon(Icons.cancel),
onPressed: () {
_controller.clear();
setState(() {
_placeList.clear();
showSuggestions = true;
});
},
),
),
),
),
const SizedBox(height: 10),
if (_placeList.isNotEmpty && showSuggestions)
GestureDetector(
onVerticalDragUpdate: (details) {
FocusScope.of(context).unfocus();
},
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
),
child: Flexible(
child: ListView.builder(
controller: _scrollController,
shrinkWrap: true,
itemCount: _placeList.length,
itemBuilder: (context, index) {
return Column(
children: [
ListTile(
leading: const Icon(
Icons.location_on_outlined,
color: AppColors.appbarColor),
title: Text(
_placeList[index]["description"],
style: GoogleFonts.poppins(
color: Colors.black),
),
onTap: () async {
String placeId =
_placeList[index]["place_id"];
await getPlaceDetails(placeId);
FocusScope.of(context).unfocus();
setState(() {
_controller.text =
_placeList[index]["description"];
_placeList.clear();
showSuggestions = false;
});
},
),
const Divider(),
],
);
},
),
),
),
),
],
),
),
if (!isKeyboardVisible)
Positioned(
bottom: 140,
left: 16,
right: 16,
child: ElevatedButton(
onPressed: () {
FocusScope.of(context).unfocus();
setState(() {
showSuggestions = false;
});
_getCurrentLocation();
},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
padding:
const EdgeInsets.symmetric(horizontal: 5, vertical: 6),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10)),
side: const BorderSide(
color: AppColors.appbarColor, width: 1),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.my_location,
color: AppColors.appbarColor, size: 18),
SizedBox(width: 3),
Text("Use Current Location",
style: GoogleFonts.poppins(
color: AppColors.appbarColor, fontSize: 18)),
],
),
),
),
please if anyone can help me in this
本文标签: flutterListView overlapping in the buttonStack Overflow
版权声明:本文标题:flutter - ListView overlapping in the button - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736656107a1946259.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论