checklist 0.1.4

  • Readme
  • Changelog
  • Installing
  • 60

pub package

Flutter ChecklistView #

Getting Started #

This package is a custom view that allows you to be able to re-order items in a list vertically. You can drag between lists, use it in a ScrollController (ListView,Column etc) and show and hide lists. To show Checkboxes pass in value to ChecklistItemView.

Example

Example #

  List<ChecklistObject> items = [];

  @override
  void initState() {
    super.initState();
    items.add(ChecklistObject(title: "Title 1",items: []));
    items.add(ChecklistObject(title: "Title 2",items: [
      ChecklistItemObject(title: "Item 1"),
      ChecklistItemObject(title: "Item 2"),
      ChecklistItemObject(title: "Item 3"),
      ChecklistItemObject(title: "Item 4")
    ]));
  }

  @override
  Widget build(BuildContext context) {
    List<ChecklistView> checklistsViews = new List();
    for (var i = 0; i < items.length; i++) {
      List<ChecklistItemView> subItems = new List();
      for(var j = 0; j < items[i].items.length;j++){
        subItems.add(ChecklistItemView(title: Card(child: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Text(items[i].items[j].title),
        )),
        canDrag:true,
        onDropItem: (oldListIndex,oldItemIndex,listIndex, itemIndex, state){
          //Update our local data
          setState(() {
            ChecklistItemObject object = items[oldListIndex].items[oldItemIndex];
            items[oldListIndex].items.removeAt(oldItemIndex);
            items[listIndex].items.insert(itemIndex, object);
          });
        },));
      }
      checklistsViews.add(ChecklistView(items: subItems,isOpen: items[i].isOpen,canDrag:true,onDropChecklist:(oldIndex,newIndex,state){
        //Update our local data
        setState(() {          
          ChecklistObject object = items[oldIndex];
          items.removeAt(oldIndex);
          items.insert(newIndex, object);
        });
      },title: Row(children: <Widget>[IconButton(icon: Icon(items[i].isOpen?Icons.arrow_drop_up:Icons.arrow_drop_down),onPressed: (){
        setState(() {
          items[i].isOpen = !items[i].isOpen;
        });
      },),Expanded(child: Text(items[i].title))],),));
    }
    return Scaffold(
      appBar: AppBar(),
        body: ChecklistListView(checklists: checklistsViews)
    );
  }

[0.1.4] - Fixed bugs #

  • Fixed all findRenderObject errors

  • Fixed blinking of item when drag is started

[0.1.3] - Added ability to block dragging on specific Checklists and ChecklistItems #

  • Basic functionality to drag and drop checklist in different ChecklistViews

Use this package as a library

1. Depend on it

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


dependencies:
  checklist: ^0.1.4

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

We analyzed this package on Jul 8, 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

Analysis suggestions

Package not compatible with SDK dart

Because:

  • checklist that is a package requiring null.

Health suggestions

Fix lib/ChecklistListView.dart. (-3.45 points)

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

line 5 col 8: Duplicate import.

line 7 col 7: This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: ChecklistListView.checklists, ChecklistListView.width, ChecklistListView.controller, ChecklistListView.scrollBottom, ChecklistListView.scrollTop, ChecklistListView.checklistCount, ChecklistListView.checklistItemCount, ChecklistListView.checklistBuilder, ChecklistListView.checklistItemBuilder

line 148 col 7: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 185 col 7: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 228 col 3: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

Fix lib/ChecklistItemView.dart. (-1 points)

Analysis of lib/ChecklistItemView.dart reported 2 hints:

line 15 col 7: This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: ChecklistItemView.checklist, ChecklistItemView.title, ChecklistItemView.index, ChecklistItemView.value, ChecklistItemView.onDropItem, ChecklistItemView.onTapItem, ChecklistItemView.canDrag, ChecklistItemView.onChanged, ChecklistItemView.onStartDragItem, ChecklistItemView.backgroundColor

line 95 col 10: This method overrides a method annotated as '@mustCallSuper' in 'AutomaticKeepAliveClientMixin', but doesn't invoke the overridden method.

Fix lib/ChecklistView.dart. (-1 points)

Analysis of lib/ChecklistView.dart reported 2 hints:

line 12 col 7: This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: ChecklistView.title, ChecklistView.items, ChecklistView.checklistState, ChecklistView.index, ChecklistView.isOpen, ChecklistView.canDrag, ChecklistView.footer, ChecklistView.onDropChecklist, ChecklistView.onTapChecklist, ChecklistView.onStartDragChecklist, ChecklistView.backgroundColor

line 91 col 10: This method overrides a method annotated as '@mustCallSuper' in 'AutomaticKeepAliveClientMixin', but doesn't invoke the overridden method.

Fix additional 3 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/ChecklistItemObject.dart (Run flutter format to format lib/ChecklistItemObject.dart.)
  • lib/ChecklistObject.dart (Run flutter format to format lib/ChecklistObject.dart.)
  • lib/checklist.dart (Run flutter format to format lib/checklist.dart.)

Maintenance issues and suggestions

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

exitCode: 255 stdout: Documenting checklist... Initialized dartdoc with 515 libraries in 89.9 seconds Generating docs for library ChecklistItemObject from package:checklist/ChecklistItemObject.dart... Generating docs for library ChecklistListView from package:checklist/ChecklistListView.dart... Generating docs for library ChecklistObject from package:checklist/ChecklistObject.dart... Generating docs for library ChecklistView from package:checklist/ChecklistView.dart... Generating docs for library checklist from package:checklist/ChecklistItemView.dart... Generating docs for library checklist from package:checklist/checklist.dart... Validating docs... Documented 6 public libraries in 19.7 seconds stderr: warning: unresolved doc reference [InheritedWidget] from ChecklistListView.ChecklistListViewState.build: (file:///tmp/pub-dartlang-dartdocKVZLOI/pkg/lib/ChecklistListView.dart:254:10) in documentation inherited from framework.State.build: (file:///flutter/packages/flutter/lib/src/widgets/framework.dart:1413:10) warning: unresolved doc reference [AnimatedWidget] from ChecklistListView.ChecklistListViewState.build: (file:///tmp/pub-dartlang-dartdocKVZLOI/pkg/lib/ChecklistListView.dart:254:10) in documentation inherited from framework.State.build: (file:///flutter/packages/flutter/lib/src/widgets/framework.dart:1413:10) warning: unresolved doc reference [InheritedWidget] from ChecklistView.ChecklistViewState.build: (file:///tmp/pub-dartlang-dartdocKVZLOI/pkg/lib/ChecklistView.dart:91:10) in documentation inherited from framework.State.build: (file:///flutter/packages/flutter/lib/src/widgets/framework.dart:1413:10) warning: unresolved doc reference [AnimatedWidget] from ChecklistView.ChecklistViewState.build: (file:///tmp/pub-dartlang-dartdocKVZLOI/pkg/lib/ChecklistView.dart:91:10) in documentation inherited from framework.State.build: (file:///flutter/packages/flutter/lib/src/widgets/framework.dart:1413:10) warning: checklist has no library level documentation comments, from checklist: (file:///tmp/pub-dartlang-dartdocKVZLOI/pkg/lib/ChecklistItemView.dart:1:9) warning: unresolved doc reference [InheritedWidget] from checklist.ChecklistItemViewState.build: (file:///tmp/pub-dartlang-dartdocKVZLOI/pkg/lib/ChecklistItemView.dart:95:10) in documentation inherited from framework.State.build: (file:///flutter/packages/flutter/lib/src/widgets/framework.dart:1413:10) warning: unresolved doc reference [AnimatedWidget] from checklist.ChecklistItemViewState.build: (file:///tmp/pub-dartlang-dartdocKVZLOI/pkg/lib/ChecklistItemView.dart:95:10) in documentation inherited from framework.State.build: (file:///flutter/packages/flutter/lib/src/widgets/framework.dart:1413:10) warning: checklist has no library level documentation comments, from checklist: (file:///tmp/pub-dartlang-dartdocKVZLOI/pkg/lib/checklist.dart:1:9) error: failed to write file at: checklist/checklist-library.html for symbol checklist: (file:///tmp/pub-dartlang-dartdocKVZLOI/pkg/lib/checklist.dart:1:9) conflicting with file already generated by checklist: (file:///tmp/pub-dartlang-dartdocKVZLOI/pkg/lib/ChecklistItemView.dart:1:9) Dartdoc generates a path and filename to write to for each symbol. checklist conflicts with another symbol in the generated path, and therefore can not be written out. Changing the name, library name, or class name (if appropriate) of one of the conflicting items can resolve the conflict. Alternatively, use the @nodoc tag in one symbol's documentation comments to hide it. found 8 warnings and 1 error Unhandled exception: dartdoc encountered 1 errors while processing. #0 Dartdoc.generateDocs (package:dartdoc/dartdoc.dart:225:9)

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.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and checklist.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <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 2.1.0-nullsafety
Dev dependencies
flutter_test