Making a Text Widget visible after button clickTextField controller.clear() doesn't actually clear the TextFieldFlutter : Can I add a Header Row to a ListViewNetwork Request after button click with Flutterupdating text field in flutter on button clickHow to offset a scaffold widget in Flutter?Flutter : Bad state: Stream has already been listened toHide Text Widget visibility in Flutter on the click of buttonMake cards with texts and buttons dynamicallyHow to make different style in same text widget?FloatingActionButton backgroundColor defaults to accentColor

Why do they sell Cat 5 Ethernet splitters if you can’t split the signal?

Why is the number of local variables used in a Java bytecode method not the most economical?

Assuring luggage isn't lost with short layover

Why is it "on the inside" and not "in the inside"?

Does Dispel Magic destroy Artificer Turrets?

What container to use to store developer concentrate?

Adopting a feral cat

How do I use JSON.generator to generate an unnamed array?

Did Vladimir Lenin have a cat?

How do I access the checkbox field column value as a PHP array?

Did the Americans trade destroyers in the "destroyer deal" that they would later need themselves?

How can Paypal know my card is being used in another account?

Why does the Rust compiler not optimize code assuming that two mutable references cannot alias?

Is it okay for me to decline a project on ethical grounds?

Why do the numerator and denominator of a rational number have to be in their lowest term?

Should I accept an invitation to give a talk from someone who might review my proposal?

Can a US President, after impeachment and removal, be re-elected or re-appointed?

This day in history III

Must a song using the A minor scale begin or end with an Am chord? If not, how can I tell what the scale is?

How can religions be structured in ways that allow inter-faith councils to work?

2 weeks and a tight budget to prepare for Z-day. How long can I hunker down?

Is it safe if the neutral lead is exposed and disconnected?

Why did I lose on time with 3 pawns vs Knight. Shouldn't it be a draw?

Compound Word Neologism



Making a Text Widget visible after button click


TextField controller.clear() doesn't actually clear the TextFieldFlutter : Can I add a Header Row to a ListViewNetwork Request after button click with Flutterupdating text field in flutter on button clickHow to offset a scaffold widget in Flutter?Flutter : Bad state: Stream has already been listened toHide Text Widget visibility in Flutter on the click of buttonMake cards with texts and buttons dynamicallyHow to make different style in same text widget?FloatingActionButton backgroundColor defaults to accentColor






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I have a basic login page that consists of an 'email', 'password' and a 'SwitchListTile' (Switch) that users will select to confirm reading of legal documents. On 'Login', I would like the 'Text' to show. Default is invisible.



I implemented the visibility of the Text using the 'Visibility' class. Now I would like to make it visible using an 'if-else' check.



 SwitchListTile(
value: _acceptTerms,
onChanged: (bool value)
setState(()
_acceptTerms = value;
);
,
title: Text('Accept T&Cs'),
),
SizedBox(height: 5.0),
Visibility(
visible: false,
child: Text(
'Please accept Terms & Conditions!',
style: TextStyle(color: Colors.red),
)),
SizedBox(
height: 10.0,
),
RaisedButton(
color: Theme.of(context).primaryColor,
textColor: Colors.white,
child: Text('LOGIN'),
onPressed: ()
print(_emailValue);
print(_passwordValue);
if(_acceptTerms)
Navigator.pushReplacementNamed(context, '/products');
else
//code to make invisible text visible

,
),


I'm still new to Flutter and Dart development. Thanks.










share|improve this question






























    2















    I have a basic login page that consists of an 'email', 'password' and a 'SwitchListTile' (Switch) that users will select to confirm reading of legal documents. On 'Login', I would like the 'Text' to show. Default is invisible.



    I implemented the visibility of the Text using the 'Visibility' class. Now I would like to make it visible using an 'if-else' check.



     SwitchListTile(
    value: _acceptTerms,
    onChanged: (bool value)
    setState(()
    _acceptTerms = value;
    );
    ,
    title: Text('Accept T&Cs'),
    ),
    SizedBox(height: 5.0),
    Visibility(
    visible: false,
    child: Text(
    'Please accept Terms & Conditions!',
    style: TextStyle(color: Colors.red),
    )),
    SizedBox(
    height: 10.0,
    ),
    RaisedButton(
    color: Theme.of(context).primaryColor,
    textColor: Colors.white,
    child: Text('LOGIN'),
    onPressed: ()
    print(_emailValue);
    print(_passwordValue);
    if(_acceptTerms)
    Navigator.pushReplacementNamed(context, '/products');
    else
    //code to make invisible text visible

    ,
    ),


    I'm still new to Flutter and Dart development. Thanks.










    share|improve this question


























      2












      2








      2








      I have a basic login page that consists of an 'email', 'password' and a 'SwitchListTile' (Switch) that users will select to confirm reading of legal documents. On 'Login', I would like the 'Text' to show. Default is invisible.



      I implemented the visibility of the Text using the 'Visibility' class. Now I would like to make it visible using an 'if-else' check.



       SwitchListTile(
      value: _acceptTerms,
      onChanged: (bool value)
      setState(()
      _acceptTerms = value;
      );
      ,
      title: Text('Accept T&Cs'),
      ),
      SizedBox(height: 5.0),
      Visibility(
      visible: false,
      child: Text(
      'Please accept Terms & Conditions!',
      style: TextStyle(color: Colors.red),
      )),
      SizedBox(
      height: 10.0,
      ),
      RaisedButton(
      color: Theme.of(context).primaryColor,
      textColor: Colors.white,
      child: Text('LOGIN'),
      onPressed: ()
      print(_emailValue);
      print(_passwordValue);
      if(_acceptTerms)
      Navigator.pushReplacementNamed(context, '/products');
      else
      //code to make invisible text visible

      ,
      ),


      I'm still new to Flutter and Dart development. Thanks.










      share|improve this question














      I have a basic login page that consists of an 'email', 'password' and a 'SwitchListTile' (Switch) that users will select to confirm reading of legal documents. On 'Login', I would like the 'Text' to show. Default is invisible.



      I implemented the visibility of the Text using the 'Visibility' class. Now I would like to make it visible using an 'if-else' check.



       SwitchListTile(
      value: _acceptTerms,
      onChanged: (bool value)
      setState(()
      _acceptTerms = value;
      );
      ,
      title: Text('Accept T&Cs'),
      ),
      SizedBox(height: 5.0),
      Visibility(
      visible: false,
      child: Text(
      'Please accept Terms & Conditions!',
      style: TextStyle(color: Colors.red),
      )),
      SizedBox(
      height: 10.0,
      ),
      RaisedButton(
      color: Theme.of(context).primaryColor,
      textColor: Colors.white,
      child: Text('LOGIN'),
      onPressed: ()
      print(_emailValue);
      print(_passwordValue);
      if(_acceptTerms)
      Navigator.pushReplacementNamed(context, '/products');
      else
      //code to make invisible text visible

      ,
      ),


      I'm still new to Flutter and Dart development. Thanks.







      dart flutter visible






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 26 at 18:58









      MilieMilie

      3611 bronze badges




      3611 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          4














          The only way to do this in flutter is to create a variable



          var tcVisibility = false


          set the visibility of the text box to the variable



          Visibility(
          visible: tcVisibility,
          child: Text(
          'Please accept Terms & Conditions!',
          style: TextStyle(color: Colors.red),
          )),


          then in the code update the variable



          if(_acceptTerms) 
          Navigator.pushReplacementNamed(context, '/products');
          else
          setState(()
          tcVisibility = true;
          );



          Answer Updated






          share|improve this answer






















          • 1





            Instead of tcVisibility = false;, it should be tcVisibility = true; in else clause.

            – Tirth Patel
            Mar 26 at 19:29










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55364480%2fmaking-a-text-widget-visible-after-button-click%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4














          The only way to do this in flutter is to create a variable



          var tcVisibility = false


          set the visibility of the text box to the variable



          Visibility(
          visible: tcVisibility,
          child: Text(
          'Please accept Terms & Conditions!',
          style: TextStyle(color: Colors.red),
          )),


          then in the code update the variable



          if(_acceptTerms) 
          Navigator.pushReplacementNamed(context, '/products');
          else
          setState(()
          tcVisibility = true;
          );



          Answer Updated






          share|improve this answer






















          • 1





            Instead of tcVisibility = false;, it should be tcVisibility = true; in else clause.

            – Tirth Patel
            Mar 26 at 19:29















          4














          The only way to do this in flutter is to create a variable



          var tcVisibility = false


          set the visibility of the text box to the variable



          Visibility(
          visible: tcVisibility,
          child: Text(
          'Please accept Terms & Conditions!',
          style: TextStyle(color: Colors.red),
          )),


          then in the code update the variable



          if(_acceptTerms) 
          Navigator.pushReplacementNamed(context, '/products');
          else
          setState(()
          tcVisibility = true;
          );



          Answer Updated






          share|improve this answer






















          • 1





            Instead of tcVisibility = false;, it should be tcVisibility = true; in else clause.

            – Tirth Patel
            Mar 26 at 19:29













          4












          4








          4







          The only way to do this in flutter is to create a variable



          var tcVisibility = false


          set the visibility of the text box to the variable



          Visibility(
          visible: tcVisibility,
          child: Text(
          'Please accept Terms & Conditions!',
          style: TextStyle(color: Colors.red),
          )),


          then in the code update the variable



          if(_acceptTerms) 
          Navigator.pushReplacementNamed(context, '/products');
          else
          setState(()
          tcVisibility = true;
          );



          Answer Updated






          share|improve this answer















          The only way to do this in flutter is to create a variable



          var tcVisibility = false


          set the visibility of the text box to the variable



          Visibility(
          visible: tcVisibility,
          child: Text(
          'Please accept Terms & Conditions!',
          style: TextStyle(color: Colors.red),
          )),


          then in the code update the variable



          if(_acceptTerms) 
          Navigator.pushReplacementNamed(context, '/products');
          else
          setState(()
          tcVisibility = true;
          );



          Answer Updated







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 26 at 19:40

























          answered Mar 26 at 19:18









          DevTardDevTard

          2151 silver badge9 bronze badges




          2151 silver badge9 bronze badges










          • 1





            Instead of tcVisibility = false;, it should be tcVisibility = true; in else clause.

            – Tirth Patel
            Mar 26 at 19:29












          • 1





            Instead of tcVisibility = false;, it should be tcVisibility = true; in else clause.

            – Tirth Patel
            Mar 26 at 19:29







          1




          1





          Instead of tcVisibility = false;, it should be tcVisibility = true; in else clause.

          – Tirth Patel
          Mar 26 at 19:29





          Instead of tcVisibility = false;, it should be tcVisibility = true; in else clause.

          – Tirth Patel
          Mar 26 at 19:29








          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55364480%2fmaking-a-text-widget-visible-after-button-click%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript