@@ -3,7 +3,6 @@ import 'dart:io';
3
3
import 'package:flutter/cupertino.dart' ;
4
4
import 'package:flutter/material.dart' ;
5
5
import 'package:flutter/services.dart' ;
6
- import 'package:flutter_paystack_payment/flutter_paystack_payment.dart' ;
7
6
import 'package:flutter_screenutil/flutter_screenutil.dart' ;
8
7
import 'package:hive/hive.dart' ;
9
8
import 'package:hive_flutter/hive_flutter.dart' ;
@@ -30,48 +29,34 @@ class HomeScreen extends StatefulWidget {
30
29
31
30
class _HomeScreenState extends State <HomeScreen > {
32
31
Box <NoteModel >? storeData;
33
- final plugin = PaystackPayment ();
34
32
35
33
@override
36
34
void initState () {
37
35
super .initState ();
38
36
storeData = Hive .box <NoteModel >(noteBox);
39
37
initPlatformState ();
40
38
_checkVersion ();
41
- plugin.initialize (publicKey: payStackPubKey);
42
39
}
43
40
44
41
void _checkVersion () async {
45
42
final newVersion = NewVersion (
46
- androidId: 'com.viewus.v_notes' ,
43
+ androidId: androidID ,
47
44
);
48
45
final status = await newVersion.getVersionStatus ();
49
46
if (status! .canUpdate) {
50
- newVersion. showUpdateDialog (
51
- context : context,
52
- versionStatus : status ,
53
- dialogTitle : 'Update V Notes' ,
54
- dialogText : 'There is a new update for V Notes, '
55
- 'would you like to update to check up '
56
- 'what we have improved about the app ' ,
57
- updateButtonText : 'Update now ' ,
58
- dismissButtonText : 'Maybe Later' ,
59
- );
47
+ if (mounted) {
48
+ newVersion. showUpdateDialog (
49
+ context : context ,
50
+ versionStatus : status ,
51
+ dialogTitle : dialogTitle,
52
+ dialogText : dialogText,
53
+ updateButtonText : 'Update now ' ,
54
+ dismissButtonText : 'Maybe Later ' ,
55
+ );
56
+ }
60
57
}
61
58
}
62
59
63
- Future startPayment () async {
64
- Charge charge = Charge ()
65
- ..amount = 10000
66
- ..reference = 'dafsddafdfas'
67
- ..email = 'customer@email.com' ;
68
- CheckoutResponse response = await plugin.checkout (
69
- context,
70
- method: CheckoutMethod .card, // Defaults to CheckoutMethod.selectable
71
- charge: charge,
72
- );
73
- }
74
-
75
60
static const String oneSignalAppId = 'e41ee34c-a2e9-4345-aa95-078b223419b3' ;
76
61
77
62
@override
@@ -204,7 +189,7 @@ class _HomeScreenState extends State<HomeScreen> {
204
189
: defaultWhite,
205
190
),
206
191
Text (
207
- 'Could Note' ,
192
+ 'Cloud Note' ,
208
193
style: TextStyle (
209
194
fontSize: 20. sp,
210
195
fontWeight: FontWeight .bold,
0 commit comments