passo_mobile_app/lib/widgets/error_state.dart

59 lines
1.7 KiB
Dart
Raw Normal View History

import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:unit2/theme-data.dart/btn-style.dart';
import '../theme-data.dart/colors.dart';
class SomethingWentWrong extends StatelessWidget {
final String? message;
final Function()? onpressed;
const SomethingWentWrong({Key? key, required this.message, required this.onpressed})
: super(key: key);
@override
Widget build(BuildContext context) {
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',
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,
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),
)),
)
],
),
),
);
}
}