2021-02-02 14:33:23 +00:00
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import '../shared/app_colors.dart';
|
|
|
|
|
|
|
|
class CenteredErrorRow extends StatelessWidget {
|
|
|
|
final Function retryCallback;
|
|
|
|
final String message;
|
|
|
|
|
|
|
|
CenteredErrorRow(this.message, {this.retryCallback});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
if (message == null) {
|
|
|
|
return Container();
|
|
|
|
}
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
children: <Widget>[
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
2021-04-05 20:06:54 +00:00
|
|
|
Expanded(child: Center(child: Text(message, style: TextStyle(color: redColor)))),
|
2021-02-02 14:33:23 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
(retryCallback != null
|
|
|
|
? Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Center(
|
|
|
|
child: IconButton(
|
|
|
|
icon: Icon(Icons.refresh),
|
|
|
|
color: primaryAccentColor,
|
|
|
|
onPressed: () {
|
|
|
|
retryCallback();
|
|
|
|
},
|
|
|
|
))
|
|
|
|
])
|
|
|
|
: Container())
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|