grafica pagina TodayView.dart
This commit is contained in:
@@ -1,55 +0,0 @@
|
|||||||
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),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
17
lib/Components/EditReminderButton.dart
Normal file
17
lib/Components/EditReminderButton.dart
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import '../pages/EditReminder.dart';
|
||||||
|
|
||||||
|
class EditReminderButton extends StatelessWidget{
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return FilledButton(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) => EditReminder()),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Icon(Icons.list),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../Components/EditReminder.dart';
|
import '../Components/EditReminderButton.dart';
|
||||||
|
|
||||||
class Reminder extends StatefulWidget {
|
class Reminder extends StatefulWidget {
|
||||||
const Reminder({super.key});
|
const Reminder({super.key});
|
||||||
@@ -27,7 +27,7 @@ class _ReminderState extends State<Reminder> {
|
|||||||
),
|
),
|
||||||
title: Text("Reminder"),
|
title: Text("Reminder"),
|
||||||
subtitle: Text(DateTime.now().toString()),
|
subtitle: Text(DateTime.now().toString()),
|
||||||
trailing: EditReminder(),
|
trailing: EditReminderButton(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class MyApp extends StatelessWidget {
|
|||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
title: 'My App',
|
title: 'My App',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
useMaterial3: true, colorScheme: ColorScheme.fromSwatch().copyWith(secondary: Colors.orange, primary: Colors.blueAccent, background: Colors.white),
|
useMaterial3: true,
|
||||||
),
|
),
|
||||||
home: Navigation()
|
home: Navigation()
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -31,10 +31,7 @@ class _NavigationState extends State<Navigation> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
body: SafeArea(child: _widgetOptions.elementAt(_selectedIndex)),
|
||||||
title: Text("BottomNavBar"),
|
|
||||||
),
|
|
||||||
body: Center(child: _widgetOptions.elementAt(_selectedIndex)),
|
|
||||||
bottomNavigationBar: BottomNavigationBar(
|
bottomNavigationBar: BottomNavigationBar(
|
||||||
items: const <BottomNavigationBarItem>[
|
items: const <BottomNavigationBarItem>[
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
|
|||||||
54
lib/pages/EditReminder.dart
Normal file
54
lib/pages/EditReminder.dart
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class EditReminder extends StatefulWidget {
|
||||||
|
const EditReminder({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<EditReminder> createState() => _EditReminderState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _EditReminderState extends State<EditReminder> {
|
||||||
|
String _title = "ciaciao";
|
||||||
|
String _description = "description";
|
||||||
|
DateTime _date = DateTime.now();
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text("Edit Reminder"),
|
||||||
|
),
|
||||||
|
body: SafeArea(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(16.0),
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
TextField(
|
||||||
|
controller: TextEditingController(text: _title),
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
border: OutlineInputBorder(),
|
||||||
|
labelText: 'Title',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Expanded(child: TextField(
|
||||||
|
onChanged: (text) {
|
||||||
|
setState(() {
|
||||||
|
_description = text;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
controller: TextEditingController(text: _description),
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
border: OutlineInputBorder(),
|
||||||
|
labelText: 'Description',
|
||||||
|
),
|
||||||
|
maxLines: 6,
|
||||||
|
keyboardType: TextInputType.multiline,
|
||||||
|
),),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
//import components
|
//import components
|
||||||
import '../Components/Reminder.dart';
|
import '../Components/Reminder.dart';
|
||||||
import '../Components/EditReminder.dart';
|
import '../Components/EditReminderButton.dart';
|
||||||
|
|
||||||
class TodayView extends StatefulWidget {
|
class TodayView extends StatefulWidget {
|
||||||
const TodayView({super.key});
|
const TodayView({super.key});
|
||||||
|
|||||||
Reference in New Issue
Block a user