First, you will need to add feedback_github
to your pubspec.yaml
.
dependencies:
flutter:
sdk: flutter
feedback: ^3.1.0
feedback_github:
git:
url: https://github.com/Rocke1001feller/feedback_github/
ref: main
dependency_overrides:
uuid: ^4.0.0
feedback_github:
git:
url: https://github.com/Rocke1001feller/feedback_github/
ref: main
Then, run flutter pub get
in your terminal.
Just wrap your app in a BetterFeedback
widget.
To show the feedback view just call BetterFeedback.of(context).show(...);
.
The callback gets called when the user submits his feedback.
import 'package:feedback_github/feedback_github.dart';
import 'package:uuid/uuid.dart';
void main() {
runApp(
BetterFeedback(
darkTheme: FeedbackThemeData.dark(),
child: MyApp(),
),
);
}
Provide a way to show the feedback panel by calling
BetterFeedback.of(context).showAndUploadToGitHub(
username: 'username',
repository: 'repository',
authToken: 'github_pat_',
labels: ['feedback'],
assignees: ['username'],
customMarkdown: '**Below are System Info**',
imageId: Uuid().v4(),
);
Provide a way to hide the feedback panel by calling BetterFeedback.of(context).hide();
A Personal Access Token with the following
- issues (write)
- content (write)
- metadata (read)
It is recommended that you create a fine-grained Personal Access Token which only has access to the repository in which you'd like to create issues for.Moreover, consider adding a separate repository for your collected feedback.
The github repository repository
for user username
requires a issue_images
branch where the images for issue can be uploaded to.