initial commit: LeafViewer, LeafZoomable, LeafContextMenu, LeafPopover, LeafImage, misc widgets + tests
This commit is contained in:
commit
9bb0ff9187
156 files changed
+9887
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:leaf_widgets/leaf_widgets.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('barrel exports build all widgets', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Scaffold(
|
||||
body: Column(
|
||||
children: [
|
||||
const AnimatedStar(),
|
||||
const AnimatedFavoriteButton(),
|
||||
LeafImage(image: MemoryImage(Uint8List(0))),
|
||||
LeafPopover(
|
||||
popoverBuilder: (context, controller) => const Card(child: Text('popover')),
|
||||
child: const Text('trigger'),
|
||||
),
|
||||
LeafContextMenu(
|
||||
entries: const [ContextMenuAction(label: 'Copy')],
|
||||
child: const Text('menu'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(find.byType(AnimatedStar), findsOneWidget);
|
||||
expect(find.byType(AnimatedFavoriteButton), findsOneWidget);
|
||||
expect(find.byType(LeafImage), findsOneWidget);
|
||||
expect(find.byType(LeafPopover), findsOneWidget);
|
||||
expect(find.byType(LeafContextMenu), findsOneWidget);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user