import 'dart:math'; import 'package:flutter/material.dart'; class GestureWidget extends StatefulWidget { @override _GestureWidgetState createState() => _GestureWidgetState(); } class _GestureWidgetState extends State { double _scale = 1.0; Offset _offset = Offset.zero; double _rotation = 0.0; // Initialize rotation to 0 @override Widget build(BuildContext context) { return GestureDetector( onScaleStart: (details) { if (details.pointerCount == 1) { // Tek parmakla rotate başlangıcı print('Rotate start'); } else { // Çift parmakla pan ve zoom başlangıcı print('Pan and Zoom start'); } }, onScaleUpdate: (details) { if (details.pointerCount == 1) { // Tek parmakla rotate işlemi setState(() { _rotation += _rotation + details.rotation; // Accumulate rotation // Burada rotate eventını işleyebilirsiniz print('Rotate: $_rotation'); }); } else { // Çift parmakla pan ve zoom işlemi setState(() { _scale = details.scale; _offset += details.focalPoint - details.localFocalPoint; // Burada pan ve zoom eventlarını işleyebilirsiniz print('Scale: $_scale, Offset: $_offset'); }); } }, child: Transform.rotate( // Apply rotation to the child angle: _rotation, child: Container( width: 200, height: 200, color: Colors.blue, child: Center( child: Text('Transform Me!'), ), ), ), ); } }