flutter_notepad 0.0.3
flutter_notepad: ^0.0.3 copied to clipboard
A Flutter package for a fully functional notepad with local storage, PDF export, and text-to-speech.
π 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.