first commit
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
import 'package:sign_checker/data/catalog/bundled_sign_catalog.dart';
|
||||
import 'package:sign_checker/domain/detection_stabilizer.dart';
|
||||
import 'package:sign_checker/domain/norm_rect.dart';
|
||||
import 'package:sign_checker/presentation/camera/sign_panel.dart';
|
||||
import 'package:sign_checker/presentation/catalog/catalog_page.dart';
|
||||
import 'package:sign_checker/presentation/catalog/sign_detail_page.dart';
|
||||
import 'package:sign_checker_widgetbook/support/preview.dart';
|
||||
import 'package:widgetbook/widgetbook.dart';
|
||||
|
||||
WidgetbookComponent catalogScreenComponent() {
|
||||
return WidgetbookComponent(
|
||||
name: 'Catalog',
|
||||
useCases: [
|
||||
WidgetbookUseCase(
|
||||
name: 'Directory',
|
||||
builder: (context) => const IosScreenPreview(child: CatalogPage()),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
WidgetbookComponent signDetailScreenComponent() {
|
||||
return WidgetbookComponent(
|
||||
name: 'Sign detail',
|
||||
useCases: [
|
||||
WidgetbookUseCase(
|
||||
name: '3.27',
|
||||
builder: (context) {
|
||||
final sign = bundledSignCatalog.findByCode('3.27')!;
|
||||
return IosScreenPreview(child: SignDetailPage(sign: sign));
|
||||
},
|
||||
),
|
||||
WidgetbookUseCase(
|
||||
name: '3.24 speed',
|
||||
builder: (context) {
|
||||
final sign = bundledSignCatalog.findByCode('3.24')!;
|
||||
return IosScreenPreview(child: SignDetailPage(sign: sign));
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
WidgetbookComponent signPanelComponent() {
|
||||
return WidgetbookComponent(
|
||||
name: 'Sign panel',
|
||||
useCases: [
|
||||
WidgetbookUseCase(
|
||||
name: 'Recognized 3.27',
|
||||
builder: (context) {
|
||||
final sign = bundledSignCatalog.findByCode('3.27')!;
|
||||
final detection = SignDetection(
|
||||
rawLabel: sign.code,
|
||||
confidence: 0.86,
|
||||
box: const NormRect(0.2, 0.2, 0.4, 0.4),
|
||||
sign: sign,
|
||||
);
|
||||
return IosPreview(
|
||||
stretch: true,
|
||||
child: SignPanel(
|
||||
detections: [detection],
|
||||
primary: detection,
|
||||
onSelect: (_) {},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user