-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
consolidate receipt_overlay and loading_overlay
- Loading branch information
1 parent
facb451
commit b90b574
Showing
13 changed files
with
68 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import 'package:screen_brightness/screen_brightness.dart' as sb; | ||
|
||
class ScreenBrightness { | ||
Future<void> setScreenBrightness(double brightness) async => | ||
sb.ScreenBrightness().setScreenBrightness(brightness); | ||
Future<void> resetScreenBrightness() async => | ||
sb.ScreenBrightness().resetScreenBrightness(); | ||
} |
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 |
---|---|---|
@@ -1,24 +1,26 @@ | ||
import 'package:coffeecard/core/styles/app_colors.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
void showLoadingOverlay(BuildContext context) { | ||
final _ = showDialog( | ||
context: context, | ||
barrierColor: AppColors.scrim, | ||
barrierDismissible: false, | ||
useRootNavigator: true, | ||
builder: (_) { | ||
return WillPopScope( | ||
// Will prevent Android back button from closing overlay. | ||
onWillPop: () async => false, | ||
child: const Center( | ||
child: CircularProgressIndicator(color: AppColors.white), | ||
), | ||
); | ||
}, | ||
); | ||
} | ||
class LoadingOverlay { | ||
static void show(BuildContext context) { | ||
final _ = showDialog( | ||
context: context, | ||
barrierColor: AppColors.scrim, | ||
barrierDismissible: false, | ||
useRootNavigator: true, | ||
builder: (_) { | ||
return WillPopScope( | ||
// Will prevent Android back button from closing overlay. | ||
onWillPop: () async => false, | ||
child: const Center( | ||
child: CircularProgressIndicator(color: AppColors.white), | ||
), | ||
); | ||
}, | ||
); | ||
} | ||
|
||
void hideLoadingOverlay(BuildContext context) { | ||
Navigator.of(context, rootNavigator: true).pop(); | ||
static void hide(BuildContext context) { | ||
Navigator.of(context, rootNavigator: true).pop(); | ||
} | ||
} |
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
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
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