📒 Flutter Notepad
A powerful and lightweight Flutter package for a fully functional notepad, featuring local storage, PDF export, and text-to-speech.
✨ Features ✔️ Create, Edit, Delete Notes ✔️ Categorize Notes (General, Work, Personal, etc.) ✔️ Export Notes as PDF 📄 ✔️ Text-to-Speech Support 🔊 ✔️ Local Notifications for Reminders ⏰ ✔️ SQLite Local Storage 💾 ✔️ Dark Mode Support 🌙
🚀 Installation Add the following to your pubspec.yaml:
dependencies: flutter_notepad: ^0.0.1
flutter pub get
📌 Usage 1️⃣ Initialize the Database Before using the package, initialize SQLite:
import 'package:flutter_notepad/db_helper.dart';
void main() async { final dbHelper = DBHelper(); await dbHelper.initDB(); } 2️⃣ Creating a New Note
import 'package:flutter_notepad/note.dart'; import 'package:flutter_notepad/db_helper.dart';
final dbHelper = DBHelper();
void addNewNote() async { Note newNote = Note( title: "My First Note", content: "This is a sample note created using flutter_notepad.", category: "Personal", createdAt: DateTime.now().toIso8601String(), );
await dbHelper.addNote(newNote); }
3️⃣ Fetching All Notes
void fetchNotes() async { List
4️⃣ Editing a Note
void editNote(Note note) async { Note updatedNote = Note( id: note.id, title: "Updated Title", content: "Updated Content", category: note.category, createdAt: note.createdAt, );
await dbHelper.updateNote(updatedNote); }
5️⃣ Deleting a Note
void deleteNote(int id) async { await dbHelper.deleteNote(id); }
6️⃣ Exporting a Note as PDF
import 'package:pdf/pdf.dart'; import 'package:pdf/widgets.dart' as pw;
void exportToPDF(Note note) async { final pdf = pw.Document();
pdf.addPage( pw.Page( build: (pw.Context context) => pw.Center( child: pw.Text(note.content), ), ), );
// Save or Share PDF }
7️⃣ Text-to-Speech (TTS) Support
import 'package:flutter_tts/flutter_tts.dart';
final FlutterTts flutterTts = FlutterTts();
void speak(String text) async { await flutterTts.setLanguage("en-US"); await flutterTts.speak(text); }
8️⃣ Local Notifications
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
void showNotification(String noteTitle) async { const AndroidNotificationDetails androidPlatformChannelSpecifics = AndroidNotificationDetails( 'notepad_channel', 'Notepad Notifications', importance: Importance.high, priority: Priority.high, );
const NotificationDetails platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.show( 0, "Reminder", "Don't forget: $noteTitle", platformChannelSpecifics, ); }
📂 Folder Structure
flutter_notepad/ │── lib/ │ ├── db_helper.dart # SQLite Database Helper │ ├── note.dart # Note Model │ ├── notepad_widget.dart # UI Component for Notepad │ ├── note_edit_screen.dart # Note Editing Screen │── example/ │ ├── lib/ │ │ ├── main.dart # Example Usage │── test/ │── pubspec.yaml │── README.md │── LICENSE
🎯 Roadmap
✅ Basic CRUD Functionality
✅ Export to PDF
✅ Text-to-Speech
🚀 Cloud Sync (Future Update)
🚀 Cross-Device Synchronization
📢 Contributing We ❤️ contributions! Feel free to submit a PR or report an issue at 🔗 GitHub Issues
📜 License This project is licensed under the MIT License. See the LICENSE file for details.