codigo actual del servidor, con avances de joan
This commit is contained in:
55
source_code/lib/custom/loading.dart
Normal file
55
source_code/lib/custom/loading.dart
Normal file
@@ -0,0 +1,55 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:active_ecommerce_seller_app/custom/localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:one_context/one_context.dart';
|
||||
|
||||
|
||||
|
||||
class Loading{
|
||||
static BuildContext? _buildContext;
|
||||
static late BuildContext _context;
|
||||
|
||||
static setInstance(BuildContext context){
|
||||
_buildContext= context;
|
||||
}
|
||||
|
||||
static getInstance()=>Loading._buildContext;
|
||||
|
||||
Future show()async{
|
||||
|
||||
return showDialog(
|
||||
context: Loading._buildContext!,
|
||||
builder: (BuildContext context) {
|
||||
Loading._context=context;
|
||||
return AlertDialog(
|
||||
content: Row(
|
||||
children: [
|
||||
CircularProgressIndicator(),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(LangText(context: context).getLocal()!.please_wait_ucf),
|
||||
],
|
||||
));
|
||||
},);
|
||||
}
|
||||
|
||||
hide(){
|
||||
Navigator.of(Loading._context).pop();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static Widget bottomLoading(bool value){
|
||||
return value? Container(
|
||||
alignment: Alignment.center,
|
||||
child: SizedBox(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: CircularProgressIndicator()),
|
||||
):SizedBox(height: 5,width: 5,);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user