resizable_widget 1.0.5 copy "resizable_widget: ^1.0.5" to clipboard
resizable_widget: ^1.0.5 copied to clipboard

Enables users to resize the internal widgets by dragging. This package contains simple APIs, but if needed, you can customize ResizableWidget flexibly.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:resizable_widget/resizable_widget.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: 'Resizable Widget Example',
      theme: ThemeData.dark(),
      home: const MyPage(),
    );
  }
}

class MyPage extends StatelessWidget {
  const MyPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Resizable Widget Example'),
      ),
      body: ResizableWidget(
        isHorizontalSeparator: false,
        isDisabledSmartHide: false,
        separatorColor: Colors.white12,
        separatorSize: 4,
        onResized: _printResizeInfo,
        children: [
          Container(color: Colors.greenAccent),
          ResizableWidget(
            isHorizontalSeparator: true,
            separatorColor: Colors.blue,
            separatorSize: 10,
            children: [
              Container(color: Colors.greenAccent),
              ResizableWidget(
                children: [
                  Container(color: Colors.greenAccent),
                  Container(color: Colors.yellowAccent),
                  Container(color: Colors.redAccent),
                ],
                percentages: const [0.2, 0.5, 0.3],
              ),
              Container(color: Colors.redAccent),
            ],
          ),
          Container(color: Colors.redAccent),
        ],
      ),
    );
  }

  void _printResizeInfo(List<WidgetSizeInfo> dataList) {
    // ignore: avoid_print
    print(dataList.map((x) => '(${x.size}, ${x.percentage}%)').join(", "));
  }
}
170
likes
150
points
195k
downloads

Publisher

verified publisheribako-piyo.com

Weekly Downloads

Enables users to resize the internal widgets by dragging. This package contains simple APIs, but if needed, you can customize ResizableWidget flexibly.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on resizable_widget