Skip to content

Commit 5d099be

Browse files
Added field reportType to distinguish the report type.
1 parent 9ebca80 commit 5d099be

File tree

9 files changed

+24
-8
lines changed

9 files changed

+24
-8
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## Version 0.0.1+2
2+
3+
Added field of ```reportType``` to distinguish between system generated report and user generated
4+
report. By Default ```reportType``` is set to ```User initiated report```
5+
6+
## Version 0.0.1+1
7+
8+
Some bug fixes in the packages.
9+
110
## Version 0.0.1
211

312
Initial Release of the package.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![Flutter Feedback Banner](./assets/flutter_app_feedback_banner.png)
1+
![Flutter Feedback Banner](https://raw.githubusercontent.com/imihirpaldhikar/flutter_app_feedback/main/assets/flutter_app_feedback_banner.png)
22

33
# Flutter App Feedback
44

example/lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class _HomeScreenState extends State<HomeScreen> {
5555
context,
5656
MaterialPageRoute(
5757
builder: (BuildContext context) => FeedbackScreen(
58+
reportType: 'User initiated report', // Type of the report whether report is initiated by the system or the user.
5859
//fromEmail: 'user@example.com', // Remove this comment if you need to set a default email in From field.
5960
screenShotPath: imagePath,
6061
// Use the image that we have received from about function.

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ packages:
194194
path: ".."
195195
relative: true
196196
source: path
197-
version: "0.0.1"
197+
version: "0.0.1+1"
198198
flutter_lints:
199199
dependency: "direct dev"
200200
description:

lib/managers/dialog.manager.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class DialogManager {
3434
final AppService _appService = AppService();
3535
final IdentifierService _identifierService = IdentifierService();
3636

37-
void showAndroidSystemDialog() async {
37+
void showAndroidSystemDialog({required String reportType}) async {
3838
final _appInfo = await _appService.getAppInfo();
3939
final _deviceInfo = await _identifierService.getAndroidDeviceInformation();
4040
showDialog(
@@ -49,9 +49,9 @@ class DialogManager {
4949
mainAxisAlignment: MainAxisAlignment.start,
5050
crossAxisAlignment: CrossAxisAlignment.start,
5151
children: [
52-
const ListTile(
53-
title: Text('Report Type'),
54-
subtitle: Text('User initiated report'),
52+
ListTile(
53+
title: const Text('Report Type'),
54+
subtitle: Text(reportType),
5555
),
5656
ListTile(
5757
title: const Text('Package name'),

lib/models/feedback.model.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class FeedbackModel {
3030
final String appVersion;
3131
final String currentStateScreenShotUrl;
3232
final String userFeedbackData;
33+
final String reportType;
3334

3435
FeedbackModel({
3536
required this.appName,
@@ -38,5 +39,6 @@ class FeedbackModel {
3839
required this.userFeedbackData,
3940
required this.appVersion,
4041
required this.packageName,
42+
required this.reportType,
4143
});
4244
}

lib/services/feedback.service.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class FeedbackService {
5151
'userFeedbackData': feedback.userFeedbackData,
5252
'currentStateScreenShotUrl': feedback.currentStateScreenShotUrl,
5353
'feedbackSubmittedOn': FieldValue.serverTimestamp(),
54+
'reportType': feedback.reportType,
5455
'systemInformation': {
5556
'device': androidDeviceInfo!.device,
5657
'isPhysicalDevice': androidDeviceInfo.isPhysicalDevice,

lib/ui/screens/feedback.screen.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ class FeedbackScreen extends StatefulWidget {
4040
final String screenShotPath;
4141
final String feedbackFooterText;
4242
final String? fromEmail;
43+
final String reportType;
4344

4445
const FeedbackScreen({
4546
Key? key,
4647
required this.screenShotPath,
4748
required this.feedbackFooterText,
49+
required this.reportType,
4850
this.fromEmail = '',
4951
}) : super(key: key);
5052

@@ -104,6 +106,7 @@ class _FeedbackScreenState extends State<FeedbackScreen> {
104106
appName: appInfo.appName,
105107
buildVersionNumber: appInfo.appBuildNumber,
106108
appVersion: appInfo.appVersion,
109+
reportType: widget.reportType,
107110
currentStateScreenShotUrl: downloadableUrl,
108111
userFeedbackData: _feedback.text,
109112
packageName: appInfo.packageName,
@@ -289,7 +292,7 @@ class _FeedbackScreenState extends State<FeedbackScreen> {
289292
radius: 15,
290293
onTap: () {
291294
if (Platform.isAndroid) {
292-
DialogManager(context).showAndroidSystemDialog();
295+
DialogManager(context).showAndroidSystemDialog(reportType: widget.reportType);
293296
}
294297
},
295298
child: Container(

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_app_feedback
22
description: Flutter Package to implement Feedback System in Flutter Project.
3-
version: 0.0.1
3+
version: 0.0.1+1
44
homepage: https://github.com/imihirpaldhikar/flutter_app_feedback
55

66
environment:

0 commit comments

Comments
 (0)