Skip to content

Instantly share code, notes, and snippets.

@fredgrott
Created May 24, 2025 23:04
Show Gist options
  • Save fredgrott/7b5dc5923e94c1e73f153424516eddee to your computer and use it in GitHub Desktop.
Save fredgrott/7b5dc5923e94c1e73f153424516eddee to your computer and use it in GitHub Desktop.
canonical layout models
// Copyright 2025 Fredrick Allan Grott. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
/// StartEndPaneEnum as we need in the FlexContentPane to
/// know whether its a start or end pane per from the parent
/// CustomTwoPane layout.
///
/// @author Fredrick Allan Grott
enum StartEndPaneEnum {
end,
start,
}
/// In our FlexPaneModel we have to initialize
/// the variables. They will be reset in the
/// CustomTwoPane layout.
///
/// @author Fredrick Allan Grott
class FlexPaneModel with ChangeNotifier {
Axis _appDirection = Axis.vertical;
Rect _appSeamRect = const Offset(1.0, 2.0) & const Size(3.0, 4.0);
Axis get appDirection => _appDirection;
Rect get appSeamRect => _appSeamRect;
set appDirection(Axis value) {
_appDirection = value;
notifyListeners();
}
set appSeamRect(Rect value) {
_appSeamRect = value;
notifyListeners();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment