New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Landscape version? #2
Comments
Perfect. Thanks! Only other enhancement I would love is to be able to inject style into the title for both orientations. Trying to make it consistent with the built in material pickers and they have a background on the title. |
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
titlePadding: EdgeInsets.all(0.0),
contentPadding: EdgeInsets.all(0.0),
title: Container(
color: Theme.of(context).primaryColor,
child: Center(
child: const Text(
'Pick a color!',
style: TextStyle(
fontSize: 20.0,
color: const Color(0xffffffff),
),
),
),
padding: EdgeInsets.all(20.0),
),
content: SingleChildScrollView(
child: ColorPicker(
pickerColor: pickerColor,
onColorChanged: changeColor,
colorPickerWidth: 1000.0,
pickerAreaHeightPercent: 0.7,
),
),
actions: <Widget>[
FlatButton(
child: Text('Got it'),
onPressed: () {
setState(() => currentColor = pickerColor);
Navigator.of(context).pop();
},
),
],
);
},
) |
That is very nice! Only additional tweak for consistency with stock pickers would be the buttons should be "CANCEL" and "OK". |
You can do this by editing the actions: <Widget>[
FlatButton(
child: Text('OK'),
onPressed: () {
setState(() => currentColor = pickerColor);
Navigator.of(context).pop();
},
),
FlatButton(
child: Text('CANCEL'),
onPressed: () => Navigator.of(context).pop(),
),
], |
Suggestion to update your project example to show usage of landscape orientation (and switching). |
This is what I get trying to package it into landscape: Actual usage code for reference is here: * Note: portrait works as expected. |
What's your example result? Looks like you need to fill the |
|
Would love an alternate layout that works in landscape format. Perhaps with the color square in the left and the sliders on the right. For reference see the date_picker.dart showDatePicker() dialog that displays differently depending on orientation.
The text was updated successfully, but these errors were encountered: