Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FutureBuilder(
- future: doesNameAlreadyExist(Controller.text),
- builder: (context, AsyncSnapshot<bool> result) {
- if (!result.hasData)
- return Container(); // future still needs to be finished (loading)
- if (result
- .data) { // result.data is the returned bool from doesNameAlreadyExists
- return Text("Your ID exists",style: TextStyle(color: Colors.green),);
- }
- else
- return Text("Your ID does not exist",style: new TextStyle(color: Colors.red),);
- },
- ),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement