refactor: clean up imports and improve code readability across various files

This commit is contained in:
mso7nueh
2025-12-24 17:54:35 +03:00
parent 3d774267ca
commit e158d812e4
41 changed files with 4699 additions and 4613 deletions

View File

@@ -1,127 +1,129 @@
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:eatvio_app/features/diets/presentation/widgets/info_bouble.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
group('InfoBouble', () {
testWidgets('displays info bouble with children', (tester) async {
await tester.pumpWidget(
MaterialApp(
theme: ThemeHelper().themeData(),
home: const Scaffold(
body: InfoBouble(
children: [
Text('Test'),
Icon(Icons.star),
],
),
),
),
);
expect(find.byType(InfoBouble), findsOneWidget);
expect(find.text('Test'), findsOneWidget);
expect(find.byIcon(Icons.star), findsOneWidget);
});
testWidgets('displays with custom background color', (tester) async {
await tester.pumpWidget(
MaterialApp(
theme: ThemeHelper().themeData(),
home: const Scaffold(
body: InfoBouble(
backgroundColor: Colors.blue,
children: [
Text('Test'),
],
),
),
),
);
expect(find.byType(InfoBouble), findsOneWidget);
});
testWidgets('displays with custom radius', (tester) async {
await tester.pumpWidget(
MaterialApp(
theme: ThemeHelper().themeData(),
home: const Scaffold(
body: InfoBouble(
radius: 20,
children: [
Text('Test'),
],
),
),
),
);
expect(find.byType(InfoBouble), findsOneWidget);
});
testWidgets('displays with custom padding', (tester) async {
await tester.pumpWidget(
MaterialApp(
theme: ThemeHelper().themeData(),
home: const Scaffold(
body: InfoBouble(
padding: EdgeInsets.all(16),
children: [
Text('Test'),
],
),
),
),
);
expect(find.byType(InfoBouble), findsOneWidget);
});
testWidgets('displays with custom mainAxisAlignment', (tester) async {
await tester.pumpWidget(
MaterialApp(
theme: ThemeHelper().themeData(),
home: const Scaffold(
body: InfoBouble(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Test'),
],
),
),
),
);
expect(find.byType(InfoBouble), findsOneWidget);
});
});
}
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:eatvio_app/features/diets/presentation/widgets/info_bouble.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
group('InfoBouble', () {
testWidgets('displays info bouble with children', (tester) async {
await tester.pumpWidget(
MaterialApp(
theme: ThemeHelper().themeData(),
home: const Scaffold(
body: InfoBouble(
children: [
Text('Test'),
Icon(Icons.star),
],
),
),
),
);
expect(find.byType(InfoBouble), findsOneWidget);
expect(find.text('Test'), findsOneWidget);
expect(find.byIcon(Icons.star), findsOneWidget);
});
testWidgets('displays with custom background color', (tester) async {
await tester.pumpWidget(
MaterialApp(
theme: ThemeHelper().themeData(),
home: const Scaffold(
body: InfoBouble(
backgroundColor: Colors.blue,
children: [
Text('Test'),
],
),
),
),
);
expect(find.byType(InfoBouble), findsOneWidget);
});
testWidgets('displays with custom radius', (tester) async {
await tester.pumpWidget(
MaterialApp(
theme: ThemeHelper().themeData(),
home: const Scaffold(
body: InfoBouble(
radius: 20,
children: [
Text('Test'),
],
),
),
),
);
expect(find.byType(InfoBouble), findsOneWidget);
});
testWidgets('displays with custom padding', (tester) async {
await tester.pumpWidget(
MaterialApp(
theme: ThemeHelper().themeData(),
home: const Scaffold(
body: InfoBouble(
padding: EdgeInsets.all(16),
children: [
Text('Test'),
],
),
),
),
);
expect(find.byType(InfoBouble), findsOneWidget);
});
testWidgets('displays with custom mainAxisAlignment', (tester) async {
await tester.pumpWidget(
MaterialApp(
theme: ThemeHelper().themeData(),
home: const Scaffold(
body: InfoBouble(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Test'),
],
),
),
),
);
expect(find.byType(InfoBouble), findsOneWidget);
});
});
}