Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void showServerErrorDialog() {
- BuildContext dContext =
- GlobalVariableKeys.navigatorState.currentState!.overlay!.context;
- showGeneralDialog(
- barrierLabel: "Label",
- barrierDismissible: false,
- barrierColor: Colors.black.withAlpha(50),
- transitionDuration: Duration(milliseconds: 500),
- context: dContext,
- pageBuilder: (dialogContext, anim1, anim2) {
- return PopScope(
- canPop: false,
- onPopInvokedWithResult: (didPop, result) {
- false;
- },
- child: Align(
- alignment: Alignment.center,
- child: SingleChildScrollView(
- physics: const ScrollPhysics(),
- child: Padding(
- padding: const EdgeInsets.all(24.0),
- child: Card(
- elevation: 0,
- shape: const RoundedRectangleBorder(
- borderRadius: BorderRadius.all(Radius.circular(12)),
- ),
- child: Padding(
- padding: const EdgeInsets.all(24.0),
- child: Column(
- mainAxisSize: MainAxisSize.max,
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- SvgPicture.asset(
- "assets/images/exclamatory.svg",
- height: 40,
- width: 40,
- ),
- SizedBox(height: 10),
- Text(
- "Service Down",
- style: GoogleFonts.poppins(
- fontSize: 20,
- fontWeight: FontWeight.w500,
- color: ProjectColors.black4,
- ),
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- softWrap: true,
- textAlign: TextAlign.center,
- ),
- SizedBox(height: 10),
- Text(
- "Apologies, our servers are temporarily down. We are working hard to resolve the issue and get everything back up and running as soon as possible",
- style: GoogleFonts.poppins(
- fontSize: 14,
- fontWeight: FontWeight.w400,
- color: ProjectColors.black4,
- ),
- overflow: TextOverflow.ellipsis,
- softWrap: true,
- maxLines: 6,
- textAlign: TextAlign.center,
- ),
- SizedBox(height: 12),
- ElevatedButton(
- style: ButtonStyle(
- padding: WidgetStateProperty.all<EdgeInsets>(
- EdgeInsets.all(12),
- ),
- foregroundColor: WidgetStateProperty.all<Color>(
- ProjectColors.gray,
- ),
- backgroundColor: WidgetStateProperty.all<Color>(
- ProjectColors.gray,
- ),
- shape:
- WidgetStateProperty.all<RoundedRectangleBorder>(
- RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(8.0),
- side: BorderSide(color: ProjectColors.gray),
- ),
- ),
- ),
- onPressed: () {
- if (Platform.isAndroid) {
- SystemNavigator.pop();
- } else if (Platform.isIOS) {
- exit(0);
- }
- },
- child: Text(
- "Got It",
- style: GoogleFonts.poppins(
- fontSize: 14,
- fontWeight: FontWeight.w400,
- color: ProjectColors.black4,
- ),
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- softWrap: true,
- textAlign: TextAlign.center,
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- ),
- ),
- );
- },
- transitionBuilder: (context, anim1, anim2, child) {
- return SlideTransition(
- position: Tween(
- begin: Offset(0, 1),
- end: Offset(0, 0),
- ).animate(anim1),
- child: child,
- );
- },
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement