claude refactor
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import '../../api/mhsl/breaker/getBreakers/getBreakersResponse.dart';
|
||||
import '../../state/app/modules/breaker/bloc/breaker_bloc.dart';
|
||||
import '../../widget/placeholderView.dart';
|
||||
|
||||
class Breaker extends StatelessWidget {
|
||||
final BreakerArea breaker;
|
||||
final Widget child;
|
||||
|
||||
const Breaker({required this.breaker, required this.child, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final bloc = context.watch<BreakerBloc>();
|
||||
final blocked = bloc.isBlocked(breaker);
|
||||
if (blocked != null) {
|
||||
return PlaceholderView(
|
||||
icon: Icons.app_blocking_outlined,
|
||||
text: 'Die App / Dieser Bereich ist zurzeit nicht verfügbar!\n\n'
|
||||
'${blocked.isEmpty ? "Es wurde vom Server kein Grund übermittelt.\nAktualisiere die App und versuche es später erneut" : blocked}',
|
||||
);
|
||||
}
|
||||
return child;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user