Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/helightdev/stitched_stack

A flutter library providing a way to stich a size-bound stack onto a widget
https://github.com/helightdev/stitched_stack

Last synced: about 1 month ago
JSON representation

A flutter library providing a way to stich a size-bound stack onto a widget

Awesome Lists containing this project

README

        




Stitched_Stack Logo


stitched_stack



A flutter library providing a way to stich a size-bound stack onto a widget.

## Features
This library exposes the `StitchedStack` widget, than can be used to
stitch a stack onto a widget. The stacks size will be coupled to the
size of the stitched widget, which (mostly) behaves exactly like it would
without the stack overlaying/underlaying it.

The stitched stack will by default automatically update its size if the
child grows or shrinks. This behaviour can be disabled by setting the
`manual` property. The stitched stack will also respond to layout changes
and rebuild completely. This behaviour can be disabled by providing fixed
`constraints`.

## Example

This simple example shows how to create a `TextField` with a stitched widget
in the bottom-right corner. The `Container` will stay stitched at the corner,
even if the `TextField` grows.

```dart
import 'package:flutter/material.dart';
import 'package:stitched_stack/stitched_stack.dart';

class MyWidget extends StatelessWidget {

TextEditingController fieldController = TextEditingController();

@override
Widget build(BuildContext context) {
return StitchedStack(
stitch: TextField(controller: fieldController, maxLines: 99, minLines: 1),
children: [
Positioned(bottom: 0, right: 0, child: Container(color: Colors.red, width: 50, height: 50))
],
);
}
}
```

![Screenshot](https://github.com/helightdev/helightdev/raw/main/Screenshot%202022-09-05%20034350.gif)