Imrpoved image handling since the size of the image is about 5MB.

This commit is contained in:
verboomp
2026-02-02 10:35:22 +01:00
parent 33ee33d55c
commit 8d329501e4
15 changed files with 235 additions and 46 deletions

File diff suppressed because one or more lines are too long

View File

@@ -12,9 +12,6 @@ import 'package:mockito/mockito.dart';
import '../testing/test_utils.dart';
import '../testing/test_utils.mocks.dart';
// Minimal valid base64 encoded 1x1 pixel PNG image
const String _testImage = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==';
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
DiContainer.instance.initState();
@@ -31,30 +28,36 @@ void main() {
id: 1,
comment: 'First picture comment',
category: 'category1',
image: _testImage,
pictureDate: DateTime(2024, 1, 15),
username: 'user1',
evaluation: 1,
imageUrl: "",
normalSizeUrl: "",
thumbnailSizeUrl: "",
);
pictureDto2 = PictureDto(
id: 2,
comment: 'Second picture comment',
category: 'category2',
image: _testImage,
pictureDate: DateTime(2024, 2, 20),
username: 'user2',
evaluation: 1,
imageUrl: "",
normalSizeUrl: "",
thumbnailSizeUrl: "",
);
pictureDto3 = PictureDto(
id: 3,
comment: null,
category: 'category3',
image: _testImage,
pictureDate: DateTime(2024, 3, 25),
username: 'user3',
evaluation: 1,
imageUrl: "",
normalSizeUrl: "",
thumbnailSizeUrl: "",
);
customerDto = CustomerDto(
@@ -170,10 +173,9 @@ void main() {
expect(find.text('First picture comment'), findsOneWidget);
// Tap right navigation button
print(find.byKey(Key("navigate_right")));
await tester.tap(find.byKey(Key("navigate_right")));
await tester.pumpAndSettle();
// Verify second picture comment is now shown
expect(find.text('Second picture comment'), findsOneWidget);
expect(find.text('First picture comment'), findsNothing);