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

Some bugs and glitches. #3

Closed fikretsengul closed 5 months ago

fikretsengul commented 6 months ago

Hello, first of all thank you for creating this awesome package. Great job!

But there are some bugs related to titles which are chopped down. If you check the example web app:

1- When you scroll down (when the small title is visible), and navigate to Apple Store for ex. when you slowly swipe back, 'Welcome' text becomes 'Welcom' until animation ends it becomes 'Welcome'.

This gets fixed if I add fontSize: 20,

appBarTheme: const AppBarTheme( backgroundColor: Colors.black, titleTextStyle: TextStyle(fontSize: 20), ),

or inherit: false in title texts text style.

2- It doesn't happen on some routes (weird) like All Shortcuts but this time the large title is cropped while opening that route like (All Shortc...) then becomes All Shortcuts.

3- Or for the previousPageTitle if you write 'Testings' (which isn't stated but must be lower than 12 chars) and start to swipe back it becomes 'Testi...'.

4- Moreover, the title param is Widget? but if you wrap the text widget with sizedbox for ex. you'll get exceptions. If it's not allowed it should take only text widgets.

5- You use MaterialApp but if I try to use CupertinoApp I get some random "Null check operator used on a null value" error. Also I cannot customize on scroll background color (which is different from background color). note: using theme data with copywith and cupertinoOverrideTheme is the solution I guess.

6- But we cannot change the automatic leading icon and its color also the previousPageTitle text style. If we provide a leading widget this will not be animated.

6- There is a little more space in the transition from the large title to the small title compared to the actual iOS transition. Normally, the small title should be visible when the large title disappears completely, but there is a slight difference here.

7- Also Flutters cupertino appbar uses ImageFilter.blur(sigmaX: 10, sigmaY: 10) but you use 20. Which is more aligned with iOS original appbar?

8- How we can change blue primary color theme for the whole app if we continue to use MaterialApp?

9- If we open Apple Contacts example trailing add icon is blue while transiting but becomes white at the end.

It'd be awesome if these can be fixed. Thank you again for the package.

fikretsengul commented 6 months ago

Also I couldn't add RefreshIndicator to my SuperScaffold body. (Its a column, I can't use it with CustomScrollView and NestedScrollView to provide that, getting Vertical viewport was given unbounded height.) If we add any ListView or grid view we have to make it physics neverscrollable if I want to put it in SuperScaffold body which prevents refresh indicator scrolls also.

I tried to implement infinite_scroll_pagination grid view but no luck to implement refresh indicator. flutter_easy_refresh works for nested scroll view but super scaffold doesn't allow me to dynamically capture the height. via expanded, layout builder etc. Also https://xuelongqy.github.io/flutter_easy_refresh/#/sample/nested-scroll-view when I implement this with SizedBox wrapped, internal scroll works but sliver cupertino appbar stops working.

Any suggestion? I think we should use ExtendedNestedScrollView (extended_nested_scroll_view) inside the super scaffold for the body.

kspo commented 6 months ago

I'm glad you liked the package @fikretsengul. What makes me even happier is if you thoroughly examine the package and create a bug list. I will review this bug list and provide feedback here again.

fikretsengul commented 6 months ago

@kspo Thank you for your response. I'm refactoring the library by adding nested scroll view feature, separating main.dart into separate classes (to increase performance, readability and maintability), code optimization and adding strict linting rules. I'll be checking bugs and try to fix them. You can check it from here: https://github.com/fikretsengul/super_cupertino_navigation_bar/tree/dev

Reviewing my changes or any other help is appreciated and will be awesome.

NOTE: Currently, If you compile the dev branch and try, there is a small appbar glitch issue since I made a lot of changes, I will be fixing it.

kspo commented 6 months ago

It seems like you've done a great job. Although I haven't examined your changes thoroughly yet, I noticed two minor correction that I can share with you.

  1. Specifically, if you synchronize the parameters in the widgets not during construction but within initState, it will require restarting the application instead of using "hot reload" to see user changes in the Example scenarios.
  2. Another matter is regarding the refresh indicator: the refresh method you used with the extended_nested_scroll_view doesn't quite give me the feel of a complete iOS user experience. What I had in mind here was placing the refresh indicator between the large title and the upper app bar. I want this package to make user feel like "I really use IOS App"
fikretsengul commented 6 months ago

I fixed the app bar glitch (I've been using the wrong scrollOffset)

  1. You're right. I fixed it.
  2. I put that example directly from the easy refresh library to try. There is a customized version now, but there is also a default version of the library for iOS. I will be implementing it during the day. So don't let the current situation confuse you.

I pushed the fix for glitch and the sync issue. Now I will focus to bugs and nested scroll view to extend its functionality to add more sliver headers and refresh indicator.

fikretsengul commented 5 months ago

@kspo Can you check and try the dev branch of my fork?

https://github.com/fikretsengul/super_cupertino_navigation_bar/tree/dev

You can cherry pick and merge with your latest update. What's done.

What else should be done?

Any comments and feedback is appreciated. I'll be using this library of my next new version of flutter advanced boilerplate: https://github.com/fikretsengul/flutter_advanced_boilerplate