I'm fairly new to Flutter and am trying to accomplish something similar to what is being used in the Pigeon app for iOS. Basically I want an interactive page as a background in the app (like the map in the Pigeon app), and then have different screens appear over that background. These screens should be scrollable, but start at the bottom of the device screen, thus showing both the screen and the dynamic background at the same time. As long as the background is visible in you can interact both with it and the scrollable screen.
I have added a gif below which hopefully helps explaining the issues.
Any guidance on which widgets to look into would be appreciated. I've been experimenting with the Stack widget but can't yet figure out how to accomplish my desired behaviour.
For doing this kind of stuff you have to use sliver widget, which is provide by flutter material package
for more info you can check
Flutter Sliver
Related
Is it possible to do an onboarding experience in Flutter? See the link below...
https://dribbble.com/shots/15798418-Mobile-App-Onboarding
As you can see as the user swipe right to the next screen, the image looks like it is flowing on?
You should have three images, one for screen and try using this package Flutter swiper
I have done the same effect with this package
i have an application created by flutter dart but it is not responsive i mean when i try it in my phone it look Very amazing but in annoter phones It look so big and not good at all
im wondering if there is some thing i have to add it in my code to make it responsive in all kind of screens
You need to write a code that will be responsive to all screens
Use Mediaquery to get screen width and height and adjust the container sizes according to the screen width and height
And use Constraints to look your app screen perfect in all devices\n
Try expanded,Flexible widgets too
I think you are new to flutter and time goes on you will understand about that
since I am learning Flutter now for about a year, I am using several responsive layout functions to be sure that my app looks fine on each device. Normally, I am using MediaQuery with a factor for Containers and Cards and if I have Text inside, I use FittedBox with BoxFit.contain. So far, it works well, but from time to time I get an overflow, e.g. when my colleague opens the app on his IPhone 12 Emulator. Yesterday, he had an overflow inside the bottom nav bar. It was because of the icons and I do not know why this appears. I gave the bottom bar a defined height with MediaQuery and wrapped the icons inside fitted boxes. After that, I defined the icon size with Media Query as well, still no real improvment. The title, or the label is not displayed.
Well my question would be a general one: Since I have no real experience with other languages, I am not able to compare the effort which is neccessary to have a responsive layout to other languages, but maybe an experienced developer can give me some tips how to improve the workflow of having a responsive layout. We want to launch in the app stores in August and the fear of having overflows on several devices drives me crazy. In this case, it is more a responsiveness to many mobile devices rather than having a good layout on mobile, desktop, tablet. So please, tell me about your approaches. It would really help me!
Regards!
See for responsive design, try to use the Padding and the Expanded Widgets the Most.
They are most useful when designing responsive screens.
Also, you can see other layout widgets here.
Dont use specific pixels (numbers) to limit the size of anything, try making it dynamic based on screen size.
Between phone and desktop, make 2 layouts and switch them as needed.
Between different sized phones, padding should do the work.
I have created SplashScreens for my Flutter app for both iOS and Android using the native way which is editing the LaunchScreen.storyboard and it is working currently when I run my app but the SplashScreen does not hold long enough and is there a way to programmatically hide the native splashscreen in dart after I am done with some data processing and logic?
The solutions I found online are all flutter apps with SplashScreen that is build using flutter widgets and not the native way...
Even if you build the splash screen if Flutter, you still need to set one in via XCode. Otherwise, the app loads with a momentary plan white screen and Apple rejects it.
If you want to extend the time till the moment data process is over, then you will have to make a replica of LaunchScreen.storyboard in Flutter. The data processing and logic are written in Flutter. There's no way it can tell LaunchScreen.storyboard "I am done". What you can do is though, make a splash screen in Flutter which will look like LaunchScreen.storyboard. And once the data processing is done, you can navigate the user to the desired screen. Since the two screens are same, use won't see the difference and the app will smoothly show the next screen.
Just a word of caution - be careful about extending the timing of launch screen. Apple may reject the app. See if something can be done after the screen load. You can use flutter after layout package for this or the below line will do the trick :
WidgetsBinding.instance
.addPostFrameCallback((_) => myFunction(context));
This thread may help you to delay the screen for XX seconds.
I am prototyping an Epub reader in Flutter. Each chapter is displayed in a WebView and these WebViews are placed inside a PageView. The contents of each WebView is paginated thanks to a multi-column layout: 1 column = 1 visible page.
During a horizontal swipe gesture, the expected behavior is to have the WebView's contents scrolling while possible, and then have the PageView scrolling between pages as soon as the WebView has reached its limit. Note: during 1 swipe gesture, both can happen: WebView scrolling first, then the PageView.
On Android, it's easily handled thanks to overscroll notifications, as in This code.
But in Flutter, the WebViews are not scrollable and we cannot use the OverscrollNotifications (AFAIK). So I have a few working solutions based on injecting JS code inside the WebView to broadcast the scroll position to the Flutter side, but this is very dirty and frustrating, I hate this kind of code...
Does anyone have a good solution? Thanks a lot in advance!
EDIT: I have a new idea based on Javascript. Instead of continuously sending scroll notifications to the Flutter side during scrolling, I will insert transparent pixels at the beginning and end of each "chapter", and send events to Flutter only when these elements become visible/invisible (thanks to the IntersectionObserver API). But such a solution requires injecting stuff into the chapter's HTML, which is not the best solution. Any better idea is still welcome!