bible_parser_flutter 0.3.0
bible_parser_flutter: ^0.3.0 copied to clipboard
A Flutter package for parsing Bible texts in OSIS, USFX, and ZEFANIA formats with direct parsing and database-backed approaches. Includes desktop app for database creation and management.
0.3.0 Desktop App Release #
🆕 Major Features #
- Complete Desktop App - Full-featured Bible database creation tool
- Cross-platform support (macOS, Windows, Linux)
- File picker integration for XML selection
- Database export with user-controlled file saving
- Database loading from existing files for testing
- Production-ready XML to database workflow
📱 New Package Capabilities #
- BibleRepository.fromDatabase() constructor - Direct database file loading
- Enables mobile apps to load pre-created databases without XML parsing
- Perfect for production apps with Firebase distribution
- Enhanced path handling - Improved database file path management
- Comprehensive test coverage - Full test suite for new desktop features
🛠️ Desktop App Features #
- Dual Mode Interface - Switch between "Create from XML" and "Load from Database"
- File Management - Intelligent temporary/permanent file handling
- Temporary storage in app's
dbfiles/directory
- Persists across
flutter runsessions - Overwrites when creating same database name
- Temporary storage in app's
- User-Controlled Export - Download databases to any location (Desktop, Documents, Downloads)
- Production Workflow - XML → Database → Firebase → Mobile Apps
📚 Documentation & Examples #
- Updated README with desktop app installation and usage guide
- File Management Documentation - Complete persistence behavior guide
- Mobile Integration Examples - Firebase download patterns for mobile apps
- Production Workflow Examples - End-to-end Bible database distribution
🔄 Breaking Changes #
- None - Fully backward compatible with existing code
📦 Package Structure #
bible_parser_flutter/
├── lib/ # Core parsing library
├── desktop_app/ # New desktop application
│ ├── lib/main.dart # Desktop app UI and logic
│ ├── test/ # Desktop app tests
│ └── macos/ # macOS platform files
└── doc/ # Updated documentation
🎯 Impact #
This release transforms the package from a parsing library to a complete Bible database management solution. Developers can now:
- Create production Bible databases with a desktop GUI tool
- Distribute databases via Firebase or other cloud storage
- Load databases directly in mobile apps without XML parsing overhead
- Test and validate Bible data before production deployment
0.2.5 Code Quality Improvements #
Fixed #
- Code quality improvements - Fixed string concatenation linting issues
- Replaced
+operator with string interpolation in USFX parser - Changed
currentVerse.text + ' ' + trimmedTextto'${currentVerse.text} $trimmedText' - Fixed in both
parseBooks()andparseVerses()methods - All 76 tests passing
flutter analyze lib/now reports no issues
- Replaced
Impact #
- Expected improvement in pub.dev package score from 140/160 to ~150/160
- Better code maintainability and adherence to Dart style guidelines
0.2.4 USFX Added Text Support #
Added #
- Added text support for USFX format - Track translator additions (italicized text) in USFX files
- Parser now recognizes
<add>tags in USFX XML - Uses same
transChange: 'added'attribute as OSIS format for consistency - Works alongside Jesus words (
<wj>tags) when both are present - Added 7 comprehensive tests for USFX add tag functionality
- Parser now recognizes
- Example app improvements
- Added 3 new USFX Bible files to example assets:
eng-kjv-2006.usfx.xml,eng-asv.usfx.xml,eng-webu.usfx.xml - Updated asset manifest to include all new XML files
- Italics toggle now works with both OSIS and USFX formats
- Added 3 new USFX Bible files to example assets:
Documentation #
- Updated README acknowledgments to include eBible.org as a source for Bible XML files
Example Usage #
// USFX added text is tracked the same way as OSIS
for (final segment in verse.segments ?? []) {
if (segment.isAdded) {
// Render in italics (translator addition)
print('Italic: ${segment.text}');
} else if (segment.isJesus) {
// Render in red (Jesus' words)
print('Red: ${segment.text}');
}
}
0.2.3 Critical Bug Fix for Duplicate Verses #
Fixed #
- Critical bug fix - Fixed duplicate verses affecting all Bible versions
- OSIS parser fix: Added
verseEndedWithEIDflag to prevent duplicate verse insertion when processing<verse eID=""/>format (affects KJV and similar OSIS files) - Database schema fix: Added UNIQUE constraint on
(book_id, chapter_num, verse_num)in verses table to prevent duplicates at database level - Database version bumped to 4 with automatic migration that recreates tables and reparses data
- Both
parseBooks()andparseVerses()methods now handle eID format correctly
- OSIS parser fix: Added
- All 69 tests passing
Root Cause #
The duplicate verses issue had two contributing factors:
- OSIS parser was adding verses twice when encountering
<verse eID=""/>tags - Database lacked UNIQUE constraint, allowing duplicate rows even with
ConflictAlgorithm.ignore
Impact #
- Automatic fix: Existing databases will automatically upgrade to version 4 and reparse data without duplicates
- No manual intervention needed: Users don't need to manually delete database files
- Affects all versions: KJV, ASV, WEB, and any other Bible version will be fixed
- No breaking changes - fully backward compatible
0.2.2 TransChange Support for Added Text #
Added #
- TransChange support for OSIS format to track added/italicized text
- Parser now recognizes
<transChange type="added">tags in OSIS XML - New
transChangegetter onTextSegmentclass - New
isAddedconvenience getter to identify added text segments - Apps can now italicize or style text marked as translator additions
- Parser now recognizes
- Added comprehensive tests for transChange functionality
- Updated example app to demonstrate italicized text support with toggle switch
Example Usage #
// Check if a segment is added text (typically italicized)
for (final segment in verse.segments ?? []) {
if (segment.isAdded) {
// Render in italics
print('Italic: ${segment.text}');
} else {
print('Normal: ${segment.text}');
}
}
0.2.1 iOS Compatibility Fix #
0.2.0+1 Example App Update #
Changed #
- Updated example app to demonstrate red-letter Bible feature
- Added toggle switch to enable/disable red-letter display
- Jesus' words are now visually indicated with
[JESUS: ...]markers
0.2.0 Red-Letter Bible Support #
Added #
- Red-letter Bible support for OSIS and USFX formats
- New
TextSegmentclass for styled text segments with attributes segmentsfield inVerseclass for tracking speaker information and other attributes- Support for
<q who="Jesus">tags in OSIS XML to identify Jesus' words - Support for
<wj>(Words of Jesus) tags in USFX XML hasJesusWordsconvenience getter onVerseclass
- New
- Database persistence for segments
- New
verse_segmentstable for storing text segments - Automatic segment loading when retrieving verses from database
- Database version upgraded to 2 with migration support
- New
- Extensible design allows future support for other XML styling tags (italics, notes, poetry, etc.)
- Exported parser classes (
OsisParser,UsfxParser,ZefaniaParser) for direct use
Changed #
- OSIS parser now tracks quote tags and speaker attributes
- USFX parser now tracks wj tags and speaker attributes
Verseclass is backward compatible - existing code continues to workBibleRepositorynow persists and retrieves segments automatically- Database schema updated with proper foreign key constraints and indexes
Documentation #
- Added comprehensive design document at
/doc/red-letter-bible-support.md
Testing #
- Added 5 tests for OSIS red-letter parsing
- Added 5 tests for USFX red-letter parsing
- Added 5 tests for database segment persistence
- Added 29 tests for TextSegment serialization
- Added 1 test for cross-platform database support
- All 65 tests passing
0.1.0+4 Bug Fixes in USFX parser #
Bug Fixes #
- Fixed handling of footnotes and cross-references in USFX parser
0.1.0+3 Bug fixes and performance improvements #
Bug Fixes #
- Fixed USFX parser to properly handle chapter endings and ensure all chapters are added to books
- Fixed database handling in BibleRepository with proper null safety
Improvements #
- Enhanced BibleRepository with better database initialization and connection management
- Improved database operations with proper transaction handling and batch processing
- Added explicit database naming for better multi-Bible support
- Removed unused code and dependencies
0.1.0+2 Bug fix and documentation updates #
0.1.0+1 Bug fix and documentation updates #
0.1.0 Initial Release #
Features #
- Support for multiple Bible XML formats:
- OSIS (Open Scripture Information Standard)
- USFX (Unified Scripture Format XML)
- ZXBML (Zefania XML Bible Markup Language)
- Automatic format detection
- Memory-efficient XML parsing using proper async streams
- Production-ready with proper error handling and no debug statements
Bible Repository Features #
- SQLite database caching for improved performance
- Methods to retrieve books, chapters, and verses
- Verse retrieval by book and chapter
- Text search functionality across verses
Example App #
- Demonstrates both direct parsing and database approaches
- UI for selecting between different Bible formats
- Book and chapter selection interface
- Verse display with proper formatting and scrolling
- Search functionality for finding verses containing specific text