Skip to content

Commit 18cbade

Browse files
committed
Exemplified usage of of fullscreen flag . Resolves #5
1 parent 14db9d8 commit 18cbade

File tree

1 file changed

+64
-67
lines changed

1 file changed

+64
-67
lines changed

example/lib/main.dart

Lines changed: 64 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -148,67 +148,67 @@ class _HomePageState extends State<HomePage> {
148148
_verticalSizeBox,
149149
_inProgress
150150
? new Container(
151-
alignment: Alignment.center,
152-
height: 50.0,
153-
child: Platform.isIOS
154-
? new CupertinoActivityIndicator()
155-
: new CircularProgressIndicator(),
156-
)
151+
alignment: Alignment.center,
152+
height: 50.0,
153+
child: Platform.isIOS
154+
? new CupertinoActivityIndicator()
155+
: new CircularProgressIndicator(),
156+
)
157157
: new Column(
158-
mainAxisSize: MainAxisSize.min,
159-
children: <Widget>[
160-
_getPlatformButton(
161-
'Charge Card', () => _startAfreshCharge()),
162-
_verticalSizeBox,
163-
_border,
164-
new SizedBox(
165-
height: 40.0,
166-
),
167-
new Row(
168-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
169-
crossAxisAlignment: CrossAxisAlignment.center,
170-
children: <Widget>[
171-
new Flexible(
172-
flex: 3,
173-
child: new DropdownButtonHideUnderline(
174-
child: new InputDecorator(
175-
decoration: const InputDecoration(
176-
border: OutlineInputBorder(),
177-
isDense: true,
178-
hintText: 'Checkout method',
179-
),
180-
isEmpty: _method == null,
181-
child: new DropdownButton<CheckoutMethod>(
182-
value: _method,
183-
isDense: true,
184-
onChanged: (CheckoutMethod value) {
185-
setState(() {
186-
_method = value;
187-
});
188-
},
189-
items: banks.map((String value) {
190-
return new DropdownMenuItem<
191-
CheckoutMethod>(
192-
value: _parseStringToMethod(value),
193-
child: new Text(value),
194-
);
195-
}).toList(),
196-
),
197-
))),
198-
_horizontalSizeBox,
199-
new Flexible(
200-
flex: 2,
201-
child: new Container(
202-
width: double.infinity,
203-
child: _getPlatformButton(
204-
'Checkout',
205-
() => _handleCheckout(),
206-
)),
207-
),
208-
],
209-
)
210-
],
211-
)
158+
mainAxisSize: MainAxisSize.min,
159+
children: <Widget>[
160+
_getPlatformButton(
161+
'Charge Card', () => _startAfreshCharge()),
162+
_verticalSizeBox,
163+
_border,
164+
new SizedBox(
165+
height: 40.0,
166+
),
167+
new Row(
168+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
169+
crossAxisAlignment: CrossAxisAlignment.center,
170+
children: <Widget>[
171+
new Flexible(
172+
flex: 3,
173+
child: new DropdownButtonHideUnderline(
174+
child: new InputDecorator(
175+
decoration: const InputDecoration(
176+
border: OutlineInputBorder(),
177+
isDense: true,
178+
hintText: 'Checkout method',
179+
),
180+
isEmpty: _method == null,
181+
child: new DropdownButton<CheckoutMethod>(
182+
value: _method,
183+
isDense: true,
184+
onChanged: (CheckoutMethod value) {
185+
setState(() {
186+
_method = value;
187+
});
188+
},
189+
items: banks.map((String value) {
190+
return new DropdownMenuItem<
191+
CheckoutMethod>(
192+
value: _parseStringToMethod(value),
193+
child: new Text(value),
194+
);
195+
}).toList(),
196+
),
197+
))),
198+
_horizontalSizeBox,
199+
new Flexible(
200+
flex: 2,
201+
child: new Container(
202+
width: double.infinity,
203+
child: _getPlatformButton(
204+
'Checkout',
205+
() => _handleCheckout(),
206+
)),
207+
),
208+
],
209+
)
210+
],
211+
)
212212
],
213213
),
214214
),
@@ -242,11 +242,8 @@ class _HomePageState extends State<HomePage> {
242242
}
243243
}
244244

245-
CheckoutResponse response = await PaystackPlugin.checkout(
246-
context,
247-
method: _method,
248-
charge: charge,
249-
);
245+
CheckoutResponse response = await PaystackPlugin.checkout(context,
246+
method: _method, charge: charge, fullscreen: false);
250247
print('Response = $response');
251248
setState(() => _inProgress = false);
252249
_updateStatus(response.reference, '$response');
@@ -399,7 +396,7 @@ class _HomePageState extends State<HomePage> {
399396
_updateStatus(
400397
reference,
401398
'There was a problem getting a new access code form'
402-
' the backend: $e');
399+
' the backend: $e');
403400
}
404401
return accessCode;
405402
}
@@ -415,7 +412,7 @@ class _HomePageState extends State<HomePage> {
415412
_updateStatus(
416413
reference,
417414
'There was a problem verifying %s on the backend: '
418-
'$reference $e');
415+
'$reference $e');
419416
}
420417
setState(() => _inProgress = false);
421418
}

0 commit comments

Comments
 (0)