Textfield validation in flutter

Joined
Jan 29, 2022
Messages
6
Reaction score
0
Working with flutter and dart project.Navigating from prev to next screen and then fetching some info of previous screen and then comes the textfield where need to validate number of characters to enter and button enable disable its easy but confusing in my project please help ..
 
Joined
Jan 29, 2022
Messages
6
Reaction score
0
can elaborate more on this?


Are you able to pass data from previous screen to next screen?



Noo as I have screen where there is card(visacard) on that nickname is there eg abc so i have one textbutton change nickname so from that i'm navigating to next screen which is change nickname screen now there is textformfield where i can see ABC name of card already there and the there is textbutton which should be disable so now i can update name with min 15 characters and button gets enable so that name will update to previous screen on that card the name will change that what i want to implement can you please help me
 
Joined
Apr 25, 2017
Messages
251
Reaction score
33
You can return the name from Change NickName Screen to PreviousScreen, then use setState to refresh the page.

PreviousScreen

Java:
Navigator.pushNamed(context, ChangeNickName.ROUTE,arguments: name).then((onValue){
  setState(() {
          onValue = name;
      });
 
Joined
Mar 5, 2023
Messages
36
Reaction score
12
Hey there do you know how to run tests and analyze in Nx for flutter app?

Yes, I can guide you through running tests and analyzing in Nx for a Flutter app. Here are the steps:

  1. Install Nx: If you haven't installed Nx yet, you can do it by running the following command in your terminal:
Java:
npm install -g @nrwl/cli

  1. Create a new Flutter app with Nx: You can create a new Flutter app with Nx by running the following command:
Code:
nx create my-app --preset=flutter

This command will create a new Flutter app with Nx set up and ready to go.

  1. Run tests: To run tests in Nx for your Flutter app, you can use the test command.
Bash:
nx test my-app

This command will run all the tests in your Flutter app.

  1. Analyze test coverage: To analyze test coverage in Nx for your Flutter app, you can use the test --coverage command.
Bash:
nx test my-app --coverage

This command will run all the tests in your Flutter app and generate a coverage report.

  1. View test coverage report: After running the test --coverage command, you can view the test coverage report by opening the coverage/lcov-report/index.html file in your browser.
That's it! You now know how to run tests and analyze test coverage in Nx for your Flutter app.
 
Joined
Nov 23, 2023
Messages
53
Reaction score
2
Working with flutter and dart project.Navigating from prev to next screen and then fetching some info of previous screen and then comes the textfield where need to validate number of characters to enter and button enable disable its easy but confusing in my project please help ..
Depending on your data source (API, local storage, etc.), use appropriate methods to fetch information. Consider using providers or state management solutions for more complex data flows.
 
Joined
Nov 23, 2023
Messages
53
Reaction score
2
Working with flutter and dart project.Navigating from prev to next screen and then fetching some info of previous screen and then comes the textfield where need to validate number of characters to enter and button enable disable its easy but confusing in my project please help ..
Set the _buttonEnabled flag to true only if the character count meets your minimum requirement.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top