android_web_view_check 1.0.4+5 copy "android_web_view_check: ^1.0.4+5" to clipboard
android_web_view_check: ^1.0.4+5 copied to clipboard

Provides version upgrade due to webview call error when using webview in Android

example/lib/main.dart

import 'package:android_web_view_check/android_web_view_check.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter web_view_check',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter web_view_check'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final int _counter = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: checkDevice,
        child: const Icon(Icons.check),
      ),
    );
  }

  void checkDevice() async {
    Map map = await AndroidWebViewCheck().deviceCheck();
    print(map);
    // 디바이스 WebView 버전을 판단해 90이하면 업데이트 스토어 이동 (90 이하면 웹뷰호출이 안됨)
    if (map[1] < 90) {
      AndroidWebViewCheck().updateWebView();
    }
  }
}
1
likes
0
points
11
downloads

Publisher

unverified uploader

Weekly Downloads

Provides version upgrade due to webview call error when using webview in Android

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

cupertino_icons, device_info_plus, flutter, url_launcher

More

Packages that depend on android_web_view_check