-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.dart
69 lines (63 loc) · 2.03 KB
/
main.dart
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import 'package:flutter/material.dart';
import 'package:in_app_feedback/flutter_feedback.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const HomePage(title: 'Flutter Feedback Example'),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key, required this.title});
final String title;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: ElevatedButton(
onPressed: () {
FlutterFeedback.showFeedbackBottomSheet(
context: context,
emailConfig: EmailConfig(
toMailList: [
'test@gmail.com',
],
fromMail: 'developer.test@gmail.com',
sendGridToken: 'kSendGridKey',
),
gitHubConfig: GitHubConfig(
accessToken: 'kGithubToken',
gitHubUserName: 'codingWithTashi',
repositoryName: 'tibetan_proverb',
),
feedbackCallback: (FeedbackData data) {
if (data.error == null) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text("Feedback Sent")));
} else {
ScaffoldMessenger.of(context)
.showSnackBar(SnackBar(content: Text(data.error!)));
}
},
bottomSheetShape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(15.0),
topRight: Radius.circular(15.0),
),
),
);
},
child: const Text('Send Feedback')),
),
);
}
}