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(
|
return MaterialApp(
|
||||||
title: 'My App',
|
title: 'My App',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
useMaterial3: true,
|
useMaterial3: true, colorScheme: ColorScheme.fromSwatch().copyWith(secondary: Colors.orange, primary: Colors.blueAccent, background: Colors.white),
|
||||||
primaryColor: Colors.red,
|
|
||||||
),
|
),
|
||||||
home: Navigation()
|
home: Navigation()
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class _NavigationState extends State<Navigation> {
|
|||||||
bottomNavigationBar: BottomNavigationBar(
|
bottomNavigationBar: BottomNavigationBar(
|
||||||
items: const <BottomNavigationBarItem>[
|
items: const <BottomNavigationBarItem>[
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: Icon(Icons.calendar_today), label: "today"),
|
icon: Icon(Icons.today), label: "today"),
|
||||||
BottomNavigationBarItem(icon: Icon(Icons.inbox), label: "Inbox"),
|
BottomNavigationBarItem(icon: Icon(Icons.inbox), label: "Inbox"),
|
||||||
BottomNavigationBarItem(icon: Icon(Icons.note), label: "Notes"),
|
BottomNavigationBarItem(icon: Icon(Icons.note), label: "Notes"),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
//import components
|
||||||
|
import '../Components/Reminder.dart';
|
||||||
|
import '../Components/EditReminder.dart';
|
||||||
|
|
||||||
class TodayView extends StatefulWidget {
|
class TodayView extends StatefulWidget {
|
||||||
const TodayView({super.key});
|
const TodayView({super.key});
|
||||||
|
|
||||||
@@ -10,10 +14,11 @@ class TodayView extends StatefulWidget {
|
|||||||
class _TodayViewState extends State<TodayView> {
|
class _TodayViewState extends State<TodayView> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return const Scaffold(
|
return ListView(
|
||||||
body: Center(
|
children: <Widget>[
|
||||||
child: Icon(Icons.calendar_today)
|
Reminder(),
|
||||||
)
|
Reminder(),
|
||||||
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user