Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add divider (end)indent #24

Merged
merged 9 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.5.0

- Adds `dividerIndent` and `dividerEndIndent` properties to the resizable container

## 0.4.2

- Fixes an issue with the `didUpdateWidget` lifecycle hook causing errors to be thrown during hot-reloads
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

* Nest as many `ResizableContainer`s as you want
* Configure each child's initial size, minimum size, and/or maximum size
* Customize the width and color of the divider(s) between children
* Customize the width, color, and indentation of the divider(s) between children
* Programmatically change the ratios of the children at any time

## Getting started
Expand All @@ -19,13 +19,15 @@ flutter pub add flutter_resizable_container

First, add a `ResizableContainer` to your widget tree and give it a `direction` of type `Axis`: this is the direction in which the child objects will be laid out and the direction in which the children's size will be allowed to flex.

You can also provide a `dividerWidth` and/or `dividerColor` to customize the appearance of the dividers between children.
You can also provide a `dividerWidth`, `dividerIndent`, `dividerEndIntent`, and/or `dividerColor` to customize the appearance of the dividers between children.

```dart
ResizableContainer(
direction: Axis.horizontal,
dividerWidth: 5,
dividerColor: Colors.blue,
dividerIndent: 5,
dividerEndIndent: 5,
children: [
// ...
],
Expand Down Expand Up @@ -139,7 +141,7 @@ void dispose() {

## License

Copyright 2023 Andrew Horn
Copyright 2023-2024 Andrew Horn

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
2 changes: 1 addition & 1 deletion example/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ migration:
- platform: root
create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
- platform: windows
- platform: macos
create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d

Expand Down
8 changes: 6 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ class _ExampleAppState extends State<ExampleApp> {
builder: (context) => FloatingActionButton(
child: const Icon(Icons.info),
onPressed: () {
final message = "Ratios: ${controller1.ratios.join(', ')} and ${controller2.ratios.join(', ')}";
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(message)));
final message =
"Ratios: ${controller1.ratios.join(', ')} and ${controller2.ratios.join(', ')}";
ScaffoldMessenger.of(context)
.showSnackBar(SnackBar(content: Text(message)));
},
),
),
Expand All @@ -74,6 +76,8 @@ class _ExampleAppState extends State<ExampleApp> {
direction: direction,
dividerWidth: 3.0,
dividerColor: Colors.blue,
dividerIndent: 12,
dividerEndIndent: 12,
children: [
ResizableChildData(
startingRatio: ratio1,
Expand Down
7 changes: 7 additions & 0 deletions example/macos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Flutter-related
**/Flutter/ephemeral/
**/Pods/

# Xcode-related
**/dgph
**/xcuserdata/
1 change: 1 addition & 0 deletions example/macos/Flutter/Flutter-Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "ephemeral/Flutter-Generated.xcconfig"
1 change: 1 addition & 0 deletions example/macos/Flutter/Flutter-Release.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "ephemeral/Flutter-Generated.xcconfig"
10 changes: 10 additions & 0 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// Generated file. Do not edit.
//

import FlutterMacOS
import Foundation


func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
}
Loading
Loading