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;
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
add a comment |
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
add a comment |
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
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
dart flutter visible
asked Mar 26 at 18:58
MilieMilie
3611 bronze badges
3611 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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
1
Instead oftcVisibility = false;
, it should betcVisibility = true;
in else clause.
– Tirth Patel
Mar 26 at 19:29
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
1
Instead oftcVisibility = false;
, it should betcVisibility = true;
in else clause.
– Tirth Patel
Mar 26 at 19:29
add a comment |
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
1
Instead oftcVisibility = false;
, it should betcVisibility = true;
in else clause.
– Tirth Patel
Mar 26 at 19:29
add a comment |
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
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
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 oftcVisibility = false;
, it should betcVisibility = true;
in else clause.
– Tirth Patel
Mar 26 at 19:29
add a comment |
1
Instead oftcVisibility = false;
, it should betcVisibility = 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
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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