diff --git a/.gitignore b/.gitignore
index 446ed0d..b60b215 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,8 +3,10 @@
.packages
.pub/
+.idea
build/
ios/.generated/
ios/Flutter/Generated.xcconfig
ios/Runner/GeneratedPluginRegistrant.*
+
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
deleted file mode 100644
index 30aa626..0000000
--- a/.idea/codeStyles/Project.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/Dart_Packages.xml b/.idea/libraries/Dart_Packages.xml
index d96f80d..a2b8513 100644
--- a/.idea/libraries/Dart_Packages.xml
+++ b/.idea/libraries/Dart_Packages.xml
@@ -2,66 +2,31 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/libraries/Dart_SDK.xml b/.idea/libraries/Dart_SDK.xml
deleted file mode 100644
index ff827be..0000000
--- a/.idea/libraries/Dart_SDK.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/Flutter_Plugins.xml b/.idea/libraries/Flutter_Plugins.xml
deleted file mode 100644
index b0f6971..0000000
--- a/.idea/libraries/Flutter_Plugins.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index de732b4..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index 228130c..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 35eb1dd..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 681cc5a..37fa503 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -2,7 +2,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -20,10 +91,10 @@
-
-
+
+
-
+
@@ -32,22 +103,19 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
@@ -55,8 +123,8 @@
-
-
+
+
@@ -66,22 +134,10 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -99,16 +155,6 @@
-
-
-
-
-
-
-
-
-
-
@@ -138,18 +184,20 @@
-
-
+
+
+
+
-
-
+
+
@@ -166,9 +214,6 @@
-
-
-
@@ -181,16 +226,14 @@
-
-
-
-
-
+
+
+
@@ -199,7 +242,7 @@
-
+
@@ -577,8 +620,7 @@
-
-
+
@@ -592,7 +634,7 @@
-
+
@@ -618,12 +660,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -641,7 +740,6 @@
-
@@ -661,19 +759,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -688,20 +774,13 @@
-
-
-
-
-
-
-
-
+
-
+
@@ -711,7 +790,6 @@
-
@@ -731,19 +809,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -758,14 +824,7 @@
-
-
-
-
-
-
-
-
+
@@ -779,7 +838,7 @@
-
+
@@ -800,20 +859,12 @@
-
-
-
-
-
-
-
-
+
-
@@ -824,7 +875,7 @@
-
+
@@ -841,7 +892,6 @@
-
@@ -853,20 +903,13 @@
-
-
-
-
-
-
-
-
+
-
+
@@ -883,7 +926,6 @@
-
@@ -907,7 +949,7 @@
-
+
@@ -959,59 +1001,24 @@
-
-
-
-
-
-
-
-
+
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -1027,8 +1034,7 @@
-
-
+
@@ -1036,6 +1042,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c4b5685..4fb0856 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,14 @@
+## [0.8.0] - 2019-fev-24
+
+### Added
+
+- Adding `precision` to `MoneyMaskedTextController`.
+
+### Fixed
+
+- Fixing `initialValue` in `MoneyMaskedTextController`.
+- Fixing crash when call `updateText` in `MaskedTextController` with `null` value. (thanks to [Israel Ibarra](https://github.com/ElZombieIsra))
+
## [0.7.0] - 2018-nov-12
- Adding `beforeChange` and `afterChange` hooks.
diff --git a/Makefile b/Makefile
index 2c0d4f5..523ad1e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,5 @@
-publish:
- flutter test && flutter packages pub publish
-
-copy-to-sample:
- cp lib/flutter_masked_text.dart example/masked_text_sample/lib/flutter_masked_text.dart
+validate:
+ flutter test
-prepare:
- make copy-to-sample
\ No newline at end of file
+publish:
+ make validate && flutter packages pub publish
\ No newline at end of file
diff --git a/README.md b/README.md
index 6ddb576..efa7a8b 100644
--- a/README.md
+++ b/README.md
@@ -230,13 +230,27 @@ controller.afterChange = (String masked, double raw) {
};
```
+### Defining decimal places [v0.8.0+]
+
+You can define the number of decimal places using the `precision` prop:
+
+```dart
+var controller = new MoneyMaskedTextController(precision: 3);
+controller.updateValue(123.45);
+
+print(controller.text); //<-- 123,450
+```
+
## Using default TextEditingController
The MaskedTextController and MoneyMaskedTextController extends TextEditingController. You can use all default native methods from this class.
+## Samples
+
+You can check some code samples in this repo: [flutter-masked-text-samples](https://github.com/benhurott/flutter-masked-text-samples)
+
## TODO
- [x] Custom translations
- [x] Money Mask
- [ ] Raw Text Widget
-- [ ] Default Pre-Sets like CPF, CNPJ, Date, Credit Card, etc...
diff --git a/android/local.properties b/android/local.properties
new file mode 100644
index 0000000..fae3c9c
--- /dev/null
+++ b/android/local.properties
@@ -0,0 +1,2 @@
+sdk.dir=/Users/ben/Library/Android/sdk
+flutter.sdk=/Users/ben/Documents/dev/flutter
\ No newline at end of file
diff --git a/example/masked_text_sample/.gitignore b/example/masked_text_sample/.gitignore
deleted file mode 100644
index 47e0b4d..0000000
--- a/example/masked_text_sample/.gitignore
+++ /dev/null
@@ -1,71 +0,0 @@
-# Miscellaneous
-*.class
-*.lock
-*.log
-*.pyc
-*.swp
-.DS_Store
-.atom/
-.buildlog/
-.history
-.svn/
-
-# IntelliJ related
-*.iml
-*.ipr
-*.iws
-.idea/
-
-# Visual Studio Code related
-.vscode/
-
-# Flutter/Dart/Pub related
-**/doc/api/
-.dart_tool/
-.flutter-plugins
-.packages
-.pub-cache/
-.pub/
-build/
-
-# Android related
-**/android/**/gradle-wrapper.jar
-**/android/.gradle
-**/android/captures/
-**/android/gradlew
-**/android/gradlew.bat
-**/android/local.properties
-**/android/**/GeneratedPluginRegistrant.java
-
-# iOS/XCode related
-**/ios/**/*.mode1v3
-**/ios/**/*.mode2v3
-**/ios/**/*.moved-aside
-**/ios/**/*.pbxuser
-**/ios/**/*.perspectivev3
-**/ios/**/*sync/
-**/ios/**/.sconsign.dblite
-**/ios/**/.tags*
-**/ios/**/.vagrant/
-**/ios/**/DerivedData/
-**/ios/**/Icon?
-**/ios/**/Pods/
-**/ios/**/.symlinks/
-**/ios/**/profile
-**/ios/**/xcuserdata
-**/ios/.generated/
-**/ios/Flutter/App.framework
-**/ios/Flutter/Flutter.framework
-**/ios/Flutter/Generated.xcconfig
-**/ios/Flutter/app.flx
-**/ios/Flutter/app.zip
-**/ios/Flutter/flutter_assets/
-**/ios/ServiceDefinitions.json
-**/ios/Runner/GeneratedPluginRegistrant.*
-
-# Exceptions to above rules.
-!**/ios/**/default.mode1v3
-!**/ios/**/default.mode2v3
-!**/ios/**/default.pbxuser
-!**/ios/**/default.perspectivev3
-!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
diff --git a/example/masked_text_sample/.metadata b/example/masked_text_sample/.metadata
deleted file mode 100644
index 374cb22..0000000
--- a/example/masked_text_sample/.metadata
+++ /dev/null
@@ -1,10 +0,0 @@
-# This file tracks properties of this Flutter project.
-# Used by Flutter tool to assess capabilities and perform upgrades etc.
-#
-# This file should be version controlled and should not be manually edited.
-
-version:
- revision: d8cbb80206db06d151206f8b599b7dde5a386a2d
- channel: beta
-
-project_type: app
diff --git a/example/masked_text_sample/README.md b/example/masked_text_sample/README.md
deleted file mode 100644
index ecb54a4..0000000
--- a/example/masked_text_sample/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# masked_text_sample
-
-A new Flutter project.
-
-## Getting Started
-
-For help getting started with Flutter, view our online
-[documentation](https://flutter.io/).
diff --git a/example/masked_text_sample/android/app/build.gradle b/example/masked_text_sample/android/app/build.gradle
deleted file mode 100644
index 284605c..0000000
--- a/example/masked_text_sample/android/app/build.gradle
+++ /dev/null
@@ -1,61 +0,0 @@
-def localProperties = new Properties()
-def localPropertiesFile = rootProject.file('local.properties')
-if (localPropertiesFile.exists()) {
- localPropertiesFile.withReader('UTF-8') { reader ->
- localProperties.load(reader)
- }
-}
-
-def flutterRoot = localProperties.getProperty('flutter.sdk')
-if (flutterRoot == null) {
- throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
-}
-
-def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
-if (flutterVersionCode == null) {
- flutterVersionCode = '1'
-}
-
-def flutterVersionName = localProperties.getProperty('flutter.versionName')
-if (flutterVersionName == null) {
- flutterVersionName = '1.0'
-}
-
-apply plugin: 'com.android.application'
-apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
-
-android {
- compileSdkVersion 27
-
- lintOptions {
- disable 'InvalidPackage'
- }
-
- defaultConfig {
- // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
- applicationId "com.example.maskedtextsample"
- minSdkVersion 16
- targetSdkVersion 27
- versionCode flutterVersionCode.toInteger()
- versionName flutterVersionName
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
- }
-
- buildTypes {
- release {
- // TODO: Add your own signing config for the release build.
- // Signing with the debug keys for now, so `flutter run --release` works.
- signingConfig signingConfigs.debug
- }
- }
-}
-
-flutter {
- source '../..'
-}
-
-dependencies {
- testImplementation 'junit:junit:4.12'
- androidTestImplementation 'com.android.support.test:runner:1.0.2'
- androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
-}
diff --git a/example/masked_text_sample/android/app/src/main/AndroidManifest.xml b/example/masked_text_sample/android/app/src/main/AndroidManifest.xml
deleted file mode 100644
index a7bb7f9..0000000
--- a/example/masked_text_sample/android/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/masked_text_sample/android/app/src/main/java/com/example/maskedtextsample/MainActivity.java b/example/masked_text_sample/android/app/src/main/java/com/example/maskedtextsample/MainActivity.java
deleted file mode 100644
index 0b4d948..0000000
--- a/example/masked_text_sample/android/app/src/main/java/com/example/maskedtextsample/MainActivity.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.example.maskedtextsample;
-
-import android.os.Bundle;
-import io.flutter.app.FlutterActivity;
-import io.flutter.plugins.GeneratedPluginRegistrant;
-
-public class MainActivity extends FlutterActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- GeneratedPluginRegistrant.registerWith(this);
- }
-}
diff --git a/example/masked_text_sample/android/app/src/main/res/drawable/launch_background.xml b/example/masked_text_sample/android/app/src/main/res/drawable/launch_background.xml
deleted file mode 100644
index 304732f..0000000
--- a/example/masked_text_sample/android/app/src/main/res/drawable/launch_background.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/example/masked_text_sample/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/example/masked_text_sample/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index db77bb4..0000000
Binary files a/example/masked_text_sample/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ
diff --git a/example/masked_text_sample/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/example/masked_text_sample/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index 17987b7..0000000
Binary files a/example/masked_text_sample/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ
diff --git a/example/masked_text_sample/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/example/masked_text_sample/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index 09d4391..0000000
Binary files a/example/masked_text_sample/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ
diff --git a/example/masked_text_sample/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/example/masked_text_sample/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index d5f1c8d..0000000
Binary files a/example/masked_text_sample/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ
diff --git a/example/masked_text_sample/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/example/masked_text_sample/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index 4d6372e..0000000
Binary files a/example/masked_text_sample/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ
diff --git a/example/masked_text_sample/android/app/src/main/res/values/styles.xml b/example/masked_text_sample/android/app/src/main/res/values/styles.xml
deleted file mode 100644
index 00fa441..0000000
--- a/example/masked_text_sample/android/app/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
diff --git a/example/masked_text_sample/android/build.gradle b/example/masked_text_sample/android/build.gradle
deleted file mode 100644
index bb8a303..0000000
--- a/example/masked_text_sample/android/build.gradle
+++ /dev/null
@@ -1,29 +0,0 @@
-buildscript {
- repositories {
- google()
- jcenter()
- }
-
- dependencies {
- classpath 'com.android.tools.build:gradle:3.2.1'
- }
-}
-
-allprojects {
- repositories {
- google()
- jcenter()
- }
-}
-
-rootProject.buildDir = '../build'
-subprojects {
- project.buildDir = "${rootProject.buildDir}/${project.name}"
-}
-subprojects {
- project.evaluationDependsOn(':app')
-}
-
-task clean(type: Delete) {
- delete rootProject.buildDir
-}
diff --git a/example/masked_text_sample/android/gradle.properties b/example/masked_text_sample/android/gradle.properties
deleted file mode 100644
index 8bd86f6..0000000
--- a/example/masked_text_sample/android/gradle.properties
+++ /dev/null
@@ -1 +0,0 @@
-org.gradle.jvmargs=-Xmx1536M
diff --git a/example/masked_text_sample/android/gradle/wrapper/gradle-wrapper.properties b/example/masked_text_sample/android/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 2819f02..0000000
--- a/example/masked_text_sample/android/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-#Fri Jun 23 08:50:38 CEST 2017
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
diff --git a/example/masked_text_sample/android/settings.gradle b/example/masked_text_sample/android/settings.gradle
deleted file mode 100644
index 5a2f14f..0000000
--- a/example/masked_text_sample/android/settings.gradle
+++ /dev/null
@@ -1,15 +0,0 @@
-include ':app'
-
-def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
-
-def plugins = new Properties()
-def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
-if (pluginsFile.exists()) {
- pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
-}
-
-plugins.each { name, path ->
- def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
- include ":$name"
- project(":$name").projectDir = pluginDirectory
-}
diff --git a/example/masked_text_sample/ios/Flutter/AppFrameworkInfo.plist b/example/masked_text_sample/ios/Flutter/AppFrameworkInfo.plist
deleted file mode 100644
index 9367d48..0000000
--- a/example/masked_text_sample/ios/Flutter/AppFrameworkInfo.plist
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- en
- CFBundleExecutable
- App
- CFBundleIdentifier
- io.flutter.flutter.app
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- App
- CFBundlePackageType
- FMWK
- CFBundleShortVersionString
- 1.0
- CFBundleSignature
- ????
- CFBundleVersion
- 1.0
- MinimumOSVersion
- 8.0
-
-
diff --git a/example/masked_text_sample/ios/Flutter/Debug.xcconfig b/example/masked_text_sample/ios/Flutter/Debug.xcconfig
deleted file mode 100644
index 592ceee..0000000
--- a/example/masked_text_sample/ios/Flutter/Debug.xcconfig
+++ /dev/null
@@ -1 +0,0 @@
-#include "Generated.xcconfig"
diff --git a/example/masked_text_sample/ios/Flutter/Release.xcconfig b/example/masked_text_sample/ios/Flutter/Release.xcconfig
deleted file mode 100644
index 592ceee..0000000
--- a/example/masked_text_sample/ios/Flutter/Release.xcconfig
+++ /dev/null
@@ -1 +0,0 @@
-#include "Generated.xcconfig"
diff --git a/example/masked_text_sample/ios/Runner.xcodeproj/project.pbxproj b/example/masked_text_sample/ios/Runner.xcodeproj/project.pbxproj
deleted file mode 100644
index d177907..0000000
--- a/example/masked_text_sample/ios/Runner.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,436 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
- 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
- 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
- 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
- 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
- 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
- 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
- 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
- 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
- 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
- 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
- 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
- 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = "";
- dstSubfolderSpec = 10;
- files = (
- 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
- 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
- );
- name = "Embed Frameworks";
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
- 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
- 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
- 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
- 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; };
- 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
- 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
- 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
- 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
- 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
- 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
- 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
- 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
- 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
- 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
- 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
- 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 97C146EB1CF9000F007C117D /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
- 3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 9740EEB11CF90186004384FC /* Flutter */ = {
- isa = PBXGroup;
- children = (
- 2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
- 3B80C3931E831B6300D905FE /* App.framework */,
- 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
- 9740EEBA1CF902C7004384FC /* Flutter.framework */,
- 9740EEB21CF90195004384FC /* Debug.xcconfig */,
- 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
- 9740EEB31CF90195004384FC /* Generated.xcconfig */,
- );
- name = Flutter;
- sourceTree = "";
- };
- 97C146E51CF9000F007C117D = {
- isa = PBXGroup;
- children = (
- 9740EEB11CF90186004384FC /* Flutter */,
- 97C146F01CF9000F007C117D /* Runner */,
- 97C146EF1CF9000F007C117D /* Products */,
- CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
- );
- sourceTree = "";
- };
- 97C146EF1CF9000F007C117D /* Products */ = {
- isa = PBXGroup;
- children = (
- 97C146EE1CF9000F007C117D /* Runner.app */,
- );
- name = Products;
- sourceTree = "";
- };
- 97C146F01CF9000F007C117D /* Runner */ = {
- isa = PBXGroup;
- children = (
- 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
- 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
- 97C146FA1CF9000F007C117D /* Main.storyboard */,
- 97C146FD1CF9000F007C117D /* Assets.xcassets */,
- 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
- 97C147021CF9000F007C117D /* Info.plist */,
- 97C146F11CF9000F007C117D /* Supporting Files */,
- 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
- 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
- );
- path = Runner;
- sourceTree = "";
- };
- 97C146F11CF9000F007C117D /* Supporting Files */ = {
- isa = PBXGroup;
- children = (
- 97C146F21CF9000F007C117D /* main.m */,
- );
- name = "Supporting Files";
- sourceTree = "";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 97C146ED1CF9000F007C117D /* Runner */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
- buildPhases = (
- 9740EEB61CF901F6004384FC /* Run Script */,
- 97C146EA1CF9000F007C117D /* Sources */,
- 97C146EB1CF9000F007C117D /* Frameworks */,
- 97C146EC1CF9000F007C117D /* Resources */,
- 9705A1C41CF9048500538489 /* Embed Frameworks */,
- 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = Runner;
- productName = Runner;
- productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
- productType = "com.apple.product-type.application";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 97C146E61CF9000F007C117D /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0910;
- ORGANIZATIONNAME = "The Chromium Authors";
- TargetAttributes = {
- 97C146ED1CF9000F007C117D = {
- CreatedOnToolsVersion = 7.3.1;
- };
- };
- };
- buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- Base,
- );
- mainGroup = 97C146E51CF9000F007C117D;
- productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 97C146ED1CF9000F007C117D /* Runner */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- 97C146EC1CF9000F007C117D /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
- 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
- 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
- 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
- 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
- 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXShellScriptBuildPhase section */
- 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Thin Binary";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
- };
- 9740EEB61CF901F6004384FC /* Run Script */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Run Script";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
- };
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- 97C146EA1CF9000F007C117D /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
- 97C146F31CF9000F007C117D /* main.m in Sources */,
- 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXVariantGroup section */
- 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
- isa = PBXVariantGroup;
- children = (
- 97C146FB1CF9000F007C117D /* Base */,
- );
- name = Main.storyboard;
- sourceTree = "";
- };
- 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
- isa = PBXVariantGroup;
- children = (
- 97C147001CF9000F007C117D /* Base */,
- );
- name = LaunchScreen.storyboard;
- sourceTree = "";
- };
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
- 97C147031CF9000F007C117D /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = dwarf;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_TESTABILITY = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
- MTL_ENABLE_DEBUG_INFO = YES;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = iphoneos;
- TARGETED_DEVICE_FAMILY = "1,2";
- };
- name = Debug;
- };
- 97C147041CF9000F007C117D /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- ENABLE_NS_ASSERTIONS = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
- MTL_ENABLE_DEBUG_INFO = NO;
- SDKROOT = iphoneos;
- TARGETED_DEVICE_FAMILY = "1,2";
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
- 97C147061CF9000F007C117D /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
- ENABLE_BITCODE = NO;
- FRAMEWORK_SEARCH_PATHS = (
- "$(inherited)",
- "$(PROJECT_DIR)/Flutter",
- );
- INFOPLIST_FILE = Runner/Info.plist;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "$(PROJECT_DIR)/Flutter",
- );
- PRODUCT_BUNDLE_IDENTIFIER = com.example.maskedTextSample;
- PRODUCT_NAME = "$(TARGET_NAME)";
- VERSIONING_SYSTEM = "apple-generic";
- };
- name = Debug;
- };
- 97C147071CF9000F007C117D /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
- ENABLE_BITCODE = NO;
- FRAMEWORK_SEARCH_PATHS = (
- "$(inherited)",
- "$(PROJECT_DIR)/Flutter",
- );
- INFOPLIST_FILE = Runner/Info.plist;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "$(PROJECT_DIR)/Flutter",
- );
- PRODUCT_BUNDLE_IDENTIFIER = com.example.maskedTextSample;
- PRODUCT_NAME = "$(TARGET_NAME)";
- VERSIONING_SYSTEM = "apple-generic";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 97C147031CF9000F007C117D /* Debug */,
- 97C147041CF9000F007C117D /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 97C147061CF9000F007C117D /* Debug */,
- 97C147071CF9000F007C117D /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 97C146E61CF9000F007C117D /* Project object */;
-}
diff --git a/example/masked_text_sample/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/example/masked_text_sample/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 1d526a1..0000000
--- a/example/masked_text_sample/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/example/masked_text_sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/masked_text_sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
deleted file mode 100644
index 1263ac8..0000000
--- a/example/masked_text_sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/masked_text_sample/ios/Runner.xcworkspace/contents.xcworkspacedata b/example/masked_text_sample/ios/Runner.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 1d526a1..0000000
--- a/example/masked_text_sample/ios/Runner.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/example/masked_text_sample/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/example/masked_text_sample/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
deleted file mode 100644
index 949b678..0000000
--- a/example/masked_text_sample/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- BuildSystemType
- Original
-
-
diff --git a/example/masked_text_sample/ios/Runner/AppDelegate.h b/example/masked_text_sample/ios/Runner/AppDelegate.h
deleted file mode 100644
index 36e21bb..0000000
--- a/example/masked_text_sample/ios/Runner/AppDelegate.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#import
-#import
-
-@interface AppDelegate : FlutterAppDelegate
-
-@end
diff --git a/example/masked_text_sample/ios/Runner/AppDelegate.m b/example/masked_text_sample/ios/Runner/AppDelegate.m
deleted file mode 100644
index 59a72e9..0000000
--- a/example/masked_text_sample/ios/Runner/AppDelegate.m
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "AppDelegate.h"
-#include "GeneratedPluginRegistrant.h"
-
-@implementation AppDelegate
-
-- (BOOL)application:(UIApplication *)application
- didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
- [GeneratedPluginRegistrant registerWithRegistry:self];
- // Override point for customization after application launch.
- return [super application:application didFinishLaunchingWithOptions:launchOptions];
-}
-
-@end
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
deleted file mode 100644
index d36b1fa..0000000
--- a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
+++ /dev/null
@@ -1,122 +0,0 @@
-{
- "images" : [
- {
- "size" : "20x20",
- "idiom" : "iphone",
- "filename" : "Icon-App-20x20@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "20x20",
- "idiom" : "iphone",
- "filename" : "Icon-App-20x20@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "Icon-App-29x29@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "Icon-App-29x29@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "Icon-App-29x29@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "40x40",
- "idiom" : "iphone",
- "filename" : "Icon-App-40x40@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "40x40",
- "idiom" : "iphone",
- "filename" : "Icon-App-40x40@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "60x60",
- "idiom" : "iphone",
- "filename" : "Icon-App-60x60@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "60x60",
- "idiom" : "iphone",
- "filename" : "Icon-App-60x60@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "20x20",
- "idiom" : "ipad",
- "filename" : "Icon-App-20x20@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "20x20",
- "idiom" : "ipad",
- "filename" : "Icon-App-20x20@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "29x29",
- "idiom" : "ipad",
- "filename" : "Icon-App-29x29@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "29x29",
- "idiom" : "ipad",
- "filename" : "Icon-App-29x29@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "40x40",
- "idiom" : "ipad",
- "filename" : "Icon-App-40x40@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "40x40",
- "idiom" : "ipad",
- "filename" : "Icon-App-40x40@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "76x76",
- "idiom" : "ipad",
- "filename" : "Icon-App-76x76@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "76x76",
- "idiom" : "ipad",
- "filename" : "Icon-App-76x76@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "83.5x83.5",
- "idiom" : "ipad",
- "filename" : "Icon-App-83.5x83.5@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "1024x1024",
- "idiom" : "ios-marketing",
- "filename" : "Icon-App-1024x1024@1x.png",
- "scale" : "1x"
- }
- ],
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
deleted file mode 100644
index 3d43d11..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
deleted file mode 100644
index 28c6bf0..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
deleted file mode 100644
index 2ccbfd9..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
deleted file mode 100644
index f091b6b..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
deleted file mode 100644
index 4cde121..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
deleted file mode 100644
index d0ef06e..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
deleted file mode 100644
index dcdc230..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
deleted file mode 100644
index 2ccbfd9..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
deleted file mode 100644
index c8f9ed8..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
deleted file mode 100644
index a6d6b86..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
deleted file mode 100644
index a6d6b86..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
deleted file mode 100644
index 75b2d16..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
deleted file mode 100644
index c4df70d..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
deleted file mode 100644
index 6a84f41..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
deleted file mode 100644
index d0e1f58..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/example/masked_text_sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
deleted file mode 100644
index 0bedcf2..0000000
--- a/example/masked_text_sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "images" : [
- {
- "idiom" : "universal",
- "filename" : "LaunchImage.png",
- "scale" : "1x"
- },
- {
- "idiom" : "universal",
- "filename" : "LaunchImage@2x.png",
- "scale" : "2x"
- },
- {
- "idiom" : "universal",
- "filename" : "LaunchImage@3x.png",
- "scale" : "3x"
- }
- ],
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
deleted file mode 100644
index 9da19ea..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
deleted file mode 100644
index 9da19ea..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/example/masked_text_sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
deleted file mode 100644
index 9da19ea..0000000
Binary files a/example/masked_text_sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ
diff --git a/example/masked_text_sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/example/masked_text_sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
deleted file mode 100644
index 89c2725..0000000
--- a/example/masked_text_sample/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Launch Screen Assets
-
-You can customize the launch screen with your own desired assets by replacing the image files in this directory.
-
-You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
\ No newline at end of file
diff --git a/example/masked_text_sample/ios/Runner/Base.lproj/LaunchScreen.storyboard b/example/masked_text_sample/ios/Runner/Base.lproj/LaunchScreen.storyboard
deleted file mode 100644
index f2e259c..0000000
--- a/example/masked_text_sample/ios/Runner/Base.lproj/LaunchScreen.storyboard
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/masked_text_sample/ios/Runner/Base.lproj/Main.storyboard b/example/masked_text_sample/ios/Runner/Base.lproj/Main.storyboard
deleted file mode 100644
index f3c2851..0000000
--- a/example/masked_text_sample/ios/Runner/Base.lproj/Main.storyboard
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/masked_text_sample/ios/Runner/Info.plist b/example/masked_text_sample/ios/Runner/Info.plist
deleted file mode 100644
index 2035f7f..0000000
--- a/example/masked_text_sample/ios/Runner/Info.plist
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- en
- CFBundleExecutable
- $(EXECUTABLE_NAME)
- CFBundleIdentifier
- $(PRODUCT_BUNDLE_IDENTIFIER)
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- masked_text_sample
- CFBundlePackageType
- APPL
- CFBundleShortVersionString
- $(FLUTTER_BUILD_NAME)
- CFBundleSignature
- ????
- CFBundleVersion
- $(FLUTTER_BUILD_NUMBER)
- LSRequiresIPhoneOS
-
- UILaunchStoryboardName
- LaunchScreen
- UIMainStoryboardFile
- Main
- UISupportedInterfaceOrientations
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- UISupportedInterfaceOrientations~ipad
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationPortraitUpsideDown
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- UIViewControllerBasedStatusBarAppearance
-
-
-
diff --git a/example/masked_text_sample/ios/Runner/main.m b/example/masked_text_sample/ios/Runner/main.m
deleted file mode 100644
index dff6597..0000000
--- a/example/masked_text_sample/ios/Runner/main.m
+++ /dev/null
@@ -1,9 +0,0 @@
-#import
-#import
-#import "AppDelegate.h"
-
-int main(int argc, char* argv[]) {
- @autoreleasepool {
- return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
- }
-}
diff --git a/example/masked_text_sample/lib/flutter_masked_text.dart b/example/masked_text_sample/lib/flutter_masked_text.dart
deleted file mode 100644
index 4a29252..0000000
--- a/example/masked_text_sample/lib/flutter_masked_text.dart
+++ /dev/null
@@ -1,225 +0,0 @@
-library flutter_masked_text;
-
-import 'package:flutter/material.dart';
-
-class MaskedTextController extends TextEditingController {
- MaskedTextController({String text, this.mask, Map translator})
- : super(text: text) {
- this.translator = translator ?? MaskedTextController.getDefaultTranslator();
-
- this.addListener(() {
- var previous = this._lastUpdatedText;
- if (this.beforeChange(previous, this.text)) {
- this.updateText(this.text);
- this.afterChange(previous, this.text);
- } else {
- this.updateText(this._lastUpdatedText);
- }
- });
-
- this.updateText(this.text);
- }
-
- String mask;
-
- Map translator;
-
- Function afterChange = (String previous, String next) {};
- Function beforeChange = (String previous, String next) {
- return true;
- };
-
- String _lastUpdatedText = '';
-
- void updateText(String text) {
- this.text = this._applyMask(this.mask, text);
- this._lastUpdatedText = this.text;
- }
-
- void updateMask(String mask) {
- this.mask = mask;
- this.updateText(this.text);
- }
-
- @override
- void set text(String newText) {
- if (super.text != newText) {
- super.text = newText;
- this.selection = new TextSelection.fromPosition(
- new TextPosition(offset: (newText ?? '').length));
- }
- }
-
- static Map getDefaultTranslator() {
- return {
- 'A': new RegExp(r'[A-Za-z]'),
- '0': new RegExp(r'[0-9]'),
- '@': new RegExp(r'[A-Za-z0-9]'),
- '*': new RegExp(r'.*')
- };
- }
-
- String _applyMask(String mask, String value) {
- String result = '';
-
- var maskCharIndex = 0;
- var valueCharIndex = 0;
-
- while (true) {
- // if mask is ended, break.
- if (maskCharIndex == mask.length) {
- break;
- }
-
- // if value is ended, break.
- if (valueCharIndex == value.length) {
- break;
- }
-
- var maskChar = mask[maskCharIndex];
- var valueChar = value[valueCharIndex];
-
- // value equals mask, just set
- if (maskChar == valueChar) {
- result += maskChar;
- valueCharIndex += 1;
- maskCharIndex += 1;
- continue;
- }
-
- // apply translator if match
- if (this.translator.containsKey(maskChar)) {
- if (this.translator[maskChar].hasMatch(valueChar)) {
- result += valueChar;
- maskCharIndex += 1;
- }
-
- valueCharIndex += 1;
- continue;
- }
-
- // not masked value, fixed char on mask
- result += maskChar;
- maskCharIndex += 1;
- continue;
- }
-
- return result;
- }
-}
-
-/**
- * Mask for monetary values.
- */
-class MoneyMaskedTextController extends TextEditingController {
- MoneyMaskedTextController(
- {double initialValue = 0.0,
- this.decimalSeparator = ',',
- this.thousandSeparator = '.',
- this.rightSymbol = '',
- this.leftSymbol = ''}) {
- _validateConfig();
-
- this.addListener(() {
- this.updateValue(this.numberValue);
- this.afterChange(this.text, this.numberValue);
- });
-
- this.updateValue(initialValue);
- }
-
- final String decimalSeparator;
- final String thousandSeparator;
- final String rightSymbol;
- final String leftSymbol;
-
- Function afterChange = (String maskedValue, double rawValue) {};
-
- // this is the maximum supported for double values.
- final int _maxLength = 19;
-
- void updateValue(double value) {
- String masked = this._applyMask(value);
-
- if (masked.length > _maxLength) {
- masked = masked.substring(0, _maxLength);
- }
-
- if (rightSymbol.length > 0) {
- masked += rightSymbol;
- }
-
- if (leftSymbol.length > 0) {
- masked = leftSymbol + masked;
- }
-
- if (masked != this.text) {
- this.text = masked;
-
- var cursorPosition = super.text.length - this.rightSymbol.length;
- this.selection = new TextSelection.fromPosition(
- new TextPosition(offset: cursorPosition));
- }
- }
-
- double get numberValue => double.parse(_getSanitizedText(this.text)) / 100.0;
-
- _validateConfig() {
- bool rightSymbolHasNumbers = _getOnlyNumbers(this.rightSymbol).length > 0;
-
- if (rightSymbolHasNumbers) {
- throw new ArgumentError("rightSymbol must not have numbers.");
- }
- }
-
- String _getSanitizedText(String text) {
- String cleanedText = text;
-
- var valuesToSanitize = [this.thousandSeparator, this.decimalSeparator];
-
- valuesToSanitize.forEach((val) {
- cleanedText = cleanedText.replaceAll(val, '');
- });
-
- cleanedText = _getOnlyNumbers(cleanedText);
-
- return cleanedText;
- }
-
- String _getOnlyNumbers(String text) {
- String cleanedText = text;
-
- var onlyNumbersRegex = new RegExp(r'[^\d]');
-
- cleanedText = cleanedText.replaceAll(onlyNumbersRegex, '');
-
- return cleanedText;
- }
-
- String _applyMask(double value) {
- String textRepresentation =
- value.toStringAsFixed(2).replaceAll('.', this.decimalSeparator);
-
- List numberParts = [];
-
- for (var i = 0; i < textRepresentation.length; i++) {
- numberParts.add(textRepresentation[i]);
- }
-
- const lengthsWithThousandSeparators = [6, 10, 14, 18];
-
- for (var i = 0; i < lengthsWithThousandSeparators.length; i++) {
- var l = lengthsWithThousandSeparators[i];
-
- if (numberParts.length > l) {
- numberParts.insert(numberParts.length - l, this.thousandSeparator);
- } else {
- break;
- }
- }
-
- String numberText = numberParts.join('');
-
- return numberText;
- }
-}
diff --git a/example/masked_text_sample/lib/main.dart b/example/masked_text_sample/lib/main.dart
deleted file mode 100644
index a0cb394..0000000
--- a/example/masked_text_sample/lib/main.dart
+++ /dev/null
@@ -1,70 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:masked_text_sample/flutter_masked_text.dart';
-
-void main() => runApp(MyApp());
-
-class MyApp extends StatelessWidget {
- // This widget is the root of your application.
- @override
- Widget build(BuildContext context) {
- return new MaterialApp(
- title: 'Flutter Demo',
- theme: new ThemeData(
- primarySwatch: Colors.blue,
- ),
- home: new SafeArea(
- child: new Scaffold(
- body: new Column(
- children: [
- _brPhoneInput(),
- _moneyInput()
- ],
- ),
- ),
- ),
- );
- }
-
- Widget _brPhoneInput() {
- var controller = new MaskedTextController(mask: '(00) 0000-0000');
-
- controller.beforeChange = (String previous, String next) {
- if (next.length > 14) {
- controller.updateMask('(00) 00000-0000');
- }
- else {
- controller.updateMask('(00) 0000-0000');
- }
-
- return true;
- };
-
- controller.afterChange = (String previous, String next) {
- print("$previous | $next");
- };
-
- return new TextField(
- controller: controller,
- keyboardType: TextInputType.phone,
- decoration: InputDecoration(
- labelText: 'Phone'
- )
- );
- }
-
- Widget _moneyInput() {
- var controller = new MoneyMaskedTextController();
-
- controller.afterChange = (String masked, double raw) {
- print("$masked | $raw");
- };
-
- return new TextField(
- controller: controller,
- keyboardType: TextInputType.phone,
- decoration: InputDecoration(
- labelText: 'Money'
- )
- );
- }
-}
diff --git a/example/masked_text_sample/pubspec.yaml b/example/masked_text_sample/pubspec.yaml
deleted file mode 100644
index 2944f33..0000000
--- a/example/masked_text_sample/pubspec.yaml
+++ /dev/null
@@ -1,68 +0,0 @@
-name: masked_text_sample
-description: A new Flutter project.
-
-# The following defines the version and build number for your application.
-# A version number is three numbers separated by dots, like 1.2.43
-# followed by an optional build number separated by a +.
-# Both the version and the builder number may be overridden in flutter
-# build by specifying --build-name and --build-number, respectively.
-# Read more about versioning at semver.org.
-version: 1.0.0+1
-
-environment:
- sdk: ">=2.0.0-dev.68.0 <3.0.0"
-
-dependencies:
- flutter:
- sdk: flutter
-
- # The following adds the Cupertino Icons font to your application.
- # Use with the CupertinoIcons class for iOS style icons.
- cupertino_icons: ^0.1.2
-
-dev_dependencies:
- flutter_test:
- sdk: flutter
-
-
-# For information on the generic Dart part of this file, see the
-# following page: https://www.dartlang.org/tools/pub/pubspec
-
-# The following section is specific to Flutter.
-flutter:
-
- # The following line ensures that the Material Icons font is
- # included with your application, so that you can use the icons in
- # the material Icons class.
- uses-material-design: true
-
- # To add assets to your application, add an assets section, like this:
- # assets:
- # - images/a_dot_burr.jpeg
- # - images/a_dot_ham.jpeg
-
- # An image asset can refer to one or more resolution-specific "variants", see
- # https://flutter.io/assets-and-images/#resolution-aware.
-
- # For details regarding adding assets from package dependencies, see
- # https://flutter.io/assets-and-images/#from-packages
-
- # To add custom fonts to your application, add a fonts section here,
- # in this "flutter" section. Each entry in this list should have a
- # "family" key with the font family name, and a "fonts" key with a
- # list giving the asset and other descriptors for the font. For
- # example:
- # fonts:
- # - family: Schyler
- # fonts:
- # - asset: fonts/Schyler-Regular.ttf
- # - asset: fonts/Schyler-Italic.ttf
- # style: italic
- # - family: Trajan Pro
- # fonts:
- # - asset: fonts/TrajanPro.ttf
- # - asset: fonts/TrajanPro_Bold.ttf
- # weight: 700
- #
- # For details regarding fonts from package dependencies,
- # see https://flutter.io/custom-fonts/#from-packages
diff --git a/flutter_masked_text.iml b/flutter_masked_text.iml
index d9bd5ad..304065a 100644
--- a/flutter_masked_text.iml
+++ b/flutter_masked_text.iml
@@ -9,6 +9,9 @@
+
+
+
diff --git a/lib/flutter_masked_text.dart b/lib/flutter_masked_text.dart
index 4a29252..e75adf9 100644
--- a/lib/flutter_masked_text.dart
+++ b/lib/flutter_masked_text.dart
@@ -32,21 +32,36 @@ class MaskedTextController extends TextEditingController {
String _lastUpdatedText = '';
void updateText(String text) {
- this.text = this._applyMask(this.mask, text);
+ if(text != null){
+ this.text = this._applyMask(this.mask, text);
+ }
+ else {
+ this.text = '';
+ }
+
this._lastUpdatedText = this.text;
}
- void updateMask(String mask) {
+ void updateMask(String mask, {bool moveCursorToEnd = true}) {
this.mask = mask;
this.updateText(this.text);
+
+ if (moveCursorToEnd) {
+ this.moveCursorToEnd();
+ }
+ }
+
+ void moveCursorToEnd() {
+ var text = this._lastUpdatedText;
+ this.selection = new TextSelection.fromPosition(
+ new TextPosition(offset: (text ?? '').length));
}
@override
void set text(String newText) {
if (super.text != newText) {
super.text = newText;
- this.selection = new TextSelection.fromPosition(
- new TextPosition(offset: (newText ?? '').length));
+ this.moveCursorToEnd();
}
}
@@ -114,10 +129,11 @@ 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 = '',
+ this.precision = 2}) {
_validateConfig();
this.addListener(() {
@@ -132,18 +148,23 @@ class MoneyMaskedTextController extends TextEditingController {
final String thousandSeparator;
final String rightSymbol;
final String leftSymbol;
+ final int precision;
Function afterChange = (String maskedValue, double rawValue) {};
- // this is the maximum supported for double values.
- final int _maxLength = 19;
+ double _lastValue = 0.0;
void updateValue(double value) {
- String masked = this._applyMask(value);
+ double valueToUse = value;
- if (masked.length > _maxLength) {
- masked = masked.substring(0, _maxLength);
+ if (value.toStringAsFixed(0).length > 12) {
+ valueToUse = _lastValue;
}
+ else {
+ _lastValue = value;
+ }
+
+ String masked = this._applyMask(valueToUse);
if (rightSymbol.length > 0) {
masked += rightSymbol;
@@ -162,7 +183,13 @@ class MoneyMaskedTextController extends TextEditingController {
}
}
- double get numberValue => double.parse(_getSanitizedText(this.text)) / 100.0;
+ double get numberValue {
+ List parts = _getOnlyNumbers(this.text).split('').toList(growable: true);
+
+ parts.insert(parts.length - precision, '.');
+
+ return double.parse(parts.join());
+ }
_validateConfig() {
bool rightSymbolHasNumbers = _getOnlyNumbers(this.rightSymbol).length > 0;
@@ -172,20 +199,6 @@ class MoneyMaskedTextController extends TextEditingController {
}
}
- String _getSanitizedText(String text) {
- String cleanedText = text;
-
- var valuesToSanitize = [this.thousandSeparator, this.decimalSeparator];
-
- valuesToSanitize.forEach((val) {
- cleanedText = cleanedText.replaceAll(val, '');
- });
-
- cleanedText = _getOnlyNumbers(cleanedText);
-
- return cleanedText;
- }
-
String _getOnlyNumbers(String text) {
String cleanedText = text;
@@ -197,29 +210,23 @@ class MoneyMaskedTextController extends TextEditingController {
}
String _applyMask(double value) {
- String textRepresentation =
- value.toStringAsFixed(2).replaceAll('.', this.decimalSeparator);
+ List textRepresentation = value.toStringAsFixed(precision)
+ .replaceAll('.', '')
+ .split('')
+ .reversed
+ .toList(growable: true);
- List numberParts = [];
+ textRepresentation.insert(precision, decimalSeparator);
- for (var i = 0; i < textRepresentation.length; i++) {
- numberParts.add(textRepresentation[i]);
- }
-
- const lengthsWithThousandSeparators = [6, 10, 14, 18];
-
- for (var i = 0; i < lengthsWithThousandSeparators.length; i++) {
- var l = lengthsWithThousandSeparators[i];
-
- if (numberParts.length > l) {
- numberParts.insert(numberParts.length - l, this.thousandSeparator);
- } else {
+ for (var i = precision + 4; true; i = i + 4) {
+ if (textRepresentation.length > i) {
+ textRepresentation.insert(i, thousandSeparator);
+ }
+ else {
break;
}
}
- String numberText = numberParts.join('');
-
- return numberText;
+ return textRepresentation.reversed.join('');
}
}
diff --git a/pubspec.lock b/pubspec.lock
index 45caf3f..224c7bb 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -1,20 +1,6 @@
# Generated by pub
# See https://www.dartlang.org/tools/pub/glossary#lockfile
packages:
- analyzer:
- dependency: transitive
- description:
- name: analyzer
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.33.0"
- args:
- dependency: transitive
- description:
- name: args
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.5.0"
async:
dependency: transitive
description:
@@ -43,27 +29,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.11"
- convert:
- dependency: transitive
- description:
- name: convert
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.2"
- crypto:
- dependency: transitive
- description:
- name: crypto
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.6"
- csslib:
- dependency: transitive
- description:
- name: csslib
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.14.6"
flutter:
dependency: "direct main"
description: flutter
@@ -74,83 +39,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
- front_end:
- dependency: transitive
- description:
- name: front_end
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.1.6"
- glob:
- dependency: transitive
- description:
- name: glob
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.7"
- html:
- dependency: transitive
- description:
- name: html
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.13.3+3"
- http:
- dependency: transitive
- description:
- name: http
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.12.0"
- http_multi_server:
- dependency: transitive
- description:
- name: http_multi_server
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.5"
- http_parser:
- dependency: transitive
- description:
- name: http_parser
- url: "https://pub.dartlang.org"
- source: hosted
- version: "3.1.3"
- io:
- dependency: transitive
- description:
- name: io
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.3.3"
- js:
- dependency: transitive
- description:
- name: js
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.6.1+1"
- json_rpc_2:
- dependency: transitive
- description:
- name: json_rpc_2
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.9"
- kernel:
- dependency: transitive
- description:
- name: kernel
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.3.6"
- logging:
- dependency: transitive
- description:
- name: logging
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.11.3+2"
matcher:
dependency: transitive
description:
@@ -165,41 +53,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
- mime:
- dependency: transitive
- description:
- name: mime
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.9.6+2"
- multi_server_socket:
- dependency: transitive
- description:
- name: multi_server_socket
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.2"
- node_preamble:
- dependency: transitive
- description:
- name: node_preamble
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.4.4"
- package_config:
- dependency: transitive
- description:
- name: package_config
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.5"
- package_resolver:
- dependency: transitive
- description:
- name: package_resolver
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.6"
path:
dependency: transitive
description:
@@ -207,81 +60,18 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.2"
- plugin:
- dependency: transitive
- description:
- name: plugin
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.0+3"
- pool:
- dependency: transitive
- description:
- name: pool
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.3.6"
- pub_semver:
- dependency: transitive
- description:
- name: pub_semver
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.4.2"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
- version: "2.0.0+1"
- shelf:
- dependency: transitive
- description:
- name: shelf
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.7.3+3"
- shelf_packages_handler:
- dependency: transitive
- description:
- name: shelf_packages_handler
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.4"
- shelf_static:
- dependency: transitive
- description:
- name: shelf_static
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.8"
- shelf_web_socket:
- dependency: transitive
- description:
- name: shelf_web_socket
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.2+4"
+ version: "2.0.1"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
- source_map_stack_trace:
- dependency: transitive
- description:
- name: source_map_stack_trace
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.5"
- source_maps:
- dependency: transitive
- description:
- name: source_maps
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.10.8"
source_span:
dependency: transitive
description:
@@ -317,13 +107,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
- test:
+ test_api:
dependency: transitive
description:
- name: test
+ name: test_api
url: "https://pub.dartlang.org"
source: hosted
- version: "1.3.4"
+ version: "0.2.1"
typed_data:
dependency: transitive
description:
@@ -331,13 +121,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
- utf:
- dependency: transitive
- description:
- name: utf
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.9.0+5"
vector_math:
dependency: transitive
description:
@@ -345,33 +128,5 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
- vm_service_client:
- dependency: transitive
- description:
- name: vm_service_client
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.6"
- watcher:
- dependency: transitive
- description:
- name: watcher
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.9.7+10"
- web_socket_channel:
- dependency: transitive
- description:
- name: web_socket_channel
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.0.9"
- yaml:
- dependency: transitive
- description:
- name: yaml
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.1.15"
sdks:
dart: ">=2.0.0 <3.0.0"
diff --git a/pubspec.yaml b/pubspec.yaml
index 4c4d25e..a07cb76 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
name: flutter_masked_text
description: Masked text input for flutter.
-version: 0.7.0
+version: 0.8.0
author: Ben-hur Santos Ott
homepage: https://github.com/benhurott/flutter-masked-text
diff --git a/test/flutter_masked_text_test.dart b/test/flutter_masked_text_test.dart
index c5d3530..e1c90d8 100644
--- a/test/flutter_masked_text_test.dart
+++ b/test/flutter_masked_text_test.dart
@@ -1,4 +1,4 @@
-import 'package:test/test.dart';
+import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_masked_text/flutter_masked_text.dart';
void main() {
@@ -147,5 +147,12 @@ void main() {
expect(controller.text, 'R\$ 123,45');
});
+
+ test('precision 3 and value 123.45 results in "123,450"', () {
+ var controller = new MoneyMaskedTextController(precision: 3);
+ controller.updateValue(123.45);
+
+ expect(controller.text, '123,450');
+ });
});
}