Skip to content

Instantly share code, notes, and snippets.

@Jatra
Last active February 4, 2019 07:40
Show Gist options
  • Select an option

  • Save Jatra/28a81071b916bec6ee28ad30eda2b840 to your computer and use it in GitHub Desktop.

Select an option

Save Jatra/28a81071b916bec6ee28ad30eda2b840 to your computer and use it in GitHub Desktop.
Initial Colour slider build
class ColourSlider extends StatefulWidget {
static final track = "track";
static final thumb = "thumb";
@override
_ColourSliderState createState() => _ColourSliderState();
}
class _ColourSliderState extends State<ColourSlider> {
@override
Widget build(BuildContext context) {
return Container(
width: 300,
height: 50,
child: CustomMultiChildLayout(
delegate: _ColourSliderDelegate(),
children: <Widget>[
LayoutId(
id: ColourSlider.track,
child: Container(
width: 300,
height: 20,
color: Colors.white,
),
),
LayoutId(
id: ColourSlider.thumb,
child: Container(
width: 50,
height: 50,
color: Colors.red,
),
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment