kspo / super_cupertino_navigation_bar

This package offers a collapsible app bar along with an attractive search bar animation, enhancing the visual appeal of your Flutter app with an iOS-inspired design. This package is versatile, allowing complete customization, and it seamlessly works on both iOS and Android platforms.
https://pub.dev/packages/super_cupertino_navigation_bar
MIT License
55 stars 9 forks source link

Placeholder text offset when scaling up system accessibility text size #1

Closed stampaaaron closed 6 days ago

stampaaaron commented 6 months ago

When scaling up the IOS System Font size, the placeholder text of the search bar is being offset to the top.

search_bar_2

When not scaled up:

search_bar_1

In my example, I'm using the AppBarType.NormalNavbarWithPinnedSearch type.

Accessibility Settings (Settings -> Accessibility -> Display & Text Size -> Larger Text):

image

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.

kspo commented 6 months ago

I'm glad you liked this extension. Does it work for you if ı add placeholderTextFontSize and searchFieldFontSize to SearchFieldDecoration model ?

stampaaaron commented 6 months ago

@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:

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.

kspo commented 6 months ago

@stampaaaron I added textStyle and placeholderStyle.

stampaaaron commented 6 months ago

@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:

image

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:

Simulator Screenshot - iPhone 15 Pro - 2023-12-21 at 13 30 35 Simulator Screenshot - iPhone 15 Pro - 2023-12-21 at 13 30 14

Do you think there is a chance to achieve that kind of behaviour for this library?

kspo commented 6 months ago

@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.

kspo commented 6 months ago

@stampaaaron check out version 2. Its accessible on pub.dev now. I hope your requirements will be satisfied