45 lines
1.3 KiB
Dart
45 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:progress/progress.dart';
|
|
import 'package:fcs/helpers/theme.dart';
|
|
|
|
class LocalProgress extends Progress {
|
|
LocalProgress({required bool inAsyncCall, required Widget child})
|
|
: super(
|
|
inAsyncCall: inAsyncCall,
|
|
child: child,
|
|
opacity: 0.6,
|
|
progressIndicator: Center(
|
|
child: Container(
|
|
height: 100,
|
|
width: 300,
|
|
child: Card(
|
|
color: Colors.white,
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: <Widget>[
|
|
CircularProgressIndicator(
|
|
valueColor:
|
|
new AlwaysStoppedAnimation<Color>(primaryColor),
|
|
),
|
|
SizedBox(
|
|
height: 10,
|
|
),
|
|
Text("Loading...")
|
|
],
|
|
),
|
|
),
|
|
),
|
|
));
|
|
|
|
Widget build(BuildContext context) {
|
|
// hide keyboard
|
|
if (inAsyncCall) {
|
|
FocusScopeNode currentFocus = FocusScope.of(context);
|
|
if (!currentFocus.hasPrimaryFocus) {
|
|
currentFocus.unfocus();
|
|
}
|
|
}
|
|
return super.build(context);
|
|
}
|
|
}
|