|
- import 'dart:typed_data';
-
- import 'package:chat/map/location_result.dart';
- import 'package:chat/utils/screen.dart';
- import 'package:flutter/services.dart';
- import 'package:flutter_image_compress/flutter_image_compress.dart';
-
- class ScreenShot {
- static const MethodChannel _channel =
- const MethodChannel('make.photo.screen.hibok');
-
- static Future<List<int>> takeScreenshotImage() async {
- Map<String, dynamic> args = <String, dynamic>{};
- Uint8List bytes = await _channel.invokeMethod('makePhotoScreen', args);
-
- var compressImg = await FlutterImageCompress.compressWithList(bytes,
- quality: 20, minWidth: (Screen.width).toInt());
-
- print('地图大小${bytes.length}');
- return compressImg;
- }
-
- static Future<List> getOtherMapAppList() async {
- Map<String, dynamic> args = <String, dynamic>{};
- return _channel.invokeMethod('getListForMap', args);
- }
-
- static void openMapForOth(String mapType, LocationResult result) async {
- Map<String, dynamic> args = <String, dynamic>{
- 'mapType': mapType,
- 'address': result.address,
- 'latLng': [result.latLng.latitude, result.latLng.longitude]
- };
- _channel.invokeMethod('openMapForOth', args);
- }
-
- static Future<bool> isSupportGoogle() async {
- Map<String, dynamic> args = <String, dynamic>{};
- return _channel.invokeMethod('isSupportGoogle', args);
- }
- }
|