Closed stampaaaron closed 6 days ago
I'm glad you liked this extension. Does it work for you if ı add placeholderTextFontSize and searchFieldFontSize to SearchFieldDecoration model ?
@kspo I think it would be nice if we could pass a TextStyle
object to the decorator model. This way the font could adapt to the system font size (...I think).
My suggestion for new attributes on the SearchFieldDecoration
model:
textStyle
or style
(on the TextField
widget for example it's just called style
as well): a TextStyle
object controlling the font style of the text field.placeholderStyle
: a TextStyle
object inherited from the textStyle
/style
attribute which controls the style of the placeholder.This way you could also get rid of the placeholderColor
attribute, because this can be configured over the TextStyle object as well.
What do you think? Let me now if I can help you somehow with this.
@stampaaaron I added textStyle and placeholderStyle.
searchFieldDecoration: SearchFieldDecoration(
placeholderTextStyle: TextStyle(fontSize: 20, fontWeight: FontWeight.w800, height: 3),
textStyle: TextStyle(fontSize: 20, fontWeight: FontWeight.w800),
.
.
@kspo Thank you so much for reacting so quickly. I tried it out, but it sadly doesn't seem to fix my issue as I had expected. The problem is that the text field doesn't scale up with the font size and therefore the offset happens.
Here you see how the native CupertinoSearchTextField
behaves on scaling up the font size vs your custom Textfield:
Wouldn't it be easiest to just use this CupertinoSearchTextField
widget? or is there an Issue with animations or something?
You can also see for example that the "Files" App on IOS (which has a similar search UI is I'm trying to achieve) scales up the whole AppBar when the font is scaled up:
Do you think there is a chance to achieve that kind of behaviour for this library?
@stampaaaron, actually, if you have no urgency with your project, I am about to create version 2 of the super Cupertino navigation bar, which currently yields better performance results. The upcoming version will have more simplicity and flexibility. I believe the only missing attribute will be the "transition between routes," but perhaps in version 2.1 or 2.2, I will have added transition animations as well. So, I ask for some patience regarding any progress. Version 2 will be available within 1 week by the way.
@stampaaaron check out version 2. Its accessible on pub.dev now. I hope your requirements will be satisfied
When scaling up the IOS System Font size, the placeholder text of the search bar is being offset to the top.
When not scaled up:
In my example, I'm using the
AppBarType.NormalNavbarWithPinnedSearch
type.Accessibility Settings (Settings -> Accessibility -> Display & Text Size -> Larger Text):
Couldn't just use the
CupertinoSearchTextField
Widget for this library? There the scaling seems to work fine.Is there a workaround, that could be applied for this issue or planning on fixing this soon? :)
I really like this library and it would be very unfortunate, if we couldn't use it because of this bug.