You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there are two photo views in a stack and using a single controller, the first photo view's setting enableRotation and enablePanAlways would lose efficacy.
To Reproduce
import 'package:flutter/material.dart';
import 'package:photo_view/photo_view.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
late PhotoViewControllerBase controller;
late PhotoViewScaleStateController scaleStateController;
int calls = 0;
@override
void initState() {
super.initState();
controller = PhotoViewController()
..outputStateStream.listen(onController);
}
void onController(PhotoViewControllerValue value) {
setState(() {
calls += 1;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child: Stack(
alignment: AlignmentDirectional.center,
children: <Widget>[
PhotoView(
controller: controller,
backgroundDecoration: BoxDecoration(color: Colors.transparent),
imageProvider: AssetImage('assets/images/cross_star_full.png'),
//initialScale: defScale,
enableRotation: false,
enablePanAlways: true,
),
PhotoView(
controller: controller,
backgroundDecoration: BoxDecoration(color: Colors.transparent),
imageProvider: AssetImage('assets/images/compass_red.png'),
//initialScale: defScale,
enableRotation: true,
enablePanAlways: true,
),
],
)
),
);
}
}
What is the current behavior?
Yes, when I update the flutter to 2.10 and met this issue.
Expected behavior
The first widget should not be rotated.
Screenshots
Which versions of Flutter/Photo View, and which browser / OS are affected by this issue? Did this work in previous versions of Photo View?
flutter version is Flutter 2.10.4
Photo View is photo_view: ^0.13.0
The text was updated successfully, but these errors were encountered:
Describe the bug
If there are two photo views in a stack and using a single controller, the first photo view's setting enableRotation and enablePanAlways would lose efficacy.
To Reproduce
What is the current behavior?
Yes, when I update the flutter to 2.10 and met this issue.
Expected behavior
The first widget should not be rotated.
Screenshots
Which versions of Flutter/Photo View, and which browser / OS are affected by this issue? Did this work in previous versions of Photo View?
flutter version is Flutter 2.10.4
Photo View is photo_view: ^0.13.0
The text was updated successfully, but these errors were encountered: