From 56bbfbdba37b18fd7241a6913996082e33a19336 Mon Sep 17 00:00:00 2001 From: Ben-hur Santos Ott Date: Mon, 12 Nov 2018 03:04:06 -0200 Subject: [PATCH] fix(0.7.0): removing braces from anon func --- .../lib/flutter_masked_text.dart | 14 ++++----- .../masked_text_sample/test/widget_test.dart | 30 ------------------- lib/flutter_masked_text.dart | 4 +-- 3 files changed, 9 insertions(+), 39 deletions(-) delete mode 100644 example/masked_text_sample/test/widget_test.dart diff --git a/example/masked_text_sample/lib/flutter_masked_text.dart b/example/masked_text_sample/lib/flutter_masked_text.dart index f20d7a7..4a29252 100644 --- a/example/masked_text_sample/lib/flutter_masked_text.dart +++ b/example/masked_text_sample/lib/flutter_masked_text.dart @@ -24,8 +24,8 @@ class MaskedTextController extends TextEditingController { Map translator; - Function afterChange = ({String previous, String next}) {}; - Function beforeChange = ({String previous, String next}) { + Function afterChange = (String previous, String next) {}; + Function beforeChange = (String previous, String next) { return true; }; @@ -114,10 +114,10 @@ class MaskedTextController extends TextEditingController { class MoneyMaskedTextController extends TextEditingController { MoneyMaskedTextController( {double initialValue = 0.0, - this.decimalSeparator = ',', - this.thousandSeparator = '.', - this.rightSymbol = '', - this.leftSymbol = ''}) { + this.decimalSeparator = ',', + this.thousandSeparator = '.', + this.rightSymbol = '', + this.leftSymbol = ''}) { _validateConfig(); this.addListener(() { @@ -198,7 +198,7 @@ class MoneyMaskedTextController extends TextEditingController { String _applyMask(double value) { String textRepresentation = - value.toStringAsFixed(2).replaceAll('.', this.decimalSeparator); + value.toStringAsFixed(2).replaceAll('.', this.decimalSeparator); List numberParts = []; diff --git a/example/masked_text_sample/test/widget_test.dart b/example/masked_text_sample/test/widget_test.dart deleted file mode 100644 index b2ac85b..0000000 --- a/example/masked_text_sample/test/widget_test.dart +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility that Flutter provides. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:masked_text_sample/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(new MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -} diff --git a/lib/flutter_masked_text.dart b/lib/flutter_masked_text.dart index 0507368..4a29252 100644 --- a/lib/flutter_masked_text.dart +++ b/lib/flutter_masked_text.dart @@ -24,8 +24,8 @@ class MaskedTextController extends TextEditingController { Map translator; - Function afterChange = ({String previous, String next}) {}; - Function beforeChange = ({String previous, String next}) { + Function afterChange = (String previous, String next) {}; + Function beforeChange = (String previous, String next) { return true; };