Skip to content

Commit

Permalink
dart format
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensdemelo committed Jun 30, 2024
1 parent f3f7d6a commit 55761c9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion lib/src/formatters/cert_nascimento_input_formatter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import 'package:flutter/services.dart';
/// Formata o valor do campo com a mascara de Certidão de Nascimento: `XXXXXX XX XX XXXX X XXXXX XXX XXXXXXX XX`
class CertNascimentoInputFormatter extends TextInputFormatter {
@override
TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) {
TextEditingValue formatEditUpdate(
TextEditingValue oldValue, TextEditingValue newValue) {
// verifica o tamanho máximo do campo
if (newValue.text.length > 32) return oldValue;

Expand Down
8 changes: 4 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
version: "4.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -103,10 +103,10 @@ packages:
dependency: transitive
description:
name: lints
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
version: "4.0.0"
matcher:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
intl: ^0.19.0

dev_dependencies:
flutter_lints: ^3.0.0
flutter_lints: ^4.0.0
flutter_test:
sdk: flutter

Expand Down
8 changes: 5 additions & 3 deletions test/brasil_fields_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,14 @@ void main() {

testWidgets('CertNascimentoFormatter', (WidgetTester tester) async {
final textController = TextEditingController();
await tester.pumpWidget(boilerplate(CertNascimentoInputFormatter(), textController));
await tester.pumpWidget(
boilerplate(CertNascimentoInputFormatter(), textController));

await tester.enterText(find.byType(TextField), '11111122334444566666777888888899');
await tester.enterText(
find.byType(TextField), '11111122334444566666777888888899');
expect(textController.text, '111111 22 33 4444 5 66666 777 8888888 99');
});

testWidgets('HoraInputFormatter', (WidgetTester tester) async {
final textController = TextEditingController();
await tester.pumpWidget(boilerplate(HoraInputFormatter(), textController));
Expand Down

0 comments on commit 55761c9

Please sign in to comment.