Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter by Anubhav Singh
Author:Anubhav Singh [Anubhav Singh]
Language: eng
Format: epub
Tags: COM044000 - COMPUTERS / Neural Networks, COM016000 - COMPUTERS / Computer Vision and Pattern Recognition, COM051460 - COMPUTERS / Programming / Mobile Devices
Publisher: Packt
Published: 2020-04-03T14:17:25+00:00
Similar to TextField in Step 2, we define the next method, _createPasswordInput(), to create a TextFormField() for entering the password:
Widget _createPasswordInput() {
return Padding(
padding: const EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0),
child: new TextFormField(
maxLines: 1,
obscureText: true,
autofocus: false,
decoration: new InputDecoration(
hintText: 'Password',
icon: new Icon(
Icons.lock,
color: Colors.grey,
)),
validator: (value) => value.isEmpty ? 'Password can\'t be empty' : null,
onSaved: (value) => _userpassword = value.trim(),
),
);
}
We start by providing padding in all four cardinal directions using EdgeInsets.fromLTRB() to give an offset of 15.0 at the top. Next, we create a TextFormField with maxLines as 1, and set obscureText to true and autofocus to false. obscureText is used to hide the text that is being typed. We use InputDecoration to provide the hintText password and a gray-colored icon, Icons.lock. To make sure that the text field isn't left empty, a validator is used that gives a warning, Password can't be empty, when a null value is passed, that is, the user attempts to sign in/up without entering a password. Finally, trim() is used to remove all trailing spaces and store the password in a _userpassword string variable.
Next, we declare the FormMode enumeration outside _SignupSigninScreenState that operates between two modes, SIGNIN and SIGNUP, as seen in the following code snippet:
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8309)
Test-Driven Development with Java by Alan Mellor(6798)
Data Augmentation with Python by Duc Haba(6715)
Principles of Data Fabric by Sonia Mezzetta(6462)
Learn Blender Simulations the Right Way by Stephen Pearson(6367)
Microservices with Spring Boot 3 and Spring Cloud by Magnus Larsson(6234)
Hadoop in Practice by Alex Holmes(5965)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5814)
RPA Solution Architect's Handbook by Sachin Sahgal(5636)
Big Data Analysis with Python by Ivan Marin(5399)
The Infinite Retina by Robert Scoble Irena Cronin(5323)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5159)
Pretrain Vision and Large Language Models in Python by Emily Webber(4363)
Infrastructure as Code for Beginners by Russ McKendrick(4132)
Functional Programming in JavaScript by Mantyla Dan(4044)
The Age of Surveillance Capitalism by Shoshana Zuboff(3964)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3844)
Embracing Microservices Design by Ovais Mehboob Ahmed Khan Nabil Siddiqui and Timothy Oleson(3648)
Applied Machine Learning for Healthcare and Life Sciences Using AWS by Ujjwal Ratan(3621)
