caduandrade / multi_split_view

Provides horizontal or vertical multiple split view for Flutter.
MIT License
152 stars 29 forks source link

Does this work in release mode? #49

Closed cybertheory closed 8 months ago

cybertheory commented 8 months ago

Release image debug mode works fine image

import 'package:flutter/material.dart';
import 'package:flutter_layout_grid/flutter_layout_grid.dart';
import 'package:multi_split_view/multi_split_view.dart';
import 'package:pagefelt_mvp/components/block.dart';

class Document extends StatefulWidget {
  const Document({super.key});

  @override
  State<Document> createState() => _DocumentState();
}

// List<Widget> _tiles;
@override
void initState() {}

// GlobalKey<State<SpannableGrid>> _grid = GlobalKey();

class _DocumentState extends State<Document> {
  @override
  Widget build(BuildContext context) {
    return Container(
      height: MediaQuery.of(context).size.height,
      width: MediaQuery.of(context).size.width,
      child: Column(
        children: [
          Expanded(
            flex: 1,
            child: Row(
              children: [
                Expanded(
                    child: Container(
                  margin: EdgeInsets.only(left: 60),
                  decoration: BoxDecoration(
                    color: Color(0xffD9D9D9),
                    borderRadius: BorderRadius.only(
                        topLeft: Radius.circular(10),
                        topRight: Radius.circular(10),
                        bottomLeft: Radius.circular(10),
                        bottomRight: Radius.circular(10)),
                  ),
                ))
              ],
            ),
          ),
          Expanded(
            flex: 3,
            child: Container(
              padding: EdgeInsets.fromLTRB(50, 0, 50, 50),
              child: Expanded(
                child: Column(
                  children: [
                    Expanded(
                      flex: 2,
                      child: Row(
                        children: [
                          Container(
                            padding: EdgeInsets.all(10),
                            child: FittedBox(
                              fit: BoxFit.contain,
                              child: Text(
                                "Tiffany's Workspace",
                                style: TextStyle(
                                    fontSize: 30, fontWeight: FontWeight.bold),
                              ),
                            ),
                          )
                        ],
                      ),
                    ),
                    Expanded(
                      flex: 20,
                      child: Row(
                        children: [
                          Expanded(
                            child: MultiSplitView(
                              children: [
                                MultiSplitView(
                                    // percentages: [0.5, 0.5],
                                    axis: Axis.vertical,
                                    children: [
                                      MultiSplitView(
                                          // percentages: [0.5, 0.5],
                                          axis: Axis.horizontal,
                                          children: [BaseBlock(), BaseBlock()]),
                                      BaseBlock()
                                    ]),
                                MultiSplitView(
                                    // percentages: [0.5, 0.5],
                                    axis: Axis.vertical,
                                    children: [
                                      MultiSplitView(
                                          // percentages: [0.5, 0.5],
                                          axis: Axis.horizontal,
                                          children: [BaseBlock(), BaseBlock()]),
                                      BaseBlock()
                                    ])
                                // required
                              ],
                              axis: Axis.horizontal,
                            ),
                          ),
                        ],
                      ),
                    ),
                  ],
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
cybertheory commented 8 months ago

I had the same exact issue with https://pub.dev/packages/resizable_widget

cybertheory commented 8 months ago

Make sure to use expanded widgets correctly 👀

https://api.flutter.dev/flutter/widgets/Expanded-class.html Expanded class - widgets library - Dart API - Flutter: A widget that expands a child of a Row, Column, or Flex so that the child fills the available...