forked from fossasia/magic-epaper-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoverlay_item.dart
More file actions
44 lines (40 loc) · 994 Bytes
/
overlay_item.dart
File metadata and controls
44 lines (40 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import 'dart:typed_data';
import 'package:flutter/material.dart';
enum OverlayType { text, image }
class OverlayItem {
final String id;
final String type;
final String? text;
final Uint8List? imageBytes;
final Color? color;
final String font;
final double fontSize;
final String? label;
Offset position;
double scale;
double rotation;
OverlayItem.text({
required this.text,
required this.color,
this.font = 'Roboto',
this.fontSize = 24.0,
this.label,
this.position = const Offset(100, 100),
this.scale = 1.0,
this.rotation = 0.0,
}) : id = UniqueKey().toString(),
type = 'text',
imageBytes = null;
OverlayItem.image({
required this.imageBytes,
this.font = 'Roboto',
this.fontSize = 24.0,
this.label,
this.position = const Offset(100, 100),
this.scale = 1.0,
this.rotation = 0.0,
}) : id = UniqueKey().toString(),
type = 'image',
text = null,
color = null;
}