Git Product home page Git Product logo

app_base_kit's People

Contributors

andyduke avatar

Watchers

 avatar  avatar

app_base_kit's Issues

Add widgets to debug layout

Add a DebugBox widget that wraps its child in a DecoratedBox.

Make two constructors:

  • DebugBox.border([Color color = Colors.red]) - draws a border around the widget
  • DebugBox([Color color = Colors.red.withOpacity(0.3)]) - draws the background under the widget

bool showSize constructor parameter - draws over the child its size.

Generic controls

  • Dropdown
  • Button
  • Input field (focused UI, etc.)
  • Label (with theme)
  • Labeled control (with theme)

Add a ValueProperty, similar to StateProperty, but with single value resolution

abstract class ValueProperty<T, S> {
  /// Returns a value of type `T` that depends on [value].
  T resolve(S value);

  /// Linearly interpolate between two `S`.
  static P? lerp<P extends ValueProperty<T, S>, T, S>(
    P? a,
    P? b,
    double t,
    T? Function(T?, T?, double) lerpFunction,
  ) {
    // Avoid creating a _ValueLerpProperties object for a common case.
    if (a == null && b == null) {
      return null;
    }
    return _ValueLerpProperties<P, T, S>(a, b, t, lerpFunction) as P;
  }
}

class _ValueLerpProperties<P extends ValueProperty<T, S>, T, S> implements ValueProperty<T?, S> {
  const _ValueLerpProperties(this.a, this.b, this.t, this.lerpFunction);

  final P? a;
  final P? b;
  final double t;
  final T? Function(T?, T?, double) lerpFunction;

  @override
  T? resolve(S value) {
    final T? resolvedA = a?.resolve(value);
    final T? resolvedB = b?.resolve(value);
    return lerpFunction(resolvedA, resolvedB, t);
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.