Merge pull request 'hide input date' (#20) from feature/hide-input into main
Reviewed-on: #20
This commit is contained in:
commit
f85894416c
@ -49,6 +49,8 @@ class _MyHomePageState extends State<ListItemMenu> {
|
|||||||
TextEditingController startDatepicker = TextEditingController();
|
TextEditingController startDatepicker = TextEditingController();
|
||||||
TextEditingController endDatepicker = TextEditingController();
|
TextEditingController endDatepicker = TextEditingController();
|
||||||
|
|
||||||
|
bool showDateFields = false; // State to toggle date fields
|
||||||
|
|
||||||
// Fetching events from API
|
// Fetching events from API
|
||||||
static Future<List<Events>> getPosts() async {
|
static Future<List<Events>> getPosts() async {
|
||||||
PermissionStatus status = await Permission.location.status;
|
PermissionStatus status = await Permission.location.status;
|
||||||
@ -562,8 +564,22 @@ class _MyHomePageState extends State<ListItemMenu> {
|
|||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
_buildGeographicalZoneSearchField(),
|
_buildGeographicalZoneSearchField(),
|
||||||
_buildDateField("start"),
|
if (showDateFields) _buildDateField("start"),
|
||||||
_buildDateField("end"),
|
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(
|
Expanded(
|
||||||
child: FutureBuilder<List<Events>>(
|
child: FutureBuilder<List<Events>>(
|
||||||
future: postsFuture,
|
future: postsFuture,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user