Skip to content

Commit

Permalink
Experiment with extension types
Browse files Browse the repository at this point in the history
  • Loading branch information
Pante committed Feb 19, 2024
1 parent e2e2a79 commit 42d7a05
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
1 change: 1 addition & 0 deletions flint/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ description: Analyzer lints used internally in Forus Labs' Dart & Flutter projec
version: 2.9.0
homepage: https://github.com/forus-labs/cauldron
repository: https://github.com/forus-labs/cauldron
topics: [lints]

environment:
sdk: '>=3.2.0 <4.0.0'
Expand Down
6 changes: 1 addition & 5 deletions sugar/lib/src/collection/aggregate/group_iterables.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ extension GroupableIterable<E> on Iterable<E> {
///
/// print(aggregate); // {'a': [('a', 1), ('a', 2)], 'b': [('b', 3)]}
/// ```
class Group<E> {

final Iterable<E> _iterable;

Group._(this._iterable);
extension type const Group<E>._(Iterable<E> _iterable) {

/// Groups the iterable's elements by keys returned by [by] before being folded using [as].
///
Expand Down
6 changes: 1 addition & 5 deletions sugar/lib/src/collection/aggregate/split_iterables.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ extension SplittableIterable<E> on Iterable<E> {
/// ```dart
/// [1, 2, 3, 4].split.by(size: 2); // [ [1, 2], [3, 4], [5] ]
/// ```
class Split<E> {

final Iterable<E> _iterable;

Split._(this._iterable);
extension type Split<E>._(Iterable<E> _iterable) {

/// Splits this iterable into lists of the given [size].
///
Expand Down
3 changes: 1 addition & 2 deletions sugar/lib/src/core/system/web_system.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:html';

import 'package:meta/meta.dart';
import 'package:web/web.dart';

// ignore_for_file: public_member_api_docs

Expand Down
6 changes: 4 additions & 2 deletions sugar/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: sugar
description: Forus Labs' standard library extension. Utilities for date-times, timezones, collections, monads & more.
topics: [datetime, timezone, utilities]

version: 4.0.0
homepage: https://github.com/forus-labs/cauldron
Expand All @@ -8,20 +9,21 @@ issue_tracker: https://github.com/forus-labs/cauldron/issues
documentation: https://pub.dev/documentation/sugar/latest/

environment:
sdk: '>=3.2.0 <4.0.0'
sdk: '>=3.3.0 <4.0.0'

dependencies:
ffi: ^2.0.1
js: ^0.7.0
meta: ^1.11.0
web: ^0.5.0

dev_dependencies:
coverage: ^1.6.3
flint: ^2.9.0
http: ^1.0.0
import_sorter: ^4.6.0
path: ^1.8.3
test: ^1.17.9
test: ^1.25.0
timezone: ^0.9.1

import_sorter:
Expand Down

0 comments on commit 42d7a05

Please sign in to comment.