Saving dialog content before closing it Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Improve INSERT-per-second performance of SQLite?on click on edit text, one custom list dialog box comes and list items should change according to the text change in edit Text, for androidHow to Save data in existing list view to SQLITE database and clear the list view for a new listSave data from spinner or Edit text based on selected itemDismissing AlertDialog in FlutterFlutter create sqlite database helper to return only 1 String or any other single object typehow to update page state after Navigator.pop() from an alert boxNot closing the database with Flutter's SQFlite?Flutter - auto size alertDialog to fit list contentDart / Flutter - proper way of persisting lots of image files
Statistical analysis applied to methods coming out of Machine Learning
Is Mordenkainens' Sword under powered?
What did Turing mean when saying that "machines cannot give rise to surprises" is due to a fallacy?
How could a hydrazine and N2O4 cloud (or it's reactants) show up in weather radar?
In musical terms, what properties are varied by the human voice to produce different words / syllables?
How to ask rejected full-time candidates to apply to teach individual courses?
One-one communication
What does 丫 mean? 丫是什么意思?
Is this Half dragon Quaggoth Balanced
Why not use the yoke to control yaw, as well as pitch and roll?
How do you write "wild blueberries flavored"?
When to apply negative sign when number is squared
My mentor says to set image to Fine instead of RAW — how is this different from JPG?
malloc in main() or malloc in another function: allocating memory for a struct and its members
Sally's older brother
Why did Bronn offer to be Tyrion Lannister's champion in trial by combat?
Weaponising the Grasp-at-a-Distance spell
Does the transliteration of 'Dravidian' exist in Hindu scripture? Does 'Dravida' refer to a Geographical area or an ethnic group?
How can I prevent/balance waiting and turtling as a response to cooldown mechanics
Short story about astronauts fertilizing soil with their own bodies
Centre cell vertically in tabularx
What is the proper term for etching or digging of wall to hide conduit of cables
Relating to the President and obstruction, were Mueller's conclusions preordained?
Did any compiler fully use 80-bit floating point?
Saving dialog content before closing it
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!Improve INSERT-per-second performance of SQLite?on click on edit text, one custom list dialog box comes and list items should change according to the text change in edit Text, for androidHow to Save data in existing list view to SQLITE database and clear the list view for a new listSave data from spinner or Edit text based on selected itemDismissing AlertDialog in FlutterFlutter create sqlite database helper to return only 1 String or any other single object typehow to update page state after Navigator.pop() from an alert boxNot closing the database with Flutter's SQFlite?Flutter - auto size alertDialog to fit list contentDart / Flutter - proper way of persisting lots of image files
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I'm making a dialog containing a list of items, each of which includes an editable text field.
I'd like to save the contents of edited text fields to a SQLite database on dialog close.
How would I do that? There seems to be no such thing as an onClose listener in Flutter and once the dialog is closed, I won't be able to retrieve the text from text fields.
sqlite
add a comment |
I'm making a dialog containing a list of items, each of which includes an editable text field.
I'd like to save the contents of edited text fields to a SQLite database on dialog close.
How would I do that? There seems to be no such thing as an onClose listener in Flutter and once the dialog is closed, I won't be able to retrieve the text from text fields.
sqlite
add a comment |
I'm making a dialog containing a list of items, each of which includes an editable text field.
I'd like to save the contents of edited text fields to a SQLite database on dialog close.
How would I do that? There seems to be no such thing as an onClose listener in Flutter and once the dialog is closed, I won't be able to retrieve the text from text fields.
sqlite
I'm making a dialog containing a list of items, each of which includes an editable text field.
I'd like to save the contents of edited text fields to a SQLite database on dialog close.
How would I do that? There seems to be no such thing as an onClose listener in Flutter and once the dialog is closed, I won't be able to retrieve the text from text fields.
sqlite
sqlite
asked Mar 9 at 0:33
Tin ManTin Man
261216
261216
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
As You have not shared any code - so i share a minimal example of what you intend to do.
Data can be passed with the use of Navigator.
class DemoApp extends StatefulWidget
@override
DemoAppState createState()
return new DemoAppState();
class DemoAppState extends State<DemoApp>
String val = 'Empty';
TextEditingController cntrl = TextEditingController();
@override
void dispose()
cntrl.dispose();
super.dispose();
@override
Widget build(BuildContext context)
return Scaffold(
body: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('Value is -- $val'),
RaisedButton(
onPressed: () async
val = await showDialog(
context: context,
builder: (context)
cntrl.clear();
return AlertDialog(
title: Text('Enter Value'),
content: TextField(
controller: cntrl,
),
actions: <Widget>[
FlatButton(
onPressed: ()
Navigator.pop(context, cntrl.text);
,
child: Text('Save')),
],
);
);
setState(() );
,
child: Text('Edit Value'),
)
],
),
)));

Is there a way I can return that value without a button press? (Just closing the dialog by tapping the border around it)
– Tin Man
Mar 9 at 11:18
we actually need to pass value to -Navigator.pop- in the other case (Just closing the dialog by tapping the border around it) it's not happening. so no not directly. you can add -barrierDismissible: false,inshowDialogso user do press button to close the dialog. @TinMan
– anmol.majhail
Mar 9 at 11:25
1
Alright, thanks for the tip! :)
– Tin Man
Mar 9 at 16:17
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%2f55072834%2fsaving-dialog-content-before-closing-it%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
As You have not shared any code - so i share a minimal example of what you intend to do.
Data can be passed with the use of Navigator.
class DemoApp extends StatefulWidget
@override
DemoAppState createState()
return new DemoAppState();
class DemoAppState extends State<DemoApp>
String val = 'Empty';
TextEditingController cntrl = TextEditingController();
@override
void dispose()
cntrl.dispose();
super.dispose();
@override
Widget build(BuildContext context)
return Scaffold(
body: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('Value is -- $val'),
RaisedButton(
onPressed: () async
val = await showDialog(
context: context,
builder: (context)
cntrl.clear();
return AlertDialog(
title: Text('Enter Value'),
content: TextField(
controller: cntrl,
),
actions: <Widget>[
FlatButton(
onPressed: ()
Navigator.pop(context, cntrl.text);
,
child: Text('Save')),
],
);
);
setState(() );
,
child: Text('Edit Value'),
)
],
),
)));

Is there a way I can return that value without a button press? (Just closing the dialog by tapping the border around it)
– Tin Man
Mar 9 at 11:18
we actually need to pass value to -Navigator.pop- in the other case (Just closing the dialog by tapping the border around it) it's not happening. so no not directly. you can add -barrierDismissible: false,inshowDialogso user do press button to close the dialog. @TinMan
– anmol.majhail
Mar 9 at 11:25
1
Alright, thanks for the tip! :)
– Tin Man
Mar 9 at 16:17
add a comment |
As You have not shared any code - so i share a minimal example of what you intend to do.
Data can be passed with the use of Navigator.
class DemoApp extends StatefulWidget
@override
DemoAppState createState()
return new DemoAppState();
class DemoAppState extends State<DemoApp>
String val = 'Empty';
TextEditingController cntrl = TextEditingController();
@override
void dispose()
cntrl.dispose();
super.dispose();
@override
Widget build(BuildContext context)
return Scaffold(
body: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('Value is -- $val'),
RaisedButton(
onPressed: () async
val = await showDialog(
context: context,
builder: (context)
cntrl.clear();
return AlertDialog(
title: Text('Enter Value'),
content: TextField(
controller: cntrl,
),
actions: <Widget>[
FlatButton(
onPressed: ()
Navigator.pop(context, cntrl.text);
,
child: Text('Save')),
],
);
);
setState(() );
,
child: Text('Edit Value'),
)
],
),
)));

Is there a way I can return that value without a button press? (Just closing the dialog by tapping the border around it)
– Tin Man
Mar 9 at 11:18
we actually need to pass value to -Navigator.pop- in the other case (Just closing the dialog by tapping the border around it) it's not happening. so no not directly. you can add -barrierDismissible: false,inshowDialogso user do press button to close the dialog. @TinMan
– anmol.majhail
Mar 9 at 11:25
1
Alright, thanks for the tip! :)
– Tin Man
Mar 9 at 16:17
add a comment |
As You have not shared any code - so i share a minimal example of what you intend to do.
Data can be passed with the use of Navigator.
class DemoApp extends StatefulWidget
@override
DemoAppState createState()
return new DemoAppState();
class DemoAppState extends State<DemoApp>
String val = 'Empty';
TextEditingController cntrl = TextEditingController();
@override
void dispose()
cntrl.dispose();
super.dispose();
@override
Widget build(BuildContext context)
return Scaffold(
body: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('Value is -- $val'),
RaisedButton(
onPressed: () async
val = await showDialog(
context: context,
builder: (context)
cntrl.clear();
return AlertDialog(
title: Text('Enter Value'),
content: TextField(
controller: cntrl,
),
actions: <Widget>[
FlatButton(
onPressed: ()
Navigator.pop(context, cntrl.text);
,
child: Text('Save')),
],
);
);
setState(() );
,
child: Text('Edit Value'),
)
],
),
)));

As You have not shared any code - so i share a minimal example of what you intend to do.
Data can be passed with the use of Navigator.
class DemoApp extends StatefulWidget
@override
DemoAppState createState()
return new DemoAppState();
class DemoAppState extends State<DemoApp>
String val = 'Empty';
TextEditingController cntrl = TextEditingController();
@override
void dispose()
cntrl.dispose();
super.dispose();
@override
Widget build(BuildContext context)
return Scaffold(
body: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('Value is -- $val'),
RaisedButton(
onPressed: () async
val = await showDialog(
context: context,
builder: (context)
cntrl.clear();
return AlertDialog(
title: Text('Enter Value'),
content: TextField(
controller: cntrl,
),
actions: <Widget>[
FlatButton(
onPressed: ()
Navigator.pop(context, cntrl.text);
,
child: Text('Save')),
],
);
);
setState(() );
,
child: Text('Edit Value'),
)
],
),
)));

answered Mar 9 at 11:16
anmol.majhailanmol.majhail
5,4412624
5,4412624
Is there a way I can return that value without a button press? (Just closing the dialog by tapping the border around it)
– Tin Man
Mar 9 at 11:18
we actually need to pass value to -Navigator.pop- in the other case (Just closing the dialog by tapping the border around it) it's not happening. so no not directly. you can add -barrierDismissible: false,inshowDialogso user do press button to close the dialog. @TinMan
– anmol.majhail
Mar 9 at 11:25
1
Alright, thanks for the tip! :)
– Tin Man
Mar 9 at 16:17
add a comment |
Is there a way I can return that value without a button press? (Just closing the dialog by tapping the border around it)
– Tin Man
Mar 9 at 11:18
we actually need to pass value to -Navigator.pop- in the other case (Just closing the dialog by tapping the border around it) it's not happening. so no not directly. you can add -barrierDismissible: false,inshowDialogso user do press button to close the dialog. @TinMan
– anmol.majhail
Mar 9 at 11:25
1
Alright, thanks for the tip! :)
– Tin Man
Mar 9 at 16:17
Is there a way I can return that value without a button press? (Just closing the dialog by tapping the border around it)
– Tin Man
Mar 9 at 11:18
Is there a way I can return that value without a button press? (Just closing the dialog by tapping the border around it)
– Tin Man
Mar 9 at 11:18
we actually need to pass value to -
Navigator.pop - in the other case (Just closing the dialog by tapping the border around it) it's not happening. so no not directly. you can add - barrierDismissible: false, in showDialog so user do press button to close the dialog. @TinMan– anmol.majhail
Mar 9 at 11:25
we actually need to pass value to -
Navigator.pop - in the other case (Just closing the dialog by tapping the border around it) it's not happening. so no not directly. you can add - barrierDismissible: false, in showDialog so user do press button to close the dialog. @TinMan– anmol.majhail
Mar 9 at 11:25
1
1
Alright, thanks for the tip! :)
– Tin Man
Mar 9 at 16:17
Alright, thanks for the tip! :)
– Tin Man
Mar 9 at 16:17
add a comment |
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%2f55072834%2fsaving-dialog-content-before-closing-it%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