Implemented Loading Overlay
This commit is contained in:
42
lib/widgets/loading_notifier.dart
Normal file
42
lib/widgets/loading_notifier.dart
Normal file
@@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LoadingNotifier extends StatelessWidget {
|
||||
const LoadingNotifier(
|
||||
{super.key, required this.onDismissed, required this.message});
|
||||
final void Function() onDismissed;
|
||||
final String message;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(45)),
|
||||
child: SizedBox(
|
||||
width: 500,
|
||||
height: 60,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 25,
|
||||
height: 25,
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
Text(
|
||||
message,
|
||||
style: Theme.of(context).textTheme.titleSmall,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () => onDismissed(),
|
||||
icon: Icon(Icons.close),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user