Esempio n. 1
0
 public DividerTheme(
     Key key = null,
     DividerThemeData data = null,
     Widget child          = null
     ) : base(key: key, child: child)
 {
     D.assert(data != null);
     this.data = data;
 }
Esempio n. 2
0
        public override Widget build(BuildContext context)
        {
            DividerThemeData dividerTheme = DividerTheme.of(context);
            float            height       = this.height ?? dividerTheme?.space ?? 16.0f;
            float            thickness    = this.thickness ?? dividerTheme?.thickness ?? 0.0f;
            float            indent       = this.indent ?? dividerTheme?.indent ?? 0.0f;
            float            endIndent    = this.endIndent ?? dividerTheme?.endIndent ?? 0.0f;

            return(new SizedBox(
                       height: height,
                       child: new Center(
                           child: new Container(
                               height: thickness,
                               //TODO: update to EdgeInsetsGeometry
                               margin: EdgeInsetsDirectional.only(start: indent,
                                                                  end: endIndent),
                               decoration: new BoxDecoration(
                                   border: new Border(
                                       bottom: createBorderSide(context, color: color, width: thickness))
                                   )
                               )
                           )
                       ));
        }
Esempio n. 3
0
        public override Widget build(BuildContext context)
        {
            DividerThemeData dividerTheme = DividerTheme.of(context);
            float            width        = this.width ?? dividerTheme.space ?? 16.0f;
            float            thickness    = this.thickness ?? dividerTheme.thickness ?? 0.0f;
            float            indent       = this.indent ?? dividerTheme.indent ?? 0.0f;
            float            endIndent    = this.endIndent ?? dividerTheme.endIndent ?? 0.0f;

            return(new SizedBox(
                       width: width,
                       child: new Center(
                           child: new Container(
                               width: thickness,
                               margin: EdgeInsetsDirectional.only(top: indent,
                                                                  bottom: endIndent),
                               decoration: new BoxDecoration(
                                   border: new Border(
                                       left: Divider.createBorderSide(context, color: color, width: thickness)
                                       )
                                   )
                               )
                           )
                       ));
        }