-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.dart
52 lines (49 loc) · 1.44 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
import 'package:flutter/material.dart';
import 'package:quick_feedback/quick_feedback.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
void _showFeedback(context) {
showDialog(
context: context,
builder: (context) {
return QuickFeedback(
title: 'Leave a feedback', // Title of dialog
showTextBox: true, // default false
textBoxHint:
'Share your feedback', // Feedback text field hint text default: Tell us more
submitText: 'SUBMIT', // submit button text default: SUBMIT
onSubmitCallback: (feedback) {
print('$feedback'); // map { rating: 2, feedback: 'some feedback' }
Navigator.of(context).pop();
},
askLaterText: 'ASK LATER',
onAskLaterCallback: () {
print('Do something on ask later click');
},
);
},
);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Example App',
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
title: Text('Quick Feedback'),
),
body: SingleChildScrollView(
child: Container(
child: Center(
child: FlatButton(
onPressed: () => _showFeedback(context),
child: Text('Feedback'),
),
),
),
),
),
);
}
}