loplat_plengi 1.2.8-dev.1
loplat_plengi: ^1.2.8-dev.1 copied to clipboard
loplat plengi(Place Engine) SDK plugin project.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:flutter_custom_tabs/flutter_custom_tabs.dart';
import 'package:in_app_review/in_app_review.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () async {
try {
final InAppReview inAppReview = InAppReview.instance;
if (await inAppReview.isAvailable()) {
await inAppReview.requestReview();
}
} catch (e) {
print(e);
}
},
child: Text('Request Review'),
),
SizedBox(height: 24),
GestureDetector(
onTap: () async {
await openUrlWithSheetSystemBrowser(
url: 'https://www.google.com',
context: context,
);
},
child: Text('Open URL'),
),
],
),
),
),
);
}
}
Future<void> openUrlWithSheetSystemBrowser({
required String url,
required BuildContext context,
}) async {
launchUrl(
Uri.parse(url),
customTabsOptions: CustomTabsOptions.partial(
configuration: PartialCustomTabsConfiguration(
initialHeight: MediaQuery.of(context).size.height * 1,
),
),
safariVCOptions: const SafariViewControllerOptions.pageSheet(
configuration: SheetPresentationControllerConfiguration(
detents: {SheetPresentationControllerDetent.large},
prefersScrollingExpandsWhenScrolledToEdge: true,
),
),
);
return;
}