bible_plus 0.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 50

Introduction #

BiblePlus is a dart library to work with PDB bible files. It's heavily inspired by the bibleplus java library with improvement of implicit lazy loading and exception handling.

Example #

See example/main.dart

import 'package:bible_plus/bible_plus.dart';

void main() {
  BiblePlus bible = new BiblePlus('/path/to/bible.pdb');
  try {
    bible.loadVersionInfo();
  } on Exception catch (e) {
    // Error
    print(e);
  }
  // At this point we can access some basic information,
  // such as the bible version name and version info.
  // We can also have the list of book names at this point.

  // Get the version name of the bible
  String versionName = bible.versionName;
  print(versionName); // => King James Version

  // Get the version info of the bible
  String versionInfo = bible.versionInfo;
  print(versionInfo);

  // Get the total number of books in the bible
  int bookCount = bible.totalBooks;
  print(bookCount); // => 66

  // Get the BibleBook object. The line below returns Genesis
  BibleBook bGen = bible.books[0];

  // Get the full name of the book
  String fullName = bGen.fullName;
  print(fullName); // => 'Genesis'

  // Get the shot name of the book
  String shortName = bGen.shortName;
  print(shortName); // => 'Gen'

  // Get the total number of chapters in the book
  int totalChapters = bGen.totalChapters;
  print(totalChapters); // => 50

  // Get the total number of verses in the chapter
  int chapter = 1;
  int totalVerses = bGen.getTotalVerses(chapter);
  print(totalVerses); // => 31

  // Get the verse text only
  int verse = 1;
  String verseText = bGen.getVerse(chapter, verse);
  print(verseText); // => 'In the beginning...'

  // Get the chapter title, or verse title, together with
  // the verse text. See the documentation of the return
  // value in BibleBook
  List<String> sb = bGen.getCompleteVerse(chapter, verse);
  print(sb.join('\n'));
  // => 'In the beginning...\n\nChapter 1\nGenesis'
}

API Doc #

More detailed API documentation available here

0.1.1 2018-05-15 #

  • [Bug Fix] Fixed the implementation for reading byte shifted pdb.
  • [Bug Fix] Fixed the close bracket ascii code so that there's no more word separator before close bracket.

0.1.0 2018-05-04 #

  • First reviewed release

example/main.dart

import 'package:bible_plus/bible_plus.dart';

void main() {
  BiblePlus bible = new BiblePlus('/path/to/bible.pdb');
  try {
    bible.loadVersionInfo();
  } on Exception catch (e) {
    // Error
    print(e);
  }
  // At this point we can access some basic information,
  // such as the bible version name and version info.
  // We can also have the list of book names at this point.

  // Get the version name of the bible
  String versionName = bible.versionName;
  print(versionName); // => King James Version

  // Get the version info of the bible
  String versionInfo = bible.versionInfo;
  print(versionInfo);

  // Get the total number of books in the bible
  int bookCount = bible.totalBooks;
  print(bookCount); // => 66

  // Get the BibleBook object. The line below returns Genesis
  BibleBook bGen = bible.books[0];

  // Get the full name of the book
  String fullName = bGen.fullName;
  print(fullName); // => 'Genesis'

  // Get the shot name of the book
  String shortName = bGen.shortName;
  print(shortName); // => 'Gen'

  // Get the total number of chapters in the book
  int totalChapters = bGen.totalChapters;
  print(totalChapters); // => 50

  // Get the total number of verses in the chapter
  int chapter = 1;
  int totalVerses = bGen.getTotalVerses(chapter);
  print(totalVerses); // => 31

  // Get the verse text only
  int verse = 1;
  String verseText = bGen.getVerse(chapter, verse);
  print(verseText); // => 'In the beginning...'

  // Get the chapter title, or verse title, together with
  // the verse text. See the documentation of the return
  // value in BibleBook
  List<String> sb = bGen.getCompleteVerse(chapter, verse);
  print(sb.join('\n'));
  // => 'In the beginning...\n\nChapter 1\nGenesis'
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  bible_plus: ^0.1.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:bible_plus/bible_plus.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
26
Health:
Code health derived from static analysis. [more]
81
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
65
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Jan 25, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Health suggestions

Fix lib/src/bible_plus.dart. (-8.63 points)

Analysis of lib/src/bible_plus.dart reported 18 hints, including:

line 64 col 18: Unnecessary new keyword.

line 64 col 32: Unnecessary new keyword.

line 75 col 13: Unnecessary new keyword.

line 80 col 13: Unnecessary new keyword.

line 85 col 13: Unnecessary new keyword.

Fix lib/src/bible_book.dart. (-6.31 points)

Analysis of lib/src/bible_book.dart reported 13 hints, including:

line 72 col 71: Unnecessary new keyword.

line 87 col 31: Unnecessary new keyword.

line 93 col 13: Unnecessary new keyword.

line 103 col 23: Unnecessary new keyword.

line 109 col 29: Unnecessary new keyword.

Fix lib/src/pdb_access.dart. (-3.45 points)

Analysis of lib/src/pdb_access.dart reported 7 hints, including:

line 23 col 17: Unnecessary new keyword.

line 25 col 18: Unnecessary new keyword.

line 30 col 15: Unnecessary new keyword.

line 41 col 27: DO use curly braces for all flow control structures.

line 66 col 20: Unnecessary new keyword.

Fix additional 3 files with analysis or formatting issues. (-1.50 points)

Additional issues in the following files:

  • lib/src/util.dart (2 hints)
  • lib/src/pdb_file_stream.dart (1 hint)
  • lib/src/pdb_header.dart (Run dartfmt to format lib/src/pdb_header.dart.)

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is getting outdated. (-14.79 points)

The package was last published 59 weeks ago.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.23.0 <3.0.0
Dev dependencies
test ^1.5.1