How hjaliliani/flutter_web_view works
Main Components
• Flutter Application (lib folder): This is the heart of the app. It contains Dart code such as main.dart, home_widget.dart, about.dart, and placeholder_widget.dart. These files form the widget tree and define the UI layers of the app.
• Platform-Specific Implementations:
• iOS: The “ios” directory includes the Runner project, configurations like Info.plist, storyboards (Main.storyboard and LaunchScreen.storyboard), and other Xcode settings.
• WebView Layer: Although it is implemented through Flutter’s cross-platform widgets, the WebView is a distinct component that loads news from external websites (gadgetnews.net, digiato.com, zoomit.ir, click.ir).
Relationships & Interactions
• The Flutter engine (invoked by main.dart) initializes the widget tree and invokes the appropriate WebView (dependent on the branch used).
• Native wrappers for Android and iOS are responsible for launching the Flutter engine and managing their respective platform’s lifecycle events.
Architectural Patterns & Design Principles
• Separation of Concerns: The project cleanly separates the platform-specific implementations (Android and iOS) from the shared Flutter code (located in lib).
• Cross-Platform Abstraction: Flutter abstracts away platform quirks, while the native directories handle configuration and lifecycle management.
• Minimal Service Layer: As a straightforward WebView app, the data service layer is simple, focusing solely on rendering external content rather than handling complex business logic.
Relevant Technologies, Frameworks, and Libraries
• Flutter & Dart core for application logic and UI design.
• AndroidX support library (as indicated by the migration note) for improved Android compatibility.
• Native iOS components (using Cocoa Touch frameworks) for platform integration.
• WebView widget provided either by the Flutter team or a community plugin (depending on the chosen branch).