gtgalone / prompt_dialog Goto Github PK
View Code? Open in Web Editor NEWPrompt Dialog Widget for Flutter(JS-LIKE).
Home Page: https://pub.dev/packages/prompt_dialog
License: MIT License
Prompt Dialog Widget for Flutter(JS-LIKE).
Home Page: https://pub.dev/packages/prompt_dialog
License: MIT License
In the Javascript prompt, pressing Enter will return the value. In this project, pressing Enter will unfocus the textbox.
For now, the workaround is to press Tab, Tab, Enter.
Btw, this is not urgent. I'm posting this to keep track of the issue.
I am testing your basic example and I see that when I start and open dialog so everything is OK.
But when I close and open it again so into Debug log it write:
W/IInputConnectionWrapper(16204): beginBatchEdit on inactive InputConnection
W/IInputConnectionWrapper(16204): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(16204): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper(16204): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(16204): endBatchEdit on inactive InputConnection
W/IInputConnectionWrapper(16204): beginBatchEdit on inactive InputConnection
W/IInputConnectionWrapper(16204): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(16204): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper(16204): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(16204): endBatchEdit on inactive InputConnection
And it is writting there everytime when the dialog is opened.
It looks like that first input wasn't closed correctly and there is still some inactive InputConnection
Can you fix it please? My logs are quite messy when I use promp_dialog more times..:
Debug service listening on ws://127.0.0.1:46217/6YiWkl9qWqs=/ws
Syncing files to device Android SDK built for x86...
I/zygote (16204): Do partial code cache collection, code=30KB, data=28KB
I/zygote (16204): After code cache collection, code=30KB, data=28KB
I/zygote (16204): Increasing code cache capacity to 128KB
I/flutter (16204): null
W/IInputConnectionWrapper(16204): beginBatchEdit on inactive InputConnection
W/IInputConnectionWrapper(16204): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(16204): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper(16204): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(16204): endBatchEdit on inactive InputConnection
W/IInputConnectionWrapper(16204): beginBatchEdit on inactive InputConnection
W/IInputConnectionWrapper(16204): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(16204): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper(16204): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(16204): endBatchEdit on inactive InputConnection
I/flutter (16204): null
W/IInputConnectionWrapper(16204): beginBatchEdit on inactive InputConnection
W/IInputConnectionWrapper(16204): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(16204): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper(16204): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(16204): endBatchEdit on inactive InputConnection
W/IInputConnectionWrapper(16204): beginBatchEdit on inactive InputConnection
W/IInputConnectionWrapper(16204): getTextBeforeCursor on inactive InputConnection
I/zygote (16204): Do partial code cache collection, code=57KB, data=48KB
I/zygote (16204): After code cache collection, code=57KB, data=48KB
I/zygote (16204): Increasing code cache capacity to 256KB
W/IInputConnectionWrapper(16204): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper(16204): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(16204): endBatchEdit on inactive InputConnection
Application finished.
Thanks for implementing the autofocus option! It'd be even more useful if it was set to true by default, since most users will want to type right away, instead of tapping the text box.
isSelectedInitialValue set true, but not work.
and add all properties of TextField please
When setting initialValue to something and then using the prompt without editing that initialValue, pressing ok will return null unless you do some typing.
I think having a value as null but an initialValue set this prompt should return initialValue "onOK"
Hi,
I really liked your package.
Please add onCancel callback. So that we can do something when that happens.
installing both prompt and confirm dialog causing prompt to close immediately
when i installed https://github.com/gtgalone/confirm_dialog, it works fine, but the prompt dialog disappear quickly
when i uninstalled confirm_dialog, prompt dialog works normally
please help thank you for this wonderful plugin
Please input type argument so as to render the keyboard appropriately
e.g email, number, text
Please add the folloing code to initState()
to make this field beneficial:
if (widget.isSelectedInitialValue) {
controller.selection = TextSelection(baseOffset: 0, extentOffset: value?.length ?? 0);
}
Thanks for the nice clean widget. I'm trying to get the validator to work. It may be that the validator message is displaying but the dialog still closes immediately.
So I tried the sample custom_message.dart.
First, the sample has some minor issues. The prompt widget needs a context that is a descendent of the MaterialApp. So I wrapped the Center Widget with a Builder for simplicity. Second I got some error related to the obscureText so I commented that out. Here is my updated sample.
import 'package:flutter/material.dart';
import 'package:prompt_dialog/prompt_dialog.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Welcome to Flutter',
home: Scaffold(
appBar: AppBar(
title: const Text('Welcome to Flutter'),
),
body: Builder(builder: (context) {
return Center(
child: TextButton(
onPressed: () async {
return print(await prompt(
context,
title: const Text('Would you like to remove?'),
initialValue: 'Sure',
isSelectedInitialValue: false,
textOK: const Text('Yes'),
textCancel: const Text('No'),
hintText: 'Please write reason',
validator: (String? value) {
if (value == null || value.isEmpty) {
return 'Please enter some text';
}
return null;
},
minLines: 2,
maxLines: 3,
autoFocus: false,
// obscureText: true,
obscuringCharacter: '*',
showPasswordIcon: true,
barrierDismissible: true,
textCapitalization: TextCapitalization.words,
));
},
child: const Text('Prompt Dialog'),
),
);
}),
),
);
}
}
When running this sample the validator message is never presented to the user.
In TextFormField add validators support pls
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.