flutter paypal via webview

I am trying to integrate paypal payment for my flutter app via a webview.

return new MaterialApp(
routes: {
"/": (_) => new WebviewScaffold(
url: "https://www.paypal.com/cgi-bin/webscr? business=xxxx.com&cmd=_xclick&item_name=Hot+Sauce-12oz.+Bottle&amount=5.95&currency_code=USD",
appBar: new AppBar(
title: new Text(
"Payment",
),
),
)
},
);


when i run the page, the app closes unexpectedly with the error message

Unsupported value: <FlutterError: 0x1c422d200> of type FlutterError
Lost connection to device.

This is my flutter doctor.

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.13.1 17B1003, locale en-HK)
[✓] Android toolchain - develop for Android devices (Android SDK 26.0.2)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
[✓] Android Studio (version 3.1)
[✓] Connected devices (3 available)


You forget the initialRoute Parameter in the MaterialApp
the right way to do this is :

return new MaterialApp(
initialRoute: '/',
routes: {
"/": (_) => new WebviewScaffold(
url: "https://www.paypal.com/",
appBar: new AppBar(
title: new Text(
"Payment",
),
),
)
},
);

Comments

Popular posts from this blog

Meaning of `{}` for return expression

Get current scroll position of ScrollView in React Native

flutter websocket connection issue