|
1 | | -// import 'package:flutter/material.dart'; |
2 | | -// import 'package:flutter/services.dart'; |
3 | | -// import 'package:provider/provider.dart'; |
4 | | -// import 'package:haider_app/screens/business_overview_screen.dart'; |
5 | | -// import 'package:haider_app/screens/splash_screen.dart'; |
6 | | - |
7 | | -// import './screens/login_screen.dart'; |
8 | | - |
9 | | -// import './providers/auth.dart'; |
10 | | - |
11 | | -// Future main() async { |
12 | | -// WidgetsFlutterBinding.ensureInitialized(); |
13 | | -// await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); |
14 | | -// runApp(MyApp()); |
15 | | -// } |
16 | | - |
17 | | -// class MyApp extends StatelessWidget { |
18 | | -// @override |
19 | | -// Widget build(BuildContext context) { |
20 | | -// return MultiProvider( |
21 | | -// providers: [ |
22 | | -// ChangeNotifierProvider( |
23 | | -// create: (context) => Auth(), |
24 | | -// ), |
25 | | -// ], |
26 | | -// child: Consumer<Auth>(builder: (ctx, auth, _) { |
27 | | -// // print(auth.isAuth); |
28 | | -// return MaterialApp( |
29 | | -// debugShowCheckedModeBanner: false, |
30 | | -// title: '''Haider's App''', |
31 | | -// theme: ThemeData( |
32 | | -// scaffoldBackgroundColor: Colors.white, |
33 | | -// primaryColor: Color.fromRGBO(124, 116, 146, 1), |
34 | | -// buttonTheme: ButtonThemeData(textTheme: ButtonTextTheme.primary), |
35 | | -// appBarTheme: AppBarTheme( |
36 | | -// color: Colors.white, |
37 | | -// elevation: 0.0, |
38 | | -// iconTheme: |
39 | | -// IconThemeData(color: Color.fromRGBO(124, 116, 146, 1))), |
40 | | -// ), |
41 | | -// home: auth.isAuth |
42 | | -// ? BusinessOverViewScreen() |
43 | | -// : FutureBuilder( |
44 | | -// builder: (context, authResultSnapshot) { |
45 | | -// print(auth.isAuth); |
46 | | -// return authResultSnapshot.connectionState == |
47 | | -// ConnectionState.waiting |
48 | | -// ? SplashScreen() |
49 | | -// : LoginScreen(); |
50 | | -// }, |
51 | | -// future: auth.tryAutoLogin(), |
52 | | -// ), |
53 | | -// routes: { |
54 | | -// LoginScreen.routeName: (ctx) => LoginScreen(), |
55 | | -// // RegisterScreen.routeName: (ctx) => RegisterScreen(), |
56 | | -// BusinessOverViewScreen.routeName: (ctx) => |
57 | | -// BusinessOverViewScreen() |
58 | | -// }, |
59 | | -// ); |
60 | | -// })); |
61 | | -// } |
62 | | -// } |
63 | | -// import 'package:flutter/material.dart'; |
64 | | -// import 'package:flutter/services.dart'; |
65 | | -// import 'package:sms_maintained/sms.dart'; |
66 | | - |
67 | | -// Future main() async { |
68 | | -// WidgetsFlutterBinding.ensureInitialized(); |
69 | | -// await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); |
70 | | -// runApp( |
71 | | -// MaterialApp( |
72 | | -// home: SendSmsScreen(), |
73 | | -// ), |
74 | | -// ); |
75 | | -// } |
76 | | - |
77 | | -// class SendSmsScreen extends StatelessWidget { |
78 | | -// final SmsSender sender = SmsSender(); |
79 | | -// final SmsMessage message = SmsMessage('03009640742', '_body'); |
80 | | -// final List<SmsMessage> smsList = [ |
81 | | -// SmsMessage('03009750742', 'Random'), |
82 | | -// SmsMessage('03008750742', 'Kaleem'), |
83 | | -// SmsMessage('03056750742', 'Shahryar'), |
84 | | -// SmsMessage('03127750742', 'Shahryar Zong') |
85 | | -// ]; |
86 | | -// @override |
87 | | -// Widget build(BuildContext context) { |
88 | | -// return Scaffold( |
89 | | -// appBar: AppBar(), |
90 | | -// body: ListView.builder( |
91 | | -// itemCount: smsList.length, |
92 | | -// itemBuilder: (context, index) { |
93 | | -// return SingleChildScrollView( |
94 | | -// child: Column( |
95 | | -// children: [ |
96 | | -// IconButton( |
97 | | -// icon: Icon(Icons.send), |
98 | | -// onPressed: () { |
99 | | -// sender.sendSms(smsList[index]); |
100 | | -// }, |
101 | | -// ), |
102 | | -// StreamBuilder<SmsMessageState>( |
103 | | -// key: GlobalKey(debugLabel: 'String $index'), |
104 | | -// // initialData: SmsMessageState.None, |
105 | | -// builder: (context, snapshot) { |
106 | | -// if (snapshot.data == SmsMessageState.Sent) { |
107 | | -// return Text('Message Sent'); |
108 | | -// } |
109 | | -// if (snapshot.data == SmsMessageState.Delivered) { |
110 | | -// return Text('Message Delivered'); |
111 | | -// } |
112 | | -// if (snapshot.data == SmsMessageState.Sending) { |
113 | | -// return Text('Sending'); |
114 | | -// } |
115 | | -// if (snapshot.data == SmsMessageState.Fail) |
116 | | -// return Text('Sending Failed'); |
117 | | -// return Text('Error'); |
118 | | -// }, |
119 | | -// stream: smsList[index].onStateChanged, |
120 | | -// ), |
121 | | -// ], |
122 | | -// ), |
123 | | -// ); |
124 | | -// }, |
125 | | -// )); |
126 | | -// } |
127 | | -// } |
128 | 1 | import 'package:flutter/material.dart'; |
129 | | -// import 'package:woosignal/models/response/products.dart'; |
130 | | -// import 'package:woosignal/models/response/coupon.dart'; |
131 | 2 | import 'package:woosignal/models/response/system_status.dart' as systemStatus; |
132 | 3 | import 'package:woosignal/woosignal.dart'; |
| 4 | +import 'package:woosignal/models/response/payment_gateway.dart'; |
133 | 5 |
|
134 | 6 | void main() => runApp(MyApp()); |
135 | 7 |
|
@@ -169,11 +41,12 @@ class _MyHomePageState extends State<MyHomePage> { |
169 | 41 | // CREATING AN INSTANCE |
170 | 42 | WooSignal wooSignal = await WooSignal.getInstance(config: wsConfig); |
171 | 43 |
|
172 | | - systemStatus.SystemStatus coupons = await wooSignal.getSystemStatus(); |
173 | | - print(coupons.database); |
| 44 | + PaymentGateWay coupons = await wooSignal |
| 45 | + .updatePaymentGateway(id: 'bacs', data: {'enabled': false}); |
| 46 | + print(coupons.enabled); |
174 | 47 |
|
175 | 48 | setState(() { |
176 | | - _productName = coupons.database.databaseTables.woocommerce.toString(); |
| 49 | + _productName = coupons.enabled.toString(); |
177 | 50 | }); |
178 | 51 | } |
179 | 52 |
|
|
0 commit comments