Quantcast
Channel: Active questions tagged listview - Stack Overflow
Viewing all articles
Browse latest Browse all 611

ListView overlapping in the button

$
0
0

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 thisMy locations sugggestions list is overlapping the use current location button and i dont know how to fix thisand 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)),                    ],                  ),                ),              ),

enter image description here

please if anyone can help me in this


Viewing all articles
Browse latest Browse all 611

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>