-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flutter: minor improvements to the test
Remove 1 dock widget, added guest widget. Testing if image diff works.
- Loading branch information
Showing
2 changed files
with
54 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
This file is part of KDDockWidgets. | ||
SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]> | ||
Author: Sérgio Martins <[email protected]> | ||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only | ||
Contact KDAB at <[email protected]> for commercial licensing options. | ||
*/ | ||
import 'dart:io'; | ||
|
||
import 'package:flutter/material.dart'; | ||
|
||
// ignore: must_be_immutable | ||
class MyWidget extends StatelessWidget { | ||
static int nextImageId = 0; | ||
final int imageId; | ||
MyWidget({super.key}) : imageId = nextImageId { | ||
MyWidget.nextImageId++; | ||
} | ||
|
||
String imageName() { | ||
switch (imageId % 2) { | ||
case 0: | ||
return 'assets/KDAB_bubble_fulcolor.png'; | ||
case 1: | ||
return 'assets/KDAB_bubble_blue.png'; | ||
} | ||
|
||
return 'assets/KDAB_bubble_fulcolor.png'; | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
color: Colors.white, | ||
padding: const EdgeInsets.all(40.0), | ||
child: Image.file( | ||
File(imageName()), | ||
fit: BoxFit.contain, | ||
), | ||
); | ||
} | ||
} |