CH-4-Creating Starter Project Template
CH-4-Creating Starter Project Template
1. Start a New Project: Create a Flutter project and provide a project name.
Setup Folders: Organize your project with the following folder structure:
mkdir assets\images
mkdir lib\pages
mkdir lib\models
mkdir lib\utils
mkdir lib\widgets
mkdir lib\services
2. Structuring Widgets
Proper widget organization is essential for maintainable and readable code.
Flutter does not create additional files for pages automatically, so you'll need
to structure widgets manually.
1. Separate the Home Screen: Create a home.dart file inside the lib/pages
folder for the main screen of the app.
2. Use the main.dart File: This file serves as the entry point of the
application.
3. Choose a Widget Type:
Entry Point: The main() function is the starting point of the app and calls runApp() to launch
the application.
Base Widget: Use MaterialApp or CupertinoApp depending on the design language you prefer.