Merge remote-tracking branch 'origin/Tito' into Zina
# Conflicts: # lib/database/database.dart # lib/model/note.dart # lib/model/promemoria.dart # lib/navigation.dart
This commit is contained in:
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),
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
//import components
|
||||
import '../Components/Reminder.dart';
|
||||
import '../Components/EditReminderButton.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(),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
45
lib/pages/test.dart
Normal file
45
lib/pages/test.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:progetto_m335_flutter/database/database.dart';
|
||||
import 'package:progetto_m335_flutter/model/note.dart';
|
||||
|
||||
import '../database/database.dart';
|
||||
|
||||
class Test extends StatefulWidget {
|
||||
const Test({super.key});
|
||||
|
||||
@override
|
||||
State<Test> createState() => _TestState();
|
||||
}
|
||||
|
||||
class _TestState extends State<Test> {
|
||||
NoteDatabase noteDatabase = NoteDatabase.instance;
|
||||
|
||||
Future<void> _pressed() async {
|
||||
print("Inserting demo data");
|
||||
final db = await noteDatabase.database;
|
||||
|
||||
|
||||
}
|
||||
|
||||
Future<void> _printdata() async {
|
||||
final db = await noteDatabase.database;
|
||||
|
||||
print("Printing data");
|
||||
print(await db.query(noteTable));
|
||||
print("Data printed");
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
FloatingActionButton(onPressed: _pressed),
|
||||
FloatingActionButton(onPressed: _printdata)
|
||||
],
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user