mono0926 / adaptive_dialog Goto Github PK
View Code? Open in Web Editor NEWShow alert dialog or modal action sheet adaptively according to platform.
Home Page: https://pub.dev/packages/adaptive_dialog
License: MIT License
Show alert dialog or modal action sheet adaptively according to platform.
Home Page: https://pub.dev/packages/adaptive_dialog
License: MIT License
Hi,
Is there any way while using showConfirmationDialog
to have a more "responsive" height?
The widget works well when the list is long enough to be scrollable, and I am aware of contentMaxHeight
which I am using currently, but it's not ideal.
Maybe you could add an option to pass to the widget's ListView
a shrinkWrap
value, so one could set it to true
.
Thanks!
Hi, thanks for your attention in advance.
Is there any param to prevent physical return/back action? Such as the back key on android device? The param 'barrierDismissible' can't satisfy my requirement.
When using a modal action sheet with many options it is well scrollable under iOS but not on Android. So the user can only select the first ~5 options.
Why i get some second alert dialog after press OK?
How i can get text from showTextAnswerDialog ?
Somebody give me example please.
Text in showTextInputDialog
is not visible in dark mode.
Need to add optional parameter Key to be able to use integration test
As a user, I would like the form to automatically submit when the user hits the enter button on the last text input field.
Add an optional bool autoSubmit = false
arg to showTextAnswerDialog()
onSubitted
action should auto-submit the formI use your plugin but on iOS 14 i've this error:
The following NoSuchMethodError was thrown while handling a gesture:
The getter 'modalBarrierDismissLabel' was called on null.
Receiver: null
Tried calling: modalBarrierDismissLabel
this is my code:
return GridView.builder( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3), itemBuilder: (_, index) => Builder( builder: (context) => InkWell( onTap: () { if (index == TeouResponses.MAP_OF_RESPONSES.length - 1) { showTextInputDialog( context: context, title: "Je suis...", textFields: [DialogTextField(hintText: "test")], okLabel: "Envoyer", cancelLabel: "Annuler", barrierDismissible: true) .then((inputText) { if (inputText != null && inputText.length > 0) { _textResponse = inputText[0]; _actionsAfterCLick(index); } }); } else if (index == TeouResponses.MAP_OF_RESPONSES.length - 2) { _onImageButtonPressed(ImageSource.camera, context: context, index: TeouResponses.MAP_OF_RESPONSES.length - 2); } else { _actionsAfterCLick(index); } }, child: Card( elevation: 4, child: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ SizedBox( height: 60, child: Image( image: TeouResponses.MAP_OF_RESPONSES.values .toList()[index]), ), SizedBox( height: 10, ), Center( child: Text( TeouResponses.MAP_OF_RESPONSES.keys.toList()[index], textAlign: TextAlign.center, ), ) ], ), ), )), ), itemCount: TeouResponses.MAP_OF_RESPONSES.length, );
In my app, I need to change the text direction of the title and the content in the dialog but I could not because there is no argument provided for text direction.
Expected Behaviour
The dialog should have support for text direction by making Directionality the root child of the dialog.
showModal(
context: context,
useRootNavigator: useRootNavigator,
configuration: FadeScaleTransitionConfiguration(
barrierDismissible: barrierDismissible,
),
builder: (context) => Directionality(
textDirection: TextDirection.rtl,
child: WillPopScope(
onWillPop: onWillPop,
child: AlertDialog(
title: titleText,
content: messageText,
actions: actions.convertToMaterialDialogActions(
onPressed: pop,
destructiveColor: colorScheme.error,
fullyCapitalized: fullyCapitalizedForMaterial,
),
actionsOverflowDirection: actionsOverflowDirection,
scrollable: true,
),
),
),
);
I do not understand how i can handle OK and CANCEL buttons in showTextInputDialog. In future i get only text from textField.
and why i have this?
showTextInputDialog(
context: context,
textFields: [DialogTextField()],
title: 'Создание папки',
message: 'Введите название папки',
okLabel: 'Создать',
cancelLabel: 'Отмена',
).then((newFolder) {
print(newFolder.isEmpty); ----This is FALSE
print(newFolder); ---- and this get me [ ] - empty!
i have showTextInputDialog()
but where i can past functions on OK and CANCEL buttons?
for example i expect some like this:
showTextInputDialog(
onPressOKButton(){
doSomeThing
}
onPressCANCELButton(){
doSomeThing
}
)
How i can handle tap on OK and CANCEL buttons???
The method 'showOkCancelAlertDialog' can't scroll on android.
This situation occurs when the focus is not on the input, and it can be seen when the focus is on the input
Please add null safety to this project
Is it possible to have a default selected value in showConfirmationDialog
?
I understand that isDefaultAction
is not what I am talking about.
Thank you!
builder
parameter allows you to change the Theme.
The builder parameter can be used to wrap the dialog widget to add inherited widgets like Theme.
showDatePicker function - material library - Dart API
On projects with null safety we now get a warning that this package should not be imported. A migration to null safety would solve this. I guess I shouldnt be too much work because most of the code should already be null safe.
On IOS devices, the first time you use the spring box, you get stuck
After appearing once, it is normal to open the cartridge again
It would be awesome if this package could be migrated to null safety.
It can be input more then 5 lines.
final introductions = await showTextInputDialog(
context: context,
textFields: [
DialogTextField(
initialText: _userInfo.introduction,
keyboardType: TextInputType.multiline,
// minLines: 1,
maxLines: 5,
),
],
title: 'input introduction',
);
I want to implement a feature like
"disable "ok" when input text is empty on showTextInputDialog"
is it support?
HI,
i am looking forward to showing a dialog from inside a Getx Controller
when a push notification been received,
i don't have a context in this situation
is it possible show dialog without context
The showTextInputDialog will return a String with closing the dialog.
I don't want to close the dialog, how could I finish the aysncronous validation when ok pressed?
Hi!
I have a tabbed setup that use nested Navigators. It seems that the dialogs are displayed using the root navigator, because when the void pop(T key) => Navigator.of(context).pop(key);
is executed in showAlertDialog<T>
after pressing any dialog's action button, the tab's page is popped but the dialog stays on the screen.
I was able to successfully fix the issue by forcing to pop using root navigator, so that the dialog is actually removed off the screen after pressing an action button:
void pop(T key) => Navigator.of(context, rootNavigator: true).pop(key);
Would you be so kind to extend your API to support this scenario? Thank you in advance, I love your work.
Hi, sorry for my english.
I have a issue when I use showModalActioSheet. In iOS looks good but in Android the background color it's transparent and I don't see the content. This is my code:
import 'package:adaptive_dialog/adaptive_dialog.dart' as adaptive;
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
Future<String> showOptionsBottomMenu({
@required BuildContext context,
String title = 'Opciones',
String cancelLabel = 'Cancelar',
String message,
}) async {
return await adaptive.showModalActionSheet<String>(
context: context,
title: title,
cancelLabel: cancelLabel,
message: message,
isDismissible: true,
style: adaptive.AdaptiveStyle.material,
actions: [
const adaptive.SheetAction(
label: 'Tomar Foto',
icon: Icons.insert_photo,
key: 'tomar',
),
const adaptive.SheetAction(
label: 'Seleccionar Fotos',
icon: Icons.insert_photo,
key: 'seleccionar',
),
const adaptive.SheetAction(
label: 'Seleccionar archivos pdf, word, excel, power point',
icon: Icons.insert_photo,
key: 'seleccionar_archivos',
),
],
);
}
I'm using Flutter v1.17.3.
Here the screenshots:
in the normal dialog i can wrap it with BackdropFilter so that i can have a dimmer background when calling the dialog?
i want to show this instead of a full add a post page in a FB like app//// i want to have a add image. and a textbox too in this model dialog pleas etell
MyCode:
showTextInputDialog(
context: context,
title: 'Test Text Input Dialog',
textFields: [
DialogTextField(
hintText: 'Input value',
keyboardType: TextInputType.number,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter number';
}
debugPrint('Value: $value');
return null;
},
)
],
)
Looks nice but where is the pub link or docs so that tell us how to use this ?
Is there a way to have more than 1 message for the alert? So the 2nd message will be on a new line
I found a issue that when I switch to dark mode.
The DialogTextField text color still black.
We cannot see. the text because the color is same with background.
Is there any way to set DialogTextField text color?
showModalActionSheet<int>(
context: context,
actions: List.generate(10, (i) {
return SheetAction<int>(
key: i,
label: i.toString(),
);
}),
);
But clicking on Cancel doesn't.
iOS13, iPhone 11
I use MaterialApp for my application and i can configure the cursorColor inside themeData, but it only affects android and not iOS
Currently there is no way to disable auto correct/auto suggestions while using DialogTextField() that I could find. I would like this ability to be able to type in a URL without iOS auto correcting the URL as I type.
It is currently missing in showTextInputDialog
which is also used by showTextAnswerDialog
.
Just like showOkCancelAlertDialog but using text Yes/No instead of OK/Cancel respectively. Thanks!
Your sdk requirement of >=2.12.0-0 prevents this from being built on the stable channel of flutter, and on the beta channel and below, the following error arises upon trying to build and run the example flutter app.
/C:/Software/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.18.1/lib/src/picture_provider.dart:50:59: Error: No named parameter with the name 'nullOk'.
context != null ? Localizations.localeOf(context, nullOk: true) : null,
^^^^^^
/C:/Software/flutter/packages/flutter/lib/src/widgets/localizations.dart:413:17: Context: Found this candidate, but the arguments don't match.
static Locale localeOf(BuildContext context) {
^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Software\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Software\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 14s
Exception: Gradle task assembleDebug failed with exit code 1
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.