2020-05-29 07:45:27 +06:30
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:progress/progress.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:fcs/model/main_model.dart';
|
2020-09-04 15:30:10 +06:30
|
|
|
import 'package:fcs/fcs/common/helpers/theme.dart';
|
2020-05-29 07:45:27 +06:30
|
|
|
|
|
|
|
|
class LocalProgress extends Progress {
|
|
|
|
|
LocalProgress({bool inAsyncCall, 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) {
|
|
|
|
|
Provider.of<MainModel>(context).resetPinTimer();
|
|
|
|
|
// hide keyboard
|
|
|
|
|
if (inAsyncCall) {
|
|
|
|
|
FocusScopeNode currentFocus = FocusScope.of(context);
|
|
|
|
|
if (!currentFocus.hasPrimaryFocus) {
|
|
|
|
|
currentFocus.unfocus();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return super.build(context);
|
|
|
|
|
}
|
|
|
|
|
}
|