chore: Add code lint check for unused code

This commit is contained in:
Christian Kußowski 2026-02-18 16:10:23 +01:00
commit 1896c56544
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
12 changed files with 36 additions and 352 deletions

View file

@ -1,100 +0,0 @@
import 'package:flutter/material.dart';
import 'package:fluffychat/config/themes.dart';
class AvatarPageHeader extends StatelessWidget {
final Widget avatar;
final void Function()? onAvatarEdit;
final Widget? textButtonLeft, textButtonRight;
final List<Widget> iconButtons;
const AvatarPageHeader({
super.key,
required this.avatar,
this.onAvatarEdit,
this.iconButtons = const [],
this.textButtonLeft,
this.textButtonRight,
});
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final onAvatarEdit = this.onAvatarEdit;
return Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: FluffyThemes.columnWidth),
child: Column(
mainAxisSize: .min,
crossAxisAlignment: .center,
spacing: 8.0,
children: [
Stack(
children: [
avatar,
if (onAvatarEdit != null)
Positioned(
bottom: 0,
right: 0,
child: FloatingActionButton.small(
elevation: 2,
onPressed: onAvatarEdit,
heroTag: null,
child: const Icon(Icons.camera_alt_outlined),
),
),
],
),
TextButtonTheme(
data: TextButtonThemeData(
style: TextButton.styleFrom(
disabledForegroundColor: theme.colorScheme.onSurface,
foregroundColor: theme.colorScheme.onSurface,
textStyle: const TextStyle(fontWeight: FontWeight.normal),
),
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: LayoutBuilder(
builder: (context, constraints) {
return Row(
mainAxisAlignment: .center,
children: [
ConstrainedBox(
constraints: BoxConstraints(
maxWidth: constraints.maxWidth / 2,
),
child: textButtonLeft,
),
ConstrainedBox(
constraints: BoxConstraints(
maxWidth: constraints.maxWidth / 2,
),
child: textButtonRight,
),
],
);
},
),
),
),
IconButtonTheme(
data: IconButtonThemeData(
style: IconButton.styleFrom(
backgroundColor: theme.colorScheme.surfaceContainer,
iconSize: 24,
padding: const EdgeInsets.all(16),
),
),
child: Row(
mainAxisAlignment: .spaceEvenly,
children: iconButtons,
),
),
const SizedBox(height: 0.0),
],
),
),
);
}
}

View file

@ -1,45 +0,0 @@
import 'package:flutter/material.dart';
import 'package:fluffychat/utils/error_reporter.dart';
class FluffyChatErrorWidget extends StatefulWidget {
final FlutterErrorDetails details;
const FluffyChatErrorWidget(this.details, {super.key});
@override
State<FluffyChatErrorWidget> createState() => _FluffyChatErrorWidgetState();
}
class _FluffyChatErrorWidgetState extends State<FluffyChatErrorWidget> {
static final Set<String> knownExceptions = {};
@override
void initState() {
super.initState();
if (knownExceptions.contains(widget.details.exception.toString())) {
return;
}
knownExceptions.add(widget.details.exception.toString());
WidgetsBinding.instance.addPostFrameCallback((_) {
ErrorReporter(
context,
'Error Widget',
).onErrorCallback(widget.details.exception, widget.details.stack);
});
}
@override
Widget build(BuildContext context) {
return Material(
color: Colors.orange,
child: Placeholder(
child: Center(
child: Material(
color: Colors.white.withAlpha(230),
borderRadius: BorderRadius.circular(8),
),
),
),
);
}
}