vb_noticeboard 1.0.0

vb_noticeboard #

A simple Dart wrapper for fetching, parsing and extracting notices from Visva-Bharati, Santiniketan's Official website

Show some ❤️ by putting ⭐

what does it do ? #

  • Can fetch list of notices from Visva-Bharati, Santiniketan's Official Website
  • Parse them and extract them from html page
  • Clean up data and convert it to Map<String, Map<String, String>>
  • Can store processed data in JSON file
  • Can read data back from JSON file and convert it to Map<String, Map<String, String>>, so that it can be used again

how to use it ? #

Fetching Notices : #

FetchNotice().fetch().then(
        (value) {
            // more code coming
        },
        onError: (e) => print(e),
      );

Parsing HTML page to Map<String, Map<String, String>> :

ParseNotice().parseIt(value);

Storing parsed Notices : #

StoreNotice.storeIt('data.json', ParseNotice().parseIt(value)).then(
        (val) => print(val ? 'Success' : 'Failure'),
        onError: (e) => print(e),
);

Extracting Notices from JSON : #

ExtractFromJson.extractIt('data.json').then(
    (data) => print(data),
    onError: (e) => print(e),
);

Merging up all of them : #

FetchNotice().fetch().then(
        (value) =>
            StoreNotice.storeIt('data.json', ParseNotice().parseIt(value)).then(
              (val) => print(val ? 'Success' : 'Failure'),
              onError: (e) => print(e),
            ),
        onError: (e) => print(e),
      );

ExtractFromJson.extractIt('data.json').then(
    (data) => print(data),
    onError: (e) => print(e),
    );

Make sure you've imported vb_noticeboard.dart

import 'package:vb_noticeboard/vb_noticeboard.dart';

Hoping it was helpful 😄

v1.0.0 #

  • Fetches html web page over http from here
  • Parses web page, extracts list of notices
  • Processes data and returns Map<String, Map<String, String>>, in case of success
  • Can store it in JSON format file
  • Can read from JSON file, and convert it back to Map<String, Map<String, String>>

example/example.dart

import 'package:vb_noticeboard/vb_noticeboard.dart';

main() {
  FetchNotice().fetch().then(
        (value) =>
            StoreNotice.storeIt('data.json', ParseNotice().parseIt(value)).then(
              (val) => print(val ? 'Success' : 'Failure'),
              onError: (e) => print(e),
            ),
        onError: (e) => print(e),
      );
  ExtractFromJson.extractIt('data.json').then(
    (data) => print(data),
    onError: (e) => print(e),
  );
}

Use this package as a library

1. Depend on it

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


dependencies:
  vb_noticeboard: ^1.0.0

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:vb_noticeboard/vb_noticeboard.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
20
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
60
Learn more about scoring.

We analyzed this package on Aug 18, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, other

Primary library: package:vb_noticeboard/vb_noticeboard.dart with components: io.

Health suggestions

Fix lib/src/fetch_notice.dart. (-0.50 points)

Analysis of lib/src/fetch_notice.dart reported 1 hint:

line 12 col 22: Use = to separate a named parameter from its default value.

Format lib/src/extract_from_json.dart.

Run dartfmt to format lib/src/extract_from_json.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
html ^0.14.0+2 0.14.0+2
Transitive dependencies
charcode 1.1.2
csslib 0.16.1
path 1.6.4
source_span 1.5.5
term_glyph 1.1.0