hide input date #20

Merged
v4l3n71n merged 1 commits from feature/hide-input into main 2024-11-23 21:32:22 +00:00
Showing only changes of commit dbba3304c2 - Show all commits

View File

@ -49,6 +49,8 @@ class _MyHomePageState extends State<ListItemMenu> {
TextEditingController startDatepicker = TextEditingController();
TextEditingController endDatepicker = TextEditingController();
bool showDateFields = false; // State to toggle date fields
// Fetching events from API
static Future<List<Events>> getPosts() async {
PermissionStatus status = await Permission.location.status;
@ -562,8 +564,22 @@ class _MyHomePageState extends State<ListItemMenu> {
body: Column(
children: [
_buildGeographicalZoneSearchField(),
_buildDateField("start"),
_buildDateField("end"),
if (showDateFields) _buildDateField("start"),
if (showDateFields) _buildDateField("end"),
IconButton(
onPressed: () {
setState(() {
showDateFields = !showDateFields; // Toggle visibility
});
},
icon: Icon(
showDateFields
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
color: Colors.blue,
),
tooltip: showDateFields ? 'Show Date Fields' : 'Hide Date Fields',
),
Expanded(
child: FutureBuilder<List<Events>>(
future: postsFuture,