How to reduce the bundle size of flutter web?

Viewed 1264

I am developing web app using flutter. My question , Is there any lazy , preloading routing options in flutter like angular . So that I can reduce the initial time for showing the first screen without loading other screens .

1 Answers

One way of reducing the size of your bundle is by removing unnecessary plugins added to your pubspec.yaml file. The build file for web is usually small and shouldn't be that large unless there's a lot of assets included in your build.

As for preloading pages, you can consider using PageView - this caches the PageView children for quicker load times. Of course, pages far from the viewport are usually disposed and rebuilt again depending on the size of the Widget.

Related