Skip to content

Commit

Permalink
Merge pull request #23 from edufolly/dev
Browse files Browse the repository at this point in the history
Version 0.3.8
  • Loading branch information
edufolly authored Oct 12, 2021
2 parents 2ba60df + d3e1857 commit 1510edb
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.3.7+74"
version: "0.3.8+75"
font_awesome_flutter:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A new Flutter project.

publish_to: 'none'

version: 0.3.7+74
version: 0.3.8+75

environment:
sdk: ">=2.14.0 <3.0.0"
Expand Down
8 changes: 7 additions & 1 deletion lib/fields/list_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class ListField<T extends AbstractModel<Object>,
String emptyListText = 'Sem %s até o momento.',
InputDecoration? decoration,
EdgeInsets padding = const EdgeInsets.all(8),
int Function(T a, T b)? listSort,
Key? key,
}) : super(
key: key,
Expand Down Expand Up @@ -112,6 +113,11 @@ class ListField<T extends AbstractModel<Object>,

if (returned != null) {
field.value![index] = returned;

field.value!.sort(listSort ??
(T a, T b) =>
a.toString().compareTo(b.toString()));

field.didChange(field.value);
}
}
Expand Down Expand Up @@ -167,7 +173,7 @@ class ListField<T extends AbstractModel<Object>,
}
}

field.value!.sort(
field.value!.sort(listSort ??
(T a, T b) => a.toString().compareTo(b.toString()));

field.didChange(field.value);
Expand Down
6 changes: 6 additions & 0 deletions lib/util/folly_validators.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,10 @@ class FollyValidators {
///
static String? stringNotEmpty(String string) =>
string.isNotEmpty ? null : 'O campo não pode ser vazio.';

///
///
///
static String? notNull(dynamic value) =>
value == null ? 'O campo não pode ser nulo.' : null;
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: folly_fields
description: Basic form fields and utilities.
version: 0.3.7+74
version: 0.3.8+75
# author:
homepage: https://edufolly.github.io/folly_fields/

Expand Down

0 comments on commit 1510edb

Please sign in to comment.