dart_extension_methods 0.1.0

  • Readme
  • Changelog
  • Installing
  • 66

Dart Extension Methods #

Set of useful extension methods

Collections #

  • isNullOrEmpty
  • isNotNullOrEmpty
  • mapToList

Strings #

  • isNullOrEmpty
  • isNotNullOrEmpty

DateTime #

  • isToday
  • isYesterday
  • isThisWeek
  • isThisMonth
  • isThisYear
  • noon
  • minutesAgo
  • isSameDay

Logging #

  • log*

[0.1.0] - Initial release #

  • Add base extensions

Use this package as a library

1. Depend on it

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


dependencies:
  dart_extension_methods: ^0.1.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:dart_extension_methods/collections.dart';
import 'package:dart_extension_methods/datetime.dart';
import 'package:dart_extension_methods/enums.dart';
import 'package:dart_extension_methods/flutter/material.dart';
import 'package:dart_extension_methods/log.dart';
import 'package:dart_extension_methods/strings.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
44
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
66
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6

Maintenance issues and suggestions

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

exitCode: 255 stdout: parsing /tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/log.dart... parsing /tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/flutter/material.dart... parsing /tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/strings.dart... parsing /tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/datetime.dart... parsing /tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/collections.dart... parsing /tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/enums.dart... parsing /dart-sdk/lib/core/core.dart... parsing /dart-sdk/lib/collection/collection.dart... parsing /dart-sdk/lib/internal/internal.dart... parsing /dart-sdk/lib/async/async.dart... parsing /dart-sdk/lib/convert/convert.dart... parsing /dart-sdk/lib/typed_data/typed_data.dart... parsing /dart-sdk/lib/math/math.dart... parsing /dart-sdk/lib/developer/developer.dart... parsing /dart-sdk/lib/isolate/isolate.dart... parsing /dart-sdk/lib/ffi/ffi.dart... parsing /dart-sdk/lib/html/dart2js/html_dart2js.dart... parsing /dart-sdk/lib/html/html_common/html_common_dart2js.dart... parsing /dart-sdk/lib/web_gl/dart2js/web_gl_dart2js.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/native_typed_data.dart... [...] parsing /dart-sdk/lib/_http/http.dart... parsing /dart-sdk/lib/io/io.dart... parsing /dart-sdk/lib/js/dart2js/js_dart2js.dart... parsing /dart-sdk/lib/js/_js.dart... parsing /dart-sdk/lib/mirrors/mirrors.dart... parsing /dart-sdk/lib/html/dartium/nativewrappers.dart... parsing /dart-sdk/lib/cli/cli.dart... parsing /dart-sdk/lib/wasm/wasm.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/js_primitives.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart... Initialized dartdoc with 43 libraries in 27.1 seconds documenting dart_extension_methods Generating docs for library dart_extension_methods from package:dart_extension_methods/log.dart... Generating docs for library dart_extension_methods from package:dart_extension_methods/strings.dart... Generating docs for library dart_extension_methods from package:dart_extension_methods/datetime.dart... Generating docs for library dart_extension_methods from package:dart_extension_methods/collections.dart... Generating docs for library dart_extension_methods from package:dart_extension_methods/enums.dart... Generating docs for library material from package:dart_extension_methods/flutter/material.dart... Validating docs... Documented 6 public libraries in 1.8 seconds stderr: Documenting dart_extension_methods... warning: dart_extension_methods has no library level documentation comments, from dart_extension_methods: (file:///tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/log.dart:7:9) warning: no canonical library found for dart_extension_methods.LogExtensionsLogLevel.hashCode, not linking, from dart_extension_methods.LogExtensionsLogLevel.hashCode: (file:///dart-sdk/lib/core/object.dart:94:20) warning: no canonical library found for dart_extension_methods.LogExtensionsLogLevel.runtimeType, not linking, from dart_extension_methods.LogExtensionsLogLevel.runtimeType: (file:///dart-sdk/lib/core/object.dart:116:21) warning: no canonical library found for dart_extension_methods.LogExtensionsLogLevel.noSuchMethod, not linking, from dart_extension_methods.LogExtensionsLogLevel.noSuchMethod: (file:///dart-sdk/lib/core/object.dart:111:20) warning: no canonical library found for dart_extension_methods.LogExtensionsLogLevel.==, not linking, from dart_extension_methods.LogExtensionsLogLevel.==: (file:///dart-sdk/lib/core/object.dart:62:26) warning: dart_extension_methods has no library level documentation comments, from dart_extension_methods: (file:///tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/strings.dart:7:9) error: failed to write file at: dart_extension_methods/dart_extension_methods-library.html for symbol dart_extension_methods: (file:///tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/strings.dart:7:9) conflicting with file already generated by dart_extension_methods: (file:///tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/log.dart:7:9) Dartdoc generates a path and filename to write to for each symbol. dart_extension_methods 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. warning: dart_extension_methods has no library level documentation comments, from dart_extension_methods: (file:///tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/datetime.dart:7:9) error: failed to write file at: dart_extension_methods/dart_extension_methods-library.html for symbol dart_extension_methods: (file:///tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/datetime.dart:7:9) conflicting with file already generated by dart_extension_methods: (file:///tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/strings.dart:7:9) warning: no canonical library found for dart_extension_methods.DateUtils.toString, not linking, from dart_extension_methods.DateUtils.toString: (file:///dart-sdk/lib/core/object.dart:99:19) warning: dart_extension_methods has no library level documentation comments, from dart_extension_methods: (file:///tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/collections.dart:7:9) error: failed to write file at: dart_extension_methods/dart_extension_methods-library.html for symbol dart_extension_methods: (file:///tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/collections.dart:7:9) conflicting with file already generated by dart_extension_methods: (file:///tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/datetime.dart:7:9) warning: dart_extension_methods has no library level documentation comments, from dart_extension_methods: (file:///tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/enums.dart:7:9) error: failed to write file at: dart_extension_methods/dart_extension_methods-library.html for symbol dart_extension_methods: (file:///tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/enums.dart:7:9) conflicting with file already generated by dart_extension_methods: (file:///tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/collections.dart:7:9) error: failed to write file at: dart_extension_methods/IterableExtensions.html for symbol dart_extension_methods.IterableExtensions: (file:///tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/enums.dart:9:11) conflicting with file already generated by dart_extension_methods.IterableExtensions: (file:///tmp/pub-dartlang-dartdocFNFBCS/pkg/lib/collections.dart:9:11) warning: dartdoc generated a broken link to: dart_extension_methods/DateTimeExtensions.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateTimeExtensions/daysDifference.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateTimeExtensions/isFuture.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateTimeExtensions/isSameDay.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateTimeExtensions/isThisWeek.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateTimeExtensions/isThisYear.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateTimeExtensions/isToday.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateTimeExtensions/isYesterday.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateTimeExtensions/minutesAgo.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateTimeExtensions/noon.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateUtils-class.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateUtils/DateUtils.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateUtils/daysDifference.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateUtils/isFuture.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateUtils/isSameDay.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateUtils/isThisWeek.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateUtils/isThisYear.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateUtils/isToday.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateUtils/isYesterday.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateUtils/now.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateUtils/toNoon.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateUtils/today.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/DateUtils/yesterday.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/IterableExtensions/isNotNullOrEmpty.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/IterableExtensions/isNullOrEmpty.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/IterableExtensions/mapToList.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/ListExtensions.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/ListExtensions/isNotNullOrEmpty.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/ListExtensions/isNullOrEmpty.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/ListExtensions/swap.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/LogDelegate.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/LogExtensions.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/LogExtensions/logd.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/LogExtensions/loge.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/LogExtensions/logi.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/LogExtensions/logv.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/LogExtensionsLogLevel-class.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/LogExtensionsLogLevel/toString.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/StringExtensions.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/StringExtensions/isNotNullOrEmpty.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/StringExtensions/isNullOrEmpty.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/logDelegate.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/logMessage.html (from index.json) warning: dartdoc generated a broken link to: dart_extension_methods/setLogDelegate.html (from index.json) found 54 warnings and 5 errors Unhandled exception: dartdoc encountered 5 errors while processing. #0 Dartdoc.generateDocs (package:dartdoc/dartdoc.dart:202:7)

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.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and dart_extension_methods.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.6.0 <3.0.0
Dev dependencies
test ^1.5.3