Files
plezy/lib/widgets/loading_indicator_box.dart
T
2026-05-01 01:20:36 +02:00

19 lines
746 B
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:flutter/material.dart';
/// Square `CircularProgressIndicator(strokeWidth: 2)` sized to fit inside a
/// button or status row. The default 18×18 matches the
/// [FilledButton.icon] / [OutlinedButton.icon] icon slot; bump [size] for
/// list-row or app-bar contexts.
///
/// Centralises the `SizedBox(width:.., height:.., child:
/// CircularProgressIndicator(strokeWidth: 2))` pattern that previously
/// appeared inline in every async button.
class LoadingIndicatorBox extends StatelessWidget {
final double size;
const LoadingIndicatorBox({super.key, this.size = 18});
@override
Widget build(BuildContext context) =>
SizedBox(width: size, height: size, child: const CircularProgressIndicator(strokeWidth: 2));
}