This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Rounded border on some sides of a widget is tricky to achieve since Flutter's [BorderRadius] and [Border] don't | |
/// work together when the border is "not" on all sides. | |
/// | |
/// The initial logic was found here: https://stackoverflow.com/a/61613471/5066615. | |
/// | |
/// The way it's done here is to wrap the [child] in 2 [Container] widgets: | |
/// The outer [Container] has its background color set to [borderColor] i.e. what we want the border color to be. | |
/// The inner [Container] has its background color set to the background color of the widget behind the [child] so | |
/// that it appears to just have a border of [borderColor]. | |
/// The inner [Container] also has a margin that is the same size as the [borderWidth]. |