build method
Custom Error Widget to show the error message if there is something wrong with location when qiblah compass in used
Implementation
@override
Widget build(BuildContext context) {
return SizedBox(
height: MediaQuery.of(context).size.height * 0.20,
child: Padding(
padding: const EdgeInsets.all(10),
child: ListView(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
children: [
/// to show the error message here
Center(
child: Text(
textAlign: TextAlign.center,
errMsg,
style: messageTextStyle ?? const TextStyle(color: Colors.red),
),
),
SizedBox(
height: spaceBetween ?? 10,
),
/// error button with onTap callBack to retry
Center(
child: SizedBox(
width: errorButtonStyle?.buttonWidth,
height: errorButtonStyle?.buttonHeight,
child: MaterialButton(
color: errorButtonStyle?.buttonColor ?? Colors.grey.shade300,
textColor: errorButtonStyle?.textColor ?? Colors.black,
shape: RoundedRectangleBorder(
borderRadius: errorButtonStyle?.borderRadius ??
BorderRadius.circular(5)),
onPressed: onTap,
child: FittedBox(fit: BoxFit.scaleDown, child: Text(title,style: buttonTextStyle,)),
),
),
),
],
),
),
);
}