loplat_plengi 1.2.7-dev.1 copy "loplat_plengi: ^1.2.7-dev.1" to clipboard
loplat_plengi: ^1.2.7-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;
}
3
likes
0
points
330
downloads

Publisher

unverified uploader

Weekly Downloads

loplat plengi(Place Engine) SDK plugin project.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on loplat_plengi

Packages that implement loplat_plengi