browser_plugin 0.1.0
browser_plugin: ^0.1.0 copied to clipboard
A new Flutter plugin to open webview in a New Activity
import 'package:browser_plugin/browser_plugin.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final String _platformVersion = 'Unknown';
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
floatingActionButton: FloatingActionButton(onPressed: () {
BrowserPlugin paymentBrowser = BrowserPlugin(
onUrlChange: (url){
},
onFinishCallback: () {},
url: "https://www.google.com/",
webViewCloseUrl:
"https://confirm-payment/");
paymentBrowser.open();
}),
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Text('Running on: $_platformVersion\n'),
),
),
);
}
}