gradient-borders icon indicating copy to clipboard operation
gradient-borders copied to clipboard

Add option to GradientOutlineInputBorder borderAlignment

Open AErmek opened this issue 1 year ago • 4 comments

Feature #5

AErmek avatar Jul 24 '24 16:07 AErmek

@obiwanzenobi

AErmek avatar Jul 29 '24 11:07 AErmek

@AErmek It looks like Im not able to run your code. Can you use this instead?

    final paint = _getPaint(rect);
    final outer = borderRadius.toRRect(rect);

    double centerOffset;
    switch (borderAlignment) {
      case OutlineBorderAlignment.onEdge:
        centerOffset = borderSide.width;
        break;
      case OutlineBorderAlignment.inside:
        centerOffset = width;
        break;
    }

    final center = outer.deflate(centerOffset / 2.0);

tananga avatar May 12 '25 10:05 tananga

it does not compile for me either - @Tananga could you expose pr with these changes?

btw. isn't there a way to obtain alignment from box border parent?

obiwanzenobi avatar Aug 31 '25 09:08 obiwanzenobi

@Tananga @obiwanzenobi Hi! I’ve updated the PR and changed the code as you suggested. The new switch statement usage was the issue, right?

AErmek avatar Aug 31 '25 12:08 AErmek