frankenstein 1.0.1 copy "frankenstein: ^1.0.1" to clipboard
frankenstein: ^1.0.1 copied to clipboard

outdated

One Widget to rule most of them

Frankenstein #

A straight forward approach to combining commonly used Flutter UI elements into a single implementation.

Contents #

Features #

Here is a list of some of the coolest features of the plugin:

  • ✅ SizedBox
  • ✅ GestureDetector
  • ✅ Padding
  • ✅ Expanded
  • ✅ DecoratedBox
  • ✅ SingleChildScrollView
  • ✅ GestureDetector
  • ✅ GestureDetector
  • ...

Getting Started #

The Frankenstein plugin currently ships with a single widget named 'ZZ' which enables all of the feature capabilities.

Usage is as simple as specifying the properties you want the child to be contained in.

ZZ(
  flex: 0,
  padding: const EdgeInsets.all(20.0),
  canScroll: true,
  decoration: BoxDecoration(
    borderRadius: BorderRadius.circular(4.0),
    border: Border.all(),
  ),
  onTap: () {
    // Tap handler
  },
  child: const Center(
    child: Text(
      'Hello!',
      style: TextStyle(color: Colors.red),
    ),
  ),
),

Usage #

final Widget child; final void Function()? onTap; final EdgeInsets? padding; final Decoration? decoration; final double? height; final double? width; final int? flex; final bool? canScroll;

Here the list of available arguments

Argument Widget Description
child see Widget The Widget to be wrapped
onTap see GestureDetector Gesture Detection for the Widget
padding see Padding Encapsulate the Widget with Padding
decoration see DecoratedBox Provide Decoration around Widget
height1 see SizedBox Set a height for your Widget
width1 see SizedBox Set a width for your Widget
flex1 see Expanded Set the flex value of your Widget
canScroll see SingleChildScrollView Enable scrolling for your Widget

1 : These properties are mutually exclusive. If both flex and width/height are specified, only flex will be used.

License #

Copyright (c) 2021-2022 Michael Wrock. Licensed under the BSD License (BSD)

Credits #

Built with Nx and NxRocks.