Jul 21, 2024
flutter create <project_name>
lib
folder.main.dart
file: Entry point of the Flutter application.
void main()
.runApp
function: Launches the application by passing a widget as the root.F5
to run the application.MyHomePage
class.Creating Pages
Pages
folder for different app pages.home.dart
file in the Pages
folder.Widgets Overview
sdl
shortcut in the editor for a Stateless widget.Home Screen Setup
home
property to HomePage
class in main.dart
.const
keyword for compile-time constants.Build Method
Scaffold
: Provides framework for the app layout.
AppBar
, Drawer
, etc.App Bar Implementation
AppBar
to Scaffold
.AppBar
using centerTitle: true
.Container
and GestureDetector
).flutter_svg
package for SVG icons.Search TextField
TextField
in Scaffold
body.Container
for styling and margins.BoxDecoration
.TextField
(remove border, add radius).prefixIcon
and suffixIcon
properties.hintText
property).debugShowCheckedModeBanner
for clean UI.Category Section
Category
model class.ListView.builder
for horizontal list display.ListView.separated
.Column
.Recommendation for Diet Section
ListView.builder
and ListView.separated
.View
button with gradient background.Popular Section
ListView
for scrollable list.const
wherever applicable to avoid warnings.