chewie icon indicating copy to clipboard operation
chewie copied to clipboard

Blur effect on cupertino controlls if GoogleMap is used

Open eligijusbernotas opened this issue 6 years ago • 2 comments

There's a weird interaction between this widget and the official flutter google maps .

Whenever the both widgets are in view the cupertino controls applies its backdrop filter .

I'm guessing this is the culprit, since if I remove sigmaX and sigmaY, the blur effect dissapears.

BackdropFilter(
            filter: ui.ImageFilter.blur(
              sigmaX: 10.0,
              sigmaY: 10.0,
            ),

(line 132 in lib/src/cupertino_controls.dart)

I'm not sure if this is even in the scope of this package and maybe this should be posted in flutter's github, I'll include a sample code below the screenshot.

Screen Shot 2020-06-29 at 17 30 03

import 'dart:async';

import 'package:chewie/chewie.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:video_player/video_player.dart';

class Test extends StatefulWidget {
  @override
  _TestState createState() => _TestState();
}

class _TestState extends State<Test> {
  VideoPlayerController _videoPlayerController;
  ChewieController _chewieController;
  final Completer<GoogleMapController> _controller = Completer();

  @override
  void initState() {
    _videoPlayerController =
        VideoPlayerController.network('http://www.quintic.com/software/sample_videos/Football_Kick_Zoom.avi');

    _chewieController = ChewieController(
      videoPlayerController: _videoPlayerController,
      aspectRatio: 16 / 9,
      autoInitialize: true,
      deviceOrientationsAfterFullScreen: [DeviceOrientation.portraitUp],
    );

    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Material(
      color: Colors.white,
      child: ListView(
        children: [
          SizedBox(
            height: 500,
          ),
          Chewie(
            controller: _chewieController,
          ),
          Container(
            height: 400,
            child: GoogleMap(
              onMapCreated: (GoogleMapController controller) {
                _controller.complete(controller);
              },
              initialCameraPosition: CameraPosition(
                zoom: 2.0,
                target: LatLng(35, 45),
              ),
            ),
          )
        ],
      ),
    );
  }
}

eligijusbernotas avatar Jun 29 '20 14:06 eligijusbernotas

Hi there!

I have the same issue, but when using the another video plugin at the same level in the widget tree (in this case youtube_player_flutter).

rjgpereira avatar Jun 30 '20 14:06 rjgpereira

I have the same thing when I have chewie video and flutter_cast_button in the same screen.

https://pub.dev/packages/flutter_video_cast

yelkamel avatar Jun 22 '21 10:06 yelkamel