ModernMemoires/test/icon_finder.dart

12 lines
401 B
Dart
Raw Permalink Normal View History

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
Finder findIconByAsset(String assetName) {
return find.byWidgetPredicate(
(Widget widget) => widget is IconButton &&
widget.icon is Image &&
(widget.icon as Image).image is AssetImage &&
((widget.icon as Image).image as AssetImage).keyName == 'assets/icons/$assetName',
);
}