You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
Dart
41 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../controllers/pangea_controller.dart';
|
|
import '../controllers/error_service.dart';
|
|
|
|
class ChoreographerHasErrorButton extends StatelessWidget {
|
|
final ChoreoError error;
|
|
final PangeaController pangeaController;
|
|
|
|
const ChoreographerHasErrorButton(
|
|
this.pangeaController,
|
|
this.error, {
|
|
super.key,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Padding(
|
|
padding: const EdgeInsets.only(bottom: 56.0),
|
|
child: 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)}",
|
|
),
|
|
),
|
|
);
|
|
} else if (error.type == ChoreoErrorType.unsubscribed) {
|
|
pangeaController.subscriptionController.showPaywall(context);
|
|
}
|
|
},
|
|
mini: true,
|
|
child: Icon(error.icon),
|
|
),
|
|
);
|
|
}
|
|
}
|