grafica pagina TodayView.dart
This commit is contained in:
55
lib/Components/EditReminder.dart
Normal file
55
lib/Components/EditReminder.dart
Normal file
@@ -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: <Widget>[
|
||||
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),
|
||||
);
|
||||
}
|
||||
}
|
||||
33
lib/Components/Reminder.dart
Normal file
33
lib/Components/Reminder.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../Components/EditReminder.dart';
|
||||
|
||||
class Reminder extends StatefulWidget {
|
||||
const Reminder({super.key});
|
||||
|
||||
@override
|
||||
State<Reminder> createState() => _ReminderState();
|
||||
}
|
||||
|
||||
class _ReminderState extends State<Reminder> {
|
||||
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(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
);
|
||||
|
||||
@@ -36,14 +36,14 @@ class _NavigationState extends State<Navigation> {
|
||||
),
|
||||
body: Center(child: _widgetOptions.elementAt(_selectedIndex)),
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
items: const <BottomNavigationBarItem>[
|
||||
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>[
|
||||
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,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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<TodayView> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Scaffold(
|
||||
body: Center(
|
||||
child: Icon(Icons.calendar_today)
|
||||
)
|
||||
return ListView(
|
||||
children: <Widget>[
|
||||
Reminder(),
|
||||
Reminder(),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user