fluffychat/lib/pangea/choreographer/widgets/has_error_button.dart
ggurdin 9ecf4e3bd2
fix: fix dart formatting for CI (#1368)
* fix: fix dart formatting for CI

* fix: sorted imports, updated deprecated flutter functions

* fix: format files

* fix: format files

* feat: replace syncfusion flutter package with excel flutter package

* fix: don't run enable google services patch in CI

* fix: update iOS supported platforms for enable ios build script

* fix: commented out linux build in integrate CI
2025-01-07 08:32:42 -05:00

36 lines
959 B
Dart

import 'package:flutter/material.dart';
import 'package:fluffychat/pangea/choreographer/controllers/choreographer.dart';
import '../controllers/error_service.dart';
class ChoreographerHasErrorButton extends StatelessWidget {
final ChoreoError error;
final Choreographer choreographer;
const ChoreographerHasErrorButton(
this.error,
this.choreographer, {
super.key,
});
@override
Widget build(BuildContext context) {
return FloatingActionButton(
onPressed: () {
if (error.type == ChoreoErrorType.unknown) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
duration: const Duration(seconds: 5),
content: Text(
"${error.title(context)} ${error.description(context)}",
),
),
);
choreographer.errorService.resetError();
}
},
mini: true,
child: Icon(error.icon),
);
}
}