diff --git a/lib/Components/EditReminder.dart b/lib/Components/EditReminder.dart new file mode 100644 index 0000000..927e0c2 --- /dev/null +++ b/lib/Components/EditReminder.dart @@ -0,0 +1,55 @@ +import 'package:flutter/material.dart'; + +class EditReminder extends StatelessWidget{ + @override + Widget build(BuildContext context) { + return FloatingActionButton.small( + onPressed: () { + showModalBottomSheet( + context: context, + showDragHandle: true, + builder: (BuildContext context) { + return Container( + // Contenuto del BottomSheet modale + + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + ListTile( + title: const TextField( + decoration: InputDecoration( + hintText: "Title", + border: OutlineInputBorder(), + ), + ), + onTap: () { + // Azione da eseguire quando viene selezionato "Share" + Navigator.pop(context); + }, + ), + ListTile( + title: const TextField( + decoration: InputDecoration( + hintText: "Title", + border: OutlineInputBorder(), + ), + ), + onTap: () { + // Azione da eseguire quando viene selezionato "Share" + Navigator.pop(context); + }, + ), + //spacer + Container( + height: 600 + ), + ], + ), + ); + }, + ); + }, + child: Icon(Icons.edit), + ); + } +} diff --git a/lib/Components/Reminder.dart b/lib/Components/Reminder.dart new file mode 100644 index 0000000..fdddfa5 --- /dev/null +++ b/lib/Components/Reminder.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; + +import '../Components/EditReminder.dart'; + +class Reminder extends StatefulWidget { + const Reminder({super.key}); + + @override + State createState() => _ReminderState(); +} + +class _ReminderState extends State { + bool _value = false; + + void _onChanged(bool? newValue) { + setState(() { + _value = newValue ?? false; + }); + } + + @override + Widget build(BuildContext context) { + return ListTile( + leading: Checkbox( + value: _value, + onChanged: _onChanged, + ), + title: Text("Reminder"), + subtitle: Text(DateTime.now().toString()), + trailing: EditReminder(), + ); + } +} diff --git a/lib/myApp.dart b/lib/myApp.dart index 2f9d223..afa1213 100644 --- a/lib/myApp.dart +++ b/lib/myApp.dart @@ -9,8 +9,7 @@ class MyApp extends StatelessWidget { return MaterialApp( title: 'My App', theme: ThemeData( - useMaterial3: true, - primaryColor: Colors.red, + useMaterial3: true, colorScheme: ColorScheme.fromSwatch().copyWith(secondary: Colors.orange, primary: Colors.blueAccent, background: Colors.white), ), home: Navigation() ); diff --git a/lib/navigation.dart b/lib/navigation.dart index 180a383..f43bebe 100644 --- a/lib/navigation.dart +++ b/lib/navigation.dart @@ -36,14 +36,14 @@ class _NavigationState extends State { ), body: Center(child: _widgetOptions.elementAt(_selectedIndex)), bottomNavigationBar: BottomNavigationBar( - items: const [ - BottomNavigationBarItem( - icon: Icon(Icons.calendar_today), label: "today"), - BottomNavigationBarItem(icon: Icon(Icons.inbox), label: "Inbox"), - BottomNavigationBarItem(icon: Icon(Icons.note), label: "Notes"), - ], - currentIndex: _selectedIndex, - onTap: _onItemTapped, + items: const [ + BottomNavigationBarItem( + icon: Icon(Icons.today), label: "today"), + BottomNavigationBarItem(icon: Icon(Icons.inbox), label: "Inbox"), + BottomNavigationBarItem(icon: Icon(Icons.note), label: "Notes"), + ], + currentIndex: _selectedIndex, + onTap: _onItemTapped, ), ); } diff --git a/lib/pages/TodayView.dart b/lib/pages/TodayView.dart index cad5346..a6a57f7 100644 --- a/lib/pages/TodayView.dart +++ b/lib/pages/TodayView.dart @@ -1,5 +1,9 @@ import 'package:flutter/material.dart'; +//import components +import '../Components/Reminder.dart'; +import '../Components/EditReminder.dart'; + class TodayView extends StatefulWidget { const TodayView({super.key}); @@ -10,10 +14,11 @@ class TodayView extends StatefulWidget { class _TodayViewState extends State { @override Widget build(BuildContext context) { - return const Scaffold( - body: Center( - child: Icon(Icons.calendar_today) - ) + return ListView( + children: [ + Reminder(), + Reminder(), + ] ); } }