2023-02-10 07:39:00 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
import 'package:unit2/theme-data.dart/btn-style.dart';
|
2023-01-18 07:54:44 +00:00
|
|
|
|
2023-02-10 07:39:00 +00:00
|
|
|
import '../theme-data.dart/colors.dart';
|
|
|
|
|
|
|
|
class SomethingWentWrong extends StatelessWidget {
|
2023-01-18 07:54:44 +00:00
|
|
|
final String? message;
|
2023-02-10 07:39:00 +00:00
|
|
|
final Function()? onpressed;
|
|
|
|
const SomethingWentWrong({Key? key, required this.message, required this.onpressed})
|
|
|
|
: super(key: key);
|
2023-01-18 07:54:44 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2023-02-10 07:39:00 +00:00
|
|
|
return Container(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 15),
|
|
|
|
child: Center(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
SvgPicture.asset(
|
2023-04-05 00:54:24 +00:00
|
|
|
'assets/svgs/timeout.svg',
|
2023-02-10 07:39:00 +00:00
|
|
|
height: 200.0,
|
|
|
|
width: 200.0,
|
|
|
|
allowDrawingOutsideViewBox: true,
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
height: 10,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
message??'',
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
height: 20,
|
|
|
|
),
|
|
|
|
SizedBox(
|
2023-10-06 04:43:37 +00:00
|
|
|
width: 200,
|
2023-02-10 07:39:00 +00:00
|
|
|
height: 50,
|
|
|
|
child: ElevatedButton.icon(
|
|
|
|
style: mainBtnStyle(
|
|
|
|
primary, Colors.transparent, primary.withOpacity(.5)),
|
|
|
|
onPressed: onpressed,
|
|
|
|
icon: const Icon(
|
|
|
|
Icons.refresh,
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
label: const Text(
|
|
|
|
"try again",
|
|
|
|
style: TextStyle(color: Colors.white),
|
|
|
|
)),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
2023-01-18 07:54:44 +00:00
|
|
|
}
|
|
|
|
}
|