AsLoadingSpinner
A customizable loading spinner component for indicating loading states.
Import
import 'package:alphasow_ui/alphasow_ui.dart';
Basic Usage
AsLoadingSpinner()
Custom Size and Color
AsLoadingSpinner(
size: 32,
color: Colors.blue,
)
API Reference
Properties
| Property | Type | Default | Description |
|---|---|---|---|
size | double? | 24 | Size of the spinner |
color | Color? | null | Color of the spinner |
strokeWidth | double? | 2.0 | Width of the spinner stroke |
Examples
In Button
AsButton(
loading: isLoading,
onPressed: isLoading ? null : () async {
setState(() => isLoading = true);
await performAsyncOperation();
setState(() => isLoading = false);
},
child: Text('Submit'),
)
Centered Loading
Center(
child: AsLoadingSpinner(
size: 48,
color: Theme.of(context).primaryColor,
),
)
See Also
- AsLoadingCircular - For circular progress indicator
- Loader Examples - Live demo