Loading Indicator Show a loading indicator or loading screen

This lesson is available for PRO members or as a single course purchase. Sign-in and choose a plan below.

Use the Loader when an individual UI element is loading, or LoadingScreen when an entire screen is loading.

file_type_dartlang loader.dart
import 'package:flutter/material.dart';


class Loader extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      width: 250,
      height: 250,
      child: CircularProgressIndicator(),
    );
  }
}

class LoadingScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: Center(
        child: Loader(),
      ),
    );
  }
}

Questions?

Ask questions via GitHub below OR chat on Slack #questions