@@ -3,95 +3,77 @@ import 'package:flutter/material.dart';
3
3
import 'package:instabug_flutter/instabug_flutter.dart' ;
4
4
5
5
class BugReportingState with ChangeNotifier {
6
- final _extraAttachments = {
6
+ var _extraAttachments = {
7
7
'Screenshot' : true ,
8
8
'Extra Screenshot' : true ,
9
9
'Gallery Image' : true ,
10
10
'Screen Recording' : true
11
11
};
12
12
Map <String , bool > get extraAttachments => _extraAttachments;
13
+ set extraAttachments (Map <String , bool > attachments) {
14
+ _extraAttachments = attachments;
15
+ notifyListeners ();
16
+ }
13
17
14
18
var _selectedInvocationOptions = < InvocationOption > {};
15
- final _invocationOptions = {
16
- InvocationOption .commentFieldRequired: 'Comment Required' ,
17
- InvocationOption .emailFieldHidden: 'Email Hidden' ,
18
- InvocationOption .emailFieldOptional: 'Email Optional' ,
19
- InvocationOption .disablePostSendingDialog: 'Disable Post Sending Dialog' ,
20
- };
21
19
Set <InvocationOption > get selectedInvocationOptions =>
22
20
_selectedInvocationOptions;
23
- set selectedInvocationOptions (Set <InvocationOption > value ) {
24
- _selectedInvocationOptions = value ;
21
+ set selectedInvocationOptions (Set <InvocationOption > options ) {
22
+ _selectedInvocationOptions = options ;
25
23
notifyListeners ();
26
24
}
27
25
28
- Map <InvocationOption , String > get invocationOptions => _invocationOptions;
29
-
30
26
var _selectedInvocationEvents = < InvocationEvent > {
31
27
InvocationEvent .floatingButton
32
28
};
33
- final _invocationEvents = {
34
- InvocationEvent .floatingButton: 'Floating Button' ,
35
- InvocationEvent .shake: 'Shake' ,
36
- InvocationEvent .screenshot: 'Screenshot' ,
37
- InvocationEvent .twoFingersSwipeLeft: 'Two Finger Swipe Left' ,
38
- InvocationEvent .none: 'None' ,
39
- };
40
29
Set <InvocationEvent > get selectedInvocationEvents =>
41
30
_selectedInvocationEvents;
42
- set selectedInvocationEvents (Set <InvocationEvent > value ) {
43
- _selectedInvocationEvents = value ;
31
+ set selectedInvocationEvents (Set <InvocationEvent > events ) {
32
+ _selectedInvocationEvents = events ;
44
33
notifyListeners ();
45
34
}
46
35
47
- Map <InvocationEvent , String > get invocationEvents => _invocationEvents;
48
-
49
- var _selectedExtendedMode = 'Disabled' ;
50
- final _extendedMode = {
51
- ExtendedBugReportMode .disabled: 'Disabled' ,
52
- ExtendedBugReportMode .enabledWithOptionalFields: 'Optional Fields' ,
53
- ExtendedBugReportMode .enabledWithRequiredFields: 'Required Fields' ,
54
- };
55
- String get selectedExtendedMode => _selectedExtendedMode;
56
- set selectedExtendedMode (String value) {
57
- _selectedExtendedMode = value;
36
+ var _selectedExtendedMode = ExtendedBugReportMode .disabled;
37
+ ExtendedBugReportMode get selectedExtendedMode => _selectedExtendedMode;
38
+ set selectedExtendedMode (ExtendedBugReportMode mode) {
39
+ _selectedExtendedMode = mode;
58
40
notifyListeners ();
59
41
}
60
42
61
- Map <ExtendedBugReportMode , String > get extendedMode => _extendedMode;
62
-
63
- var _selectedVideoRecordingPosition = 'Bottom Right' ;
64
- final _videoRecordingPosition = {
65
- Position .topLeft: 'Top Left' ,
66
- Position .topRight: 'Top Right' ,
67
- Position .bottomLeft: 'Bottom Left' ,
68
- Position .bottomRight: 'Bottom Right' ,
69
- };
70
- String get selectedVideoRecordingPosition => _selectedVideoRecordingPosition;
71
- set selectedVideoRecordingPosition (String value) {
72
- _selectedVideoRecordingPosition = value;
43
+ var _selectedVideoRecordingPosition = Position .bottomRight;
44
+ Position get selectedVideoRecordingPosition =>
45
+ _selectedVideoRecordingPosition;
46
+ set selectedVideoRecordingPosition (Position position) {
47
+ _selectedVideoRecordingPosition = position;
73
48
notifyListeners ();
74
49
}
75
50
76
- Map <Position , String > get videoRecordingPosition => _videoRecordingPosition;
51
+ var _selectedFloatingButtonEdge = FloatingButtonEdge .right;
52
+ FloatingButtonEdge get selectedFloatingButtonEdge =>
53
+ _selectedFloatingButtonEdge;
54
+ set selectedFloatingButtonEdge (FloatingButtonEdge edge) {
55
+ _selectedFloatingButtonEdge = edge;
56
+ notifyListeners ();
57
+ }
77
58
78
- var _selectedFloatingButtonEdge = 'Right' ;
79
- var _selectedFloatingButtonOffset = 100 ;
80
- final _floatingButtonEdge = {
81
- FloatingButtonEdge .right: 'Right' ,
82
- FloatingButtonEdge .left: 'Left' ,
83
- };
84
- String get selectedFloatingButtonEdge => _selectedFloatingButtonEdge;
85
- set selectedFloatingButtonEdge (String value) {
86
- _selectedFloatingButtonEdge = value;
59
+ var _disclaimerText = '' ;
60
+ String get disclaimerText => _disclaimerText;
61
+ set disclaimerText (String text) {
62
+ _disclaimerText = text;
87
63
notifyListeners ();
88
64
}
89
65
90
- Map <FloatingButtonEdge , String > get floatingButtonEdge => _floatingButtonEdge;
66
+ var _characterCount = '' ;
67
+ String get characterCount => _characterCount;
68
+ set characterCount (String count) {
69
+ _characterCount = count;
70
+ notifyListeners ();
71
+ }
91
72
92
- int get selectedFloatingButtonOffset => _selectedFloatingButtonOffset;
93
- set selectedFloatingButtonOffset (int value) {
94
- _selectedFloatingButtonOffset = value;
73
+ var _floatingButtonOffset = 100 ;
74
+ int get floatingButtonOffset => _floatingButtonOffset;
75
+ set floatingButtonOffset (int offset) {
76
+ _floatingButtonOffset = offset;
95
77
notifyListeners ();
96
78
}
97
79
}
0 commit comments