starreviews 1.0.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 47

starreviews #

A flutter package for displaying detailed star reviews

Install #

dependencies:  
  starreviews: ^1.0.4
$  flutter pub get
import  'package:starreviews/starreviews.dart';

Usage #

List<String> _names = ['Star 5', 'Star 4', 'Star 3', 'Star 2', 'Star 1'];  
List<double> _values = [0.5, 0.2, 0.8, 0.5, 0.1];
StarReviews(  
    total: 20,  
    starNames: _names,  
    values: _values,  
    showPercentage: true,  
    average: 3.2,
)
StarReviewsHorizontal(
    total: 30,
    starNames: _names,
    showProgressBarBorder: false,
    valueColor: Colors.black,
    progressBarBackgroundColor: Colors.grey.withOpacity(0.4),
    values: _values,
    showPercentage: true,
    starColor: Colors.black,
    average: 4.2,
)

Customization #

Here is a list of properties available to customize the widget:

| Name | Type | Description | |:------------------: |:---------------: |:------------------------------------------: | | total| int| total numbers of reviews | | showHeader| bool| if false, hides header | | showBottom| bool| if false, hides bottom reviews | | showPercentage| bool| if false, hides rating number | | starNames| List

Contributions #

Contributions of any kind are more than welcome! Feel free to fork and improve in any way you want, make a pull request, or open an issue.

Changelog #

All notable changes to this project will be documented in this file.

1.0.0 - 2020-05-02 #

Added #

  • Initial Commit

1.0.1 - 2020-05-02 #

Changed #

  • Changed average star display

1.0.2 - 2020-06-22 #

Changed #

  • Added dynamic number feature
  • Added a new design StarReviewsHorizontal

1.0.3 - 2020-06-22 #

Changed #

  • Added new params for customizable

1.0.4 - 2020-06-22 #

Changed #

  • Added a new param for customizable

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:starreviews/starreviews.dart';

void main() => runApp(App());

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

class MyApp extends StatelessWidget {

List<String> _names = ['Star 5', 'Star 4', 'Star 3', 'Star 2', 'Star 1'];
List<double> _values = [0.1, 0.3, 0.4, 0.1, 0.1];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: Container(
          padding: const EdgeInsets.all(16),
          child: Column(
            children: <Widget>[
              StarReviews(
                total: 30,
                starNames: _names,
                values: _values,
                showPercentage: true,
                average: 5,
              ),
              SizedBox(height: 30,),
            StarReviewsHorizontal(
              total: 30,
              starNames: _names,
              showProgressBarBorder: false,
              valueColor: Colors.black,
              progressBarBackgroundColor: Colors.grey.withOpacity(0.4),
              values: _values,
              showPercentage: true,
              starColor: Colors.black,
              average: 4.2,
            )
          ],
          ),
        )
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  starreviews: ^1.0.4

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

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

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Health issues and suggestions

Fix lib/starreviews.dart. (-58.02 points)

Analysis of lib/starreviews.dart failed with 3 errors, 1 hint:

line 6 col 8: Target of URI doesn't exist: 'file:///D:/GitHub/starreviews/lib/progress_bar/progress_bar_layout.dart'.

line 124 col 27: The method 'ProgressBarLayout' isn't defined for the type 'StarReviews'.

line 243 col 38: This requires the 'spread-collections' experiment to be enabled.

line 3 col 8: Unused import: 'dart:math'.

Format lib/progress_bar/progress_bar.dart.

Run flutter format to format lib/progress_bar/progress_bar.dart.

Format lib/progress_bar/progress_bar_layout.dart.

Run flutter format to format lib/progress_bar/progress_bar_layout.dart.

Format lib/star_display.dart.

Run flutter format to format lib/star_display.dart.

Maintenance issues and suggestions

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.

Make sure dartdoc successfully runs on your package's source files. (-10 points)

exitCode: 255 stdout: Documenting starreviews... stderr: Unhandled exception: fatal error: unable to locate the input directory at /D:/GitHub/starreviews/lib/progress_bar. #0 PubPackageMeta.fromDir (package:dartdoc/src/package_meta.dart:209:7) #1 PubPackageMeta.fromFilename (package:dartdoc/src/package_meta.dart:198:27) #2 PubPackageBuilder._packageMetasForFiles (package:dartdoc/src/model/package_builder.dart:247:52) #3 PubPackageBuilder._parseLibraries (package:dartdoc/src/model/package_builder.dart:287:17)

The package description is too short. (-6 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.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
percent_indicator ^2.1.1 2.1.5
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test