Open chrisbobbe opened 2 weeks ago
Hi I'm keen to get involved with this project and this issue looks like a good place to start, can I have a go at it?
@u7088495 Please take a look at the Zulip project's guide to getting involved with the code: https://zulip.readthedocs.io/en/latest/contributing/contributing.html#your-first-codebase-contribution https://zulip.readthedocs.io/en/latest/contributing/contributing.html#picking-an-issue-to-work-on
As demonstrated, in dialog.dart
I'd replace AlertDialog(
with AlertDialog.adaptive(
. I'd also implement the widget adaptiveAction
to return a CupertinoDialogAction(
for OS platforms and the regular textButton otherwise. As for the font, I am unsure how to fix that rather than by setting the textStyle property on the Text
widgets directly - I tried defining cupertino theme data but with no luck.
Sounds good!
As for the font, I am unsure how to fix that rather than by setting the textStyle property on the
Text
widgets directly - I tried defining cupertino theme data but with no luck.
I think it may be fine, actually, to accept the default styling, instead of overriding it with our custom styles with "Source Sans 3".
If we were using a native iOS API to show these alerts, we'd get whatever system-defined styles Apple chooses—like what's illustrated in this interface guidelines doc from Apple—and Flutter's defaults understandably mimic those.
Also, on the text alignment, with the CupertinoDialogAction
, the label doesn't wrap and so setting TextAlign.end
has no effect.
But I could still update this if its worth being explicit?
@u7088495 I think the most effective venue for getting that question answered would be in chat, in #mobile-dev-help. That will also help keep this issue thread focused.
We should experiment with the
AlertDialog.adaptive
constructor, instead ofAlertDialog
, which forces a Material-style dialog on iOS:The "after" screenshot was made by simply changing
AlertDialog(
toAlertDialog.adaptive(
. A complete fix will be a little more complicated than that, though. See the code sample on theAlertDialog.adaptive
doc, which shows a platform switch for the dialog's action buttons, to style those appropriately (including the buttons' on-press appearance):Relatedly, I think the
TextAlign.end
in our_dialogActionText
helper should not be applied on iOS because on iOS the button text is meant to be center-aligned.I also notice that our "Source Sans 3" font isn't being applied in the Cupertino-style dialog in the screenshot.
I think we want it to be, so we should debug and fix this.Probably should leave this be, actually; it's supposed to mimic the native iOS alert, which uses a system font, not an app's chosen font.