Flutter Basics Workshop

Organized by GDG Jammu • Hosted by Atul Sharma • March 2026

🎯 Beginner Friendly ⏱ ~2.5 Hours 💻 Hands-On Coding 🤖 Antigravity AI Demo

Welcome to Flutter Basics! 🦋

Hello everyone and welcome to today's GDG Jammu workshop! Whether you have never written a line of Flutter code or just getting started — this workshop is designed just for you. We will learn step-by-step, no prior Flutter knowledge required.

🏗️

Session 1

Understand how Flutter works under the hood — architecture, widgets, and rendering

Session 2

Build a real "Brew Café" app together — live coding from scratch

🤖

Session 3

Use Antigravity AI to build features 10x faster — live demo

What You Need Today

Before we start, make sure you have the following ready on your laptop:

1

Flutter SDK

Download from flutter.dev. Run flutter doctor in your terminal — you should see checkmarks ✅.

2

VS Code + Flutter Extension

Install VS Code from code.visualstudio.com, then install the Flutter and Dart extensions from the marketplace.

3

A Device or Emulator

Connect your Android phone (enable USB debugging) or set up an Android/iOS emulator in your IDE.

Don't worry if Flutter doctor shows some warnings — as long as Flutter itself is installed you can follow along today!

About GDG Jammu 🌟

Google Developer Groups (GDG) are community-run groups for people who are interested in Google's developer technology. GDG Jammu is the local chapter bringing developers, designers, and tech enthusiasts together through workshops, talks, and events like this one.

Today's workshop is organized by Atul Sharma, GDG Jammu organizer and full-stack developer, to make Flutter accessible to every developer in Jammu.

GitHub @atul573 GDG Jammu Community
Session 1

How Flutter Works 🏗️

Before we write any code, let's understand what Flutter actually is and how it works. This will help everything else make sense.

Simple Explanation: Flutter is like a very powerful paintbrush. Instead of using the phone's built-in buttons and boxes, Flutter draws its own UI on a blank canvas — pixel by pixel. This is why Flutter apps look the same on every device!

What Is Flutter?

Flutter is Google's free, open-source toolkit that lets you build beautiful apps for Android, iOS, Web, and Desktop — all from a single codebase written in the Dart programming language.

Without FlutterWith Flutter
Separate code for Android (Java/Kotlin)One Dart codebase for everything
Separate code for iOS (Swift)Same UI on all platforms
Different design languages per OSConsistent, beautiful design everywhere
2-3x more development timeBuild once, ship everywhere 🚀

Flutter's Architecture — The 3 Layers

Flutter has three layers, each doing a different job. Think of it like a restaurant:

1

Your App (Dart Code) — The Customer's Order

This is the code you write. You describe what you want (buttons, text, images) using widgets.

2

Flutter Framework — The Kitchen

Flutter takes your description and figures out exactly how to display it — layout, animations, gestures. This is written in Dart.

3

Flutter Engine (C++) — The Chef Drawing on the Screen

The engine uses the Skia / Impeller graphics library to literally paint every pixel on the screen. It does NOT use Android or iOS buttons — it draws its own.

💡 Key Insight: Because Flutter draws everything itself, your app looks and behaves exactly the same on an iPhone, an Android, and a website. No surprises!

Everything is a Widget

In Flutter, every single thing you see is a Widget. A widget is just a Dart class that describes a piece of your UI.

📝

Text

A widget that shows text

🔲

Container

A box that holds other widgets

📐

Column

Stacks widgets vertically

🔘

ElevatedButton

A tappable button widget

Two Types of Widgets

StatelessWidgetStatefulWidget
Doesn't change over timeCan change when something happens
Like a printed posterLike a live scoreboard
Examples: Text, Icon, ImageExamples: Checkbox, Counter, Search bar
Simpler and fasterUse when you need interactivity

Your First Widget — Hello Flutter!

Let's see a real example. Here is the smallest complete Flutter app possible:

// This imports all Flutter UI tools
import 'package:flutter/material.dart';

// main() is where your app starts — just like in other languages
void main() {
  runApp(const MyApp()); // Tell Flutter to run our app
}

// Our app is itself a Widget!
class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // build() describes what this widget looks like
  @override
  Widget build(BuildContext context) {
    return MaterialApp(     // Sets up the app shell
      home: Scaffold(       // Provides the basic page structure
        appBar: AppBar(
          title: const Text('👋 My First App'),  // The top bar text
        ),
        body: const Center(   // Centers its child on screen
          child: Text(
            'Hello, GDG Jammu! 🚀',
            style: TextStyle(fontSize: 24),
          ),
        ),
      ),
    );
  }
}

Breaking It Down — Line by Line

1

import 'package:flutter/material.dart'

This loads all of Flutter's ready-made widgets (like Text, Button, Column) so you can use them. Like adding ingredients to your kitchen.

2

void main() { runApp(...) }

Every Dart program starts from main(). runApp() tells Flutter "start showing this widget on screen!"

3

class MyApp extends StatelessWidget

We're creating a new widget class called MyApp. It extends StatelessWidget, meaning it won't change after it's built.

4

Widget build(BuildContext context)

Flutter calls this method to ask "what does this widget look like right now?". You return a description of the UI.

Hot Reload Magic ⚡: Change any text in your code, save the file, and the app updates on your phone in under 1 second — without restarting! This is Flutter's superpower for fast development.

🧠 Quick Check — Did You Understand?

  1. What are the two types of widgets? When would you use each?
  2. Flutter draws its own pixels — what does this mean for cross-platform apps?
  3. What method must every widget have?
Session 2

Build Brew Café ☕

Now let's put everything we learned into practice! We'll build a real coffee ordering app together — from absolute zero to a working, beautiful app.

What we're building: A coffee shop app with a home screen, a menu with 6 drinks, and a cart system where people can add drinks and see their total.

Step 1 — Create the Project

Open your terminal and run:

flutter create brew_cafe
cd brew_cafe
code .

This creates a new Flutter project and opens it in VS Code. You'll see a lib/main.dart file — that's where we start!

Step 2 — Project Structure

Good apps keep code organized. We'll create these folders inside lib/:

lib/
├── main.dart           ← App entry point + theme
├── models/
│   └── coffee.dart     ← Coffee data model
├── screens/
│   ├── home_screen.dart   ← Welcome page
│   └── menu_screen.dart   ← Menu + cart
└── widgets/
    └── coffee_card.dart   ← Reusable card UI
💡 Why organize like this? Separating models, screens, and widgets makes it easy to find code, fix bugs, and add new features later. It's a professional habit to build from day one.

Step 3 — The Coffee Model

A "model" is a Dart class that represents real-world data. Our Coffee model stores everything about a single drink:

// lib/models/coffee.dart
class Coffee {
  final String name;        // e.g. "Espresso"
  final String description; // e.g. "Strong and bold"
  final double price;       // e.g. 3.99
  final String emoji;       // e.g. "☕"

  // 'const' constructor — data that never changes
  const Coffee({
    required this.name,       // 'required' means you MUST provide this
    required this.description,
    required this.price,
    required this.emoji,
  });
}

// Our menu — a list of Coffee objects
final List<Coffee> cafeMenu = [
  const Coffee(name: 'Espresso',   description: 'Strong and bold single shot',      price: 3.99, emoji: '☕'),
  const Coffee(name: 'Cappuccino', description: 'Espresso with steamed milk foam',  price: 4.99, emoji: '🥛'),
  const Coffee(name: 'Latte',      description: 'Smooth espresso with lots of milk',price: 5.49, emoji: '🧋'),
  const Coffee(name: 'Mocha',      description: 'Chocolate meets coffee heaven',    price: 5.99, emoji: '🍫'),
  const Coffee(name: 'Cold Brew',  description: 'Slow-steeped for smooth flavor',   price: 4.49, emoji: '🧊'),
  const Coffee(name: 'Matcha',     description: 'Premium Japanese green tea',       price: 5.99, emoji: '🍵'),
];

Step 4 — The Cart (State Management)

Here's the most important concept in this session: mutable state. The cart changes when users tap "Add" — so we need a StatefulWidget.

class _MenuScreenState extends State<MenuScreen> {
  // Map: coffee name → how many in cart
  // e.g. {'Espresso': 2, 'Latte': 1}
  final Map<String, int> _cart = {};

  // Getter: total number of items
  int get totalItems => _cart.values.fold(0, (sum, n) => sum + n);

  void _addToCart(Coffee coffee) {
    setState(() {
      // If not in cart yet, start at 0, then add 1
      _cart[coffee.name] = (_cart[coffee.name] ?? 0) + 1;
    });
    // setState() ← This is the MAGIC. It tells Flutter:
    //   "Something changed! Rebuild the UI!"
  }
}
setState() rule: Whenever you change data in a StatefulWidget that should update the UI, you MUST wrap the change inside setState(() { ... }). Without it, Flutter won't know to redraw the screen.

Step 5 — Navigation Between Screens

Flutter uses a Navigator (like a stack of pages) to move between screens:

// PUSH — go to a new screen (adds it on top of the stack)
Navigator.push(
  context,
  MaterialPageRoute(builder: (context) => const MenuScreen()),
);

// POP — go back (removes the top screen from the stack)
Navigator.pop(context);

🏋️ Mini Challenges

  1. Easy: Add a 7th drink to the cafeMenu list.
  2. Medium: Add a remove (-) button so users can decrease quantity.
  3. Hard: Show a "Your cart is empty" message when no items are added.
Session 3

Antigravity for Flutter 🤖

Antigravity is an AI coding assistant built by Google DeepMind. It lives inside your VS Code and understands your entire project — helping you write, debug, and improve Flutter code at incredible speed.

Think of Antigravity as: A senior Flutter developer sitting next to you 24/7, who knows your codebase, never gets tired, and can generate production-quality Dart code in seconds.

What Can Antigravity Do?

✍️

Write Code

Generate entire screens, widgets, models from a description

🐛

Fix Bugs

Paste an error and get an instant fix with explanation

🔄

Refactor

Improve your code structure without breaking anything

📋

Generate Tests

Write widget and unit tests automatically

⚙️

Run Commands

Add packages, run builds, analyze code for you

📖

Explain Code

Ask "what does this do?" and get a plain-English answer

Example Prompts to Try Right Now

During this workshop, try these exact prompts in Antigravity:

💬 "Add a search bar to the MenuScreen that filters the coffee list in real-time as I type."
💬 "I'm getting a RenderFlex overflow error in MenuScreen. Look at the file and fix it."
💬 "Add the http package to my project and create a simple ApiService class."
💬 "Generate widget tests for the CoffeeCard widget — test that the name, price, and add button all work."
💬 "Add a dark mode toggle to the app and persist the user's preference."

Tips for Great Results

❌ Vague Prompt✅ Better Prompt
"add search""Add a search TextField at the top of MenuScreen that filters cafeMenu by name"
"fix my code""Fix the setState() call in _MenuScreenState — it's not updating the cart count badge"
"make a model""Create a User model with id, name, email, and joinedAt fields, include fromJson and toJson methods"
Pro tip: The more specific you are, the better the output. Include file names, widget names, and what behavior you expect.

🎯 Live Demo: Ask Antigravity to Build a Feature

Let's do this together! We'll ask Antigravity to add a Favorites feature to Brew Café:

💬 "Add a favorites feature to Brew Café: add a heart icon on each CoffeeCard that toggles favorite status, create a FavoritesScreen showing only favorited coffees, add a BottomNavigationBar to switch between Menu and Favorites tabs, and animate the heart with a scale animation when tapped."

Watch Antigravity handle multiple files, new dependencies, state management, and animations — all in one shot!

🎉 Workshop Complete!

Congratulations on completing the GDG Jammu Flutter Basics Workshop! Here's what you learned today:

SessionKey Takeaway
🏗️ Session 1Flutter draws its own pixels — widgets, three trees, hot reload
☕ Session 2Real apps use models, screens, widgets + setState for interactivity
🤖 Session 3Antigravity AI makes you 10x faster — be specific in your prompts
Flutter Docs   pub.dev Packages   Join GDG Jammu