journey_path 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 65

JourneyPath Package #

A flutter package that draws a simple journey path with informational cards. If you have more cards than can appear on screen do not worry! It's a scrollable widget!

Screenshots #

How to use? #

Add the following to your pubspec.yaml file:

dependencies:
  journey_path: ^1.0.1

Usage #

You are going to need to create a timeline (e.g the verical line which you can specify the color and the thickness of the line).

final Timeline timeline = Timeline(
    color: Colors.grey,
    thickness: 2.0,
  );

You will have to specify the dot that will be in top of the vertical line. You can specify the color of which will stay at begin and at the end with the edgeColor. Also the space from the next dots. You can specify the size between all the middles dots and it's colors.

  final ConnectedDot connectedDot = ConnectedDot(
    number: 4,
    edgeColor: Colors.red,
    spaceBetween: 150.0,
    edgeSize: 70,
    middleColorDots: Colors.green,
  );
);

Right here you want to customize the lines of which dot that will connect to each card.

  final ConnectedLine connectedLine = ConnectedLine(
    size: 30,
    color: Colors.grey,
  );

Finally specify of what you want to put on the cards, their size and color

  final InformationCard informationCard = InformationCard(
    height: 60,
    width: 120,
    color: Colors.blue[100],
    list: [
      InformationCardDetails(name: 'name1', description: 'description1'),
      InformationCardDetails(name: 'name2', description: 'description2'),
      InformationCardDetails(name: 'name3', description: 'description3'),
      InformationCardDetails(name: 'name4', description: 'description4'),
    ],
  );

And then put it all together!

return Scaffold(
      appBar: AppBar(
        title: const Text('Journey Path'),
      ),
      body: JourneyPath(
        timeline: timeline,
        connectedDot: connectedDot,
        connectedLine: connectedLine,
        listInformationCard: informationCard,
      ),
    );

Contributing #

Pull requests and improvements are welcome!

LICENSE #

MIT Licence

[1.0.1] - 31/05/2020 #

  • Update readme
  • fixing example
  • Splitting files

[1.0.0] - 30/05/2020 #

  • Initial version

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:journey_path/journey_path.dart';
import 'package:journey_path/models/models.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  final Timeline timeline = Timeline(
    color: Colors.grey,
    thickness: 2.0,
  );

  final ConnectedDot connectedDot = ConnectedDot(
    number: 4,
    edgeColor: Colors.red,
    spaceBetween: 150.0,
    edgeSize: 70,
    middleColorDots: Colors.green,
  );

  final ConnectedLine connectedLine = ConnectedLine(
    size: 30,
    color: Colors.grey,
  );

  final InformationCard informationCard = InformationCard(
    height: 60,
    width: 120,
    color: Colors.blue[100],
    list: [
      InformationCardDetails(name: 'name1', description: 'description1'),
      InformationCardDetails(name: 'name2', description: 'description2'),
      InformationCardDetails(name: 'name3', description: 'description3'),
      InformationCardDetails(name: 'name4', description: 'description4'),
    ],
  );

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Journey Path'),
      ),
      body: JourneyPath(
        timeline: timeline,
        connectedDot: connectedDot,
        connectedLine: connectedLine,
        listInformationCard: informationCard,
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  journey_path: ^1.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support 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:journey_path/journey_path.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
30
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]
65
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [journey_path] that is in a package requiring null.

Health issues and suggestions

Document public APIs. (-0.36 points)

45 out of 46 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.2 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test