Organizing Flutter for standalone and embedding
Enterprises get a different experience when they already have iOS, Android, and web applications on different tech stacks with overlapping functionality. Enterprises change their tech stack by incrementally replacing native or javascript functionality with Flutter modules. The Flutter default project structure must be recast in this situation.
Organizing Flutter for Standalone and Embedded applications on YouTube
The rest of this article is converted in greater depth in the video. The content exists here for search optimization and will be updated over time.
Default "greenfield" organization
This is the project structure for a new standalone application that can be deployed as web, Android, and iOS applications. The shared Flutter code goes in /lib. Small standalone web, Android, and iOS wrapper code exist in the appropriate directories. Flutter covers the entire screen or fills the web browser essentially running in full screen on the target canvas. This structure is understandable and easy to work with as long as you are running standalone applications.
The web app is packaged as static content, its own site. This means the web artifact can inserted or embedded in another website as an iFrame without any additional code. Mobile is different by its very nature.
This project structure can also include macOS, Windows, and Linux deployable applications. I didn't include them because they clutter the image for the purposes of this narrative.
Video
Organizing for embedding and incrementalism
- Flutter runs inside the company's real Natvie Applications. This requires integration and the project is configured as a Module
- A standalone development or test application for development, demonstrations, or other uses. This project is configured as an Application
- lib/package where all the real Flutter code is.
- /modules that are embedded in existing or 3rd part mobile applications. They require their own flutter configuration
- /apps Standalone applications that consume the flutter package in the first step. They may be destined for production or may only be used by developers and testers
See Breaking Down the House - I mean Flutter Projects for a sample project structure
Comments
Post a Comment