resizable_draggable_widget 0.0.5 copy "resizable_draggable_widget: ^0.0.5" to clipboard
resizable_draggable_widget: ^0.0.5 copied to clipboard

一个可拖拽来操作大小和位置的控件.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:resize_drag_widget/resizable_draggable_widget.dart';
import 'package:flutter/foundation.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'resize_drag_widget Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'resize_drag_widget Page'),
    );
  }
}

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

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
        ),
        body: Container(
          child: ResizableDraggableWidget(
            initHeight: 300,
            initWidth: 300,
            showSquare: true,
            draggable: true,
            bgColor: Colors.blueAccent,
            squareColor: Colors.white,
            changed: (width, height, tranformOffset) {
              print(
                  "width: $width, height: $height, tranformOffset: $tranformOffset");
            },
            child: Image.network(
                "https://t7.baidu.com/it/u=4198287529,2774471735&fm=193&f=GIF"),
          ),
        ));
  }
}
10
likes
110
pub points
65%
popularity

Publisher

unverified uploader

一个可拖拽来操作大小和位置的控件.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface

More

Packages that depend on resizable_draggable_widget