hide input date
This commit is contained in:
parent
6b3bf5004c
commit
dbba3304c2
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user