-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the pylons loading animation (#1725)
- Loading branch information
1 parent
b248b05
commit e3c9e92
Showing
7 changed files
with
63 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class PylonsLoadingAnimation { | ||
PylonsLoadingAnimation({ | ||
required this.context, | ||
double height = 100, | ||
double width = 100, | ||
}) : _height = height, | ||
_width = width; | ||
|
||
Future show() { | ||
return showDialog( | ||
context: context, | ||
barrierDismissible: true, | ||
barrierColor: Colors.white.withOpacity(0), | ||
builder: (ctx) => WillPopScope( | ||
onWillPop: () async => false, | ||
child: AlertDialog( | ||
elevation: 0, | ||
backgroundColor: Colors.transparent, | ||
content: SizedBox(height: _height, width: _width, child: Image.asset('assets/loading.gif', package: 'pylons_sdk',)), | ||
), | ||
), | ||
); | ||
} | ||
|
||
void hide() { | ||
Navigator.of(context).pop(); | ||
} | ||
|
||
final BuildContext context; | ||
final double _height; | ||
final double _width; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters