@@ -12,8 +12,8 @@ import 'package:http/http.dart' as http;
1212// Step 2. Click "Deploy to heroku"
1313// Step 3. Login with your heroku credentials or create a free heroku account
1414// Step 4. Provide your secret key and an email with which to start all test transactions
15- // Step 5. Copy the url generated by heroku (format https://some-url.herokuapp.com) into the space below
16- String backendUrl = 'https://wilbur-paystack.herokuapp.com ' ;
15+ // Step 5. Replace {YOUR_BACKEND_URL} below with the url generated by heroku (format https://some-url.herokuapp.com)
16+ String backendUrl = '{YOUR_BACKEND_URL} ' ;
1717// Set this to a public key that matches the secret key you supplied while creating the heroku instance
1818String paystackPublicKey = '{YOUR_PAYSTACK_PUBLIC_KEY}' ;
1919const String appName = 'Paystack Example' ;
@@ -198,12 +198,28 @@ class _HomePageState extends State<HomePage> {
198198 _horizontalSizeBox,
199199 new Flexible (
200200 flex: 2 ,
201- child: new Container (
202- width: double .infinity,
203- child: _getPlatformButton (
204- 'Checkout' ,
205- () => _handleCheckout (),
206- )),
201+ child: Theme (
202+ data: Theme .of (context).copyWith (
203+ accentColor: green,
204+ primaryColorLight: Colors .white,
205+ primaryColorDark: navyBlue,
206+ textTheme:
207+ Theme .of (context).textTheme.copyWith (
208+ body2: TextStyle (
209+ color: lightBlue,
210+ ),
211+ ),
212+ ),
213+ child: Builder (
214+ builder: (context) => new Container (
215+ width: double .infinity,
216+ child: _getPlatformButton (
217+ 'Checkout' ,
218+ () => _handleCheckout (context),
219+ ),
220+ ),
221+ ),
222+ ),
207223 ),
208224 ],
209225 )
@@ -220,7 +236,7 @@ class _HomePageState extends State<HomePage> {
220236 void _handleRadioValueChanged (int value) =>
221237 setState (() => _radioValue = value);
222238
223- _handleCheckout () async {
239+ _handleCheckout (BuildContext context ) async {
224240 if (_method == null ) {
225241 _showMessage ('Select checkout method first' );
226242 return ;
@@ -244,6 +260,7 @@ class _HomePageState extends State<HomePage> {
244260 method: _method,
245261 charge: charge,
246262 fullscreen: false ,
263+ logo: MyLogo (),
247264 );
248265 print ('Response = $response ' );
249266 setState (() => _inProgress = false );
@@ -454,3 +471,29 @@ CheckoutMethod _parseStringToMethod(String string) {
454471 }
455472 return method;
456473}
474+
475+ class MyLogo extends StatelessWidget {
476+ @override
477+ Widget build (BuildContext context) {
478+ return Container (
479+ decoration: BoxDecoration (
480+ shape: BoxShape .circle,
481+ color: Colors .black,
482+ ),
483+ alignment: Alignment .center,
484+ padding: EdgeInsets .all (10 ),
485+ child: Text (
486+ "CO" ,
487+ style: TextStyle (
488+ color: Colors .white,
489+ fontSize: 13 ,
490+ fontWeight: FontWeight .bold,
491+ ),
492+ ),
493+ );
494+ }
495+ }
496+
497+ const Color green = const Color (0xFF3db76d );
498+ const Color lightBlue = const Color (0xFF34a5db );
499+ const Color navyBlue = const Color (0xFF031b33 );
0 commit comments