Flutter Complete Guide 📱

Build Android + iOS Apps with One Codebase

1. What is Flutter?

Flutter is a UI framework by Google used to build cross-platform mobile apps using a single codebase.

2. Language Used

Flutter uses Dart language

3. Basic Flutter App

import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text("Hello Flutter")),
        body: Center(child: Text("Welcome")),
      ),
    );
  }
}

4. Widgets Concept

Everything in Flutter is a Widget

Examples:
- Text
- Button
- Container
- Column
- Row

5. Button Example

ElevatedButton(
  onPressed: () {
    print("Clicked");
  },
  child: Text("Click Me"),
)

6. State Management

State means changing UI dynamically

Example:
setState(() {
  counter++;
});

7. Layout System

Column → vertical layout
Row → horizontal layout
Container → box styling

8. Page Navigation

Navigator.push(
  context,
  MaterialPageRoute(builder: (context) => SecondPage()),
);

9. API Integration

Use http package:
- Fetch data from backend
- Show JSON in UI

10. Mini Projects