2022-10-23 13:50:44 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2022-10-29 20:55:38 +00:00
|
|
|
import 'package:provider/provider.dart';
|
2022-10-23 13:50:44 +00:00
|
|
|
|
2022-10-30 20:57:13 +00:00
|
|
|
import '../context/file_change_notifier.dart';
|
|
|
|
import '../widgets/icon_material_button.dart';
|
|
|
|
import '../widgets/note_tile.dart';
|
|
|
|
|
2022-10-23 13:50:44 +00:00
|
|
|
class AllNotesPage extends StatefulWidget {
|
|
|
|
const AllNotesPage({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<AllNotesPage> createState() => _AllNotesPageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _AllNotesPageState extends State<AllNotesPage> {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Column(
|
|
|
|
children: [
|
2022-10-27 22:55:37 +00:00
|
|
|
SizedBox(
|
|
|
|
height: 10 + MediaQuery.of(context).viewPadding.top,
|
2022-10-23 13:50:44 +00:00
|
|
|
),
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
const SizedBox(
|
|
|
|
width: 20,
|
|
|
|
),
|
|
|
|
const Text(
|
2022-10-23 15:57:59 +00:00
|
|
|
'All notes',
|
2022-10-23 13:50:44 +00:00
|
|
|
style: TextStyle(
|
|
|
|
color: Color.fromRGBO(255, 255, 255, .85), fontSize: 22),
|
|
|
|
),
|
|
|
|
Expanded(child: Container()),
|
2022-10-29 10:33:47 +00:00
|
|
|
IconMaterialButton(
|
|
|
|
icon: const Icon(Icons.picture_as_pdf_outlined),
|
|
|
|
color: const Color.fromRGBO(255, 255, 255, .85),
|
2022-10-31 18:29:58 +00:00
|
|
|
onPressed: () async {
|
|
|
|
// todo implement pdf import
|
|
|
|
},
|
2022-10-23 13:50:44 +00:00
|
|
|
),
|
2022-10-29 10:33:47 +00:00
|
|
|
IconMaterialButton(
|
|
|
|
icon: const Icon(Icons.search),
|
|
|
|
color: const Color.fromRGBO(255, 255, 255, .85),
|
|
|
|
onPressed: () {},
|
2022-10-23 13:50:44 +00:00
|
|
|
),
|
2022-10-29 10:33:47 +00:00
|
|
|
IconMaterialButton(
|
|
|
|
icon: const Icon(Icons.more_vert),
|
|
|
|
color: const Color.fromRGBO(255, 255, 255, .85),
|
|
|
|
onPressed: () {},
|
2022-10-23 13:50:44 +00:00
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
width: 15,
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
2022-10-23 15:57:59 +00:00
|
|
|
Row(
|
|
|
|
children: const [Text('date modified..')],
|
|
|
|
),
|
|
|
|
_buildNoteTiles()
|
2022-10-23 13:50:44 +00:00
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
2022-10-23 15:57:59 +00:00
|
|
|
|
|
|
|
Widget _buildNoteTiles() {
|
|
|
|
return Expanded(
|
2022-10-29 20:55:38 +00:00
|
|
|
child: Consumer<FileChangeNotifier>(
|
|
|
|
builder: (BuildContext context, value, Widget? child) {
|
|
|
|
return GridView.builder(
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
crossAxisCount: 5,
|
|
|
|
),
|
|
|
|
padding: const EdgeInsets.all(2),
|
|
|
|
itemBuilder: (BuildContext context, int idx) =>
|
|
|
|
NoteTile(data: value.tiledata[idx]),
|
|
|
|
itemCount: value.tiledata.length,
|
|
|
|
);
|
|
|
|
},
|
2022-10-23 15:57:59 +00:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
2022-10-23 13:50:44 +00:00
|
|
|
}
|