Ejemplo n.º 1
0
 public override Widget build(BuildContext context)
 {
     return(new Align(
                alignment: Alignment.bottomCenter,
                heightFactor: 1.0f,
                child: new Container(
                    margin: EdgeInsets.only(
                        bottom: new FloatTween(
                            begin: 2.0f,
                            end: BottomNavigationBarUtils._kBottomMargin
                            ).evaluate(this.animation)
                        ),
                    child: new FadeTransition(
                        opacity: this.animation,
                        child: DefaultTextStyle.merge(
                            style: new TextStyle(
                                fontSize: BottomNavigationBarUtils._kActiveFontSize,
                                color: Colors.white
                                ),
                            child: this.item.title
                            )
                        )
                    )
                ));
 }
Ejemplo n.º 2
0
        public static void Sample(this IPointContext ctx)
        {
            var p = ((PointContext)ctx).P;

            var slideMasterIdList1 = new SlideMasterIdList(new SlideMasterId {
                Id = 2147483648U, RelationshipId = "rId1"
            });
            var slideIdList1 = new SlideIdList(new SlideId {
                Id = 256U, RelationshipId = "rId2"
            });
            var slideSize1 = new SlideSize {
                Cx = 9144000, Cy = 6858000, Type = SlideSizeValues.Screen4x3
            };
            var notesSize1 = new NotesSize {
                Cx = 6858000, Cy = 9144000
            };
            var defaultTextStyle1 = new DefaultTextStyle();

            p.Presentation.Append(slideMasterIdList1, slideIdList1, slideSize1, notesSize1, defaultTextStyle1);

            var slidePart1       = CreateSlidePart(p);
            var slideLayoutPart1 = CreateSlideLayoutPart(slidePart1);
            var slideMasterPart1 = CreateSlideMasterPart(slideLayoutPart1);
            var themePart1       = CreateTheme(slideMasterPart1);

            slideMasterPart1.AddPart(slideLayoutPart1, "rId1");
            p.AddPart(slideMasterPart1, "rId1");
            p.AddPart(themePart1, "rId5");
        }
Ejemplo n.º 3
0
        public override Widget build(BuildContext context)
        {
            float t = new FloatTween(
                begin: BottomNavigationBarUtils._kInactiveFontSize / BottomNavigationBarUtils._kActiveFontSize,
                end: 1.0f
                ).evaluate(this.animation);

            return(new Align(
                       alignment: Alignment.bottomCenter,
                       heightFactor: 1.0f,
                       child: new Container(
                           margin: EdgeInsets.only(bottom: BottomNavigationBarUtils._kBottomMargin),
                           child: DefaultTextStyle.merge(
                               style: new TextStyle(
                                   fontSize: BottomNavigationBarUtils._kActiveFontSize,
                                   color: this.colorTween.evaluate(this.animation)
                                   ),
                               child: new Transform(
                                   transform: Matrix3.makeScale(t),
                                   alignment: Alignment.bottomCenter,
                                   child: this.item.title
                                   )
                               )
                           )
                       ));
        }
Ejemplo n.º 4
0
        Widget _buildFixedLabel()
        {
            float t = new FloatTween(
                begin: BottomNavigationBarUtils._kInactiveFontSize / BottomNavigationBarUtils._kActiveFontSize,
                end: 1.0f
                ).evaluate(this.animation);

            return(new Align(
                       alignment: Alignment.bottomCenter,
                       heightFactor: 1.0f,
                       child: new Container(
                           margin: EdgeInsets.only(bottom: BottomNavigationBarUtils._kBottomMargin),
                           child: DefaultTextStyle.merge(
                               style: new TextStyle(
                                   fontSize: BottomNavigationBarUtils._kActiveFontSize,
                                   color: this.colorTween.evaluate(this.animation)
                                   ),
//                        child: new Transform(
//                            transform: Matrix3.makeAll(t, 0, 0, 0, t, 0, 0, 0, t),
//                            alignment: Alignment.bottomCenter,
//                            child: this.item.title
//                        )
                               child: this.item.title
                               )
                           )
                       ));
        }
 Widget _createContainer(List <Widget> tiles)
 {
     return(DefaultTextStyle.merge(
                overflow: TextOverflow.ellipsis,
                child: new Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: tiles
                    )
                ));
 }
Ejemplo n.º 6
0
        private static void CreatePresentationParts(PresentationPart presentationPart)
        {
            SlideMasterIdList slideMasterIdList1 = new SlideMasterIdList(new SlideMasterId()
            {
                Id = (UInt32Value)2147483648U, RelationshipId = "rId1"
            });
            SlideIdList slideIdList1 = new SlideIdList(new SlideId()
            {
                Id = (UInt32Value)256U, RelationshipId = "rId2"
            });
            SlideSize slideSize1 = new SlideSize()
            {
                Cx = 9144000, Cy = 6858000, Type = SlideSizeValues.Screen4x3
            };
            NotesSize notesSize1 = new NotesSize()
            {
                Cx = 6858000, Cy = 9144000
            };
            DefaultTextStyle defaultTextStyle1 = new DefaultTextStyle();

            presentationPart.Presentation.Append(slideMasterIdList1, slideIdList1, slideSize1, notesSize1, defaultTextStyle1);

            SlidePart       slidePart1;
            SlideLayoutPart slideLayoutPart1;
            SlideMasterPart slideMasterPart1;
            ThemePart       themePart1;

            slidePart1       = CreateSlidePart(presentationPart);
            slideLayoutPart1 = CreateSlideLayoutPart(slidePart1);
            slideMasterPart1 = CreateSlideMasterPart(slideLayoutPart1);
            themePart1       = CreateTheme(slideMasterPart1);

            slideMasterPart1.AddPart(slideLayoutPart1, "rId1");
            presentationPart.AddPart(slideMasterPart1, "rId1");
            presentationPart.AddPart(themePart1, "rId5");

            // Start set layout.

            /*
             * string layoutName = "Title and Content";
             *
             * // Get SlideMasterPart and SlideLayoutPart from the existing Presentation Part
             * SlideMasterPart slideMasterPart = presentationPart.SlideMasterParts.First();
             * SlideLayoutPart slideLayoutPart = slideMasterPart.SlideLayoutParts.SingleOrDefault
             *  (sl => sl.SlideLayout.CommonSlideData.Name.Value.Equals(layoutName, StringComparison.OrdinalIgnoreCase));
             * if (slideLayoutPart == null)
             * {
             *  throw new Exception("The slide layout " + layoutName + " is not found");
             * }
             *
             * slidePart1.AddPart<SlideLayoutPart>(slideLayoutPart);
             */
            // End set layout.
        }
Ejemplo n.º 7
0
        public override Widget build(BuildContext context)
        {
            float selectedFontSize   = selectedLabelStyle.fontSize ?? 0;
            float unselectedFontSize = unselectedLabelStyle.fontSize ?? 0;

            TextStyle customStyle = TextStyle.lerp(
                unselectedLabelStyle,
                selectedLabelStyle,
                animation.value
                );
            float t = new FloatTween(begin: unselectedFontSize / selectedFontSize, end: 1.0f)
                      .evaluate(animation);
            Widget text = DefaultTextStyle.merge(
                style: customStyle.copyWith(
                    fontSize: selectedFontSize,
                    color: colorTween.evaluate(animation)
                    ),
                child: new Transform(
                    transform: Matrix4.diagonal3Values(t, t, t),
                    alignment: Alignment.bottomCenter,
                    child: item.title
                    )
                );

            if (!showUnselectedLabels && !showSelectedLabels)
            {
                text = new Opacity(
                    opacity: 0.0f,
                    child: text
                    );
            }
            else if (!showUnselectedLabels)
            {
                text = new FadeTransition(
                    opacity: animation,
                    child: text
                    );
            }
            else if (!showSelectedLabels)
            {
                text = new FadeTransition(
                    opacity: new FloatTween(begin: 1.0f, end: 0.0f).animate(animation),
                    child: text
                    );
            }

            return(new Align(
                       alignment: Alignment.bottomCenter,
                       heightFactor: 1.0f,
                       child: new Container(child: text)
                       ));
        }
Ejemplo n.º 8
0
        public override Widget build(BuildContext buildContext)
        {
            Widget page = null;

            if (_version == null)
            {
                return(new Container());
            }

            if (_overwriteUnknown)
            {
                page = OnUnknownPath();
            }
            else
            {
                foreach (var entry in Router)
                {
                    if (!entry.Key.IsMatch(_currentPath))
                    {
                        continue;
                    }

                    var match     = entry.Key.Match(_currentPath);
                    var arguments = new Dictionary <string, string>();
                    foreach (var parameterName in entry.Value.Item2)
                    {
                        arguments[parameterName] = match.Groups[parameterName].Value;
                    }

                    page = entry.Value.Item1.Invoke(arguments);

                    break;
                }
            }

            var screenOverlay = new ScreenOverlay(
                child: new GestureDetector(
                    onTap: () => { FocusScope.of(context).requestFocus(new FocusNode()); },
                    child: page ?? OnUnknownPath()
                    )
                );

            var defaultTextStyle = new DefaultTextStyle(
                child: screenOverlay,
                style: new TextStyle(
                    fontFamily: "PingFang"
                    )
                );

            return(defaultTextStyle);
        }
Ejemplo n.º 9
0
 public PPTSlide(SlidePart slidePart, int slideIndex, DefaultTextStyle defaultTextStyle, string fileName, SlideSize SlideSizes)
 {
     this.advanceAfterTime = -1;
     this.slideIndex       = slideIndex;
     this.fileName         = fileName;
     this.defaultTextStyle = defaultTextStyle;
     SlideLayoutPart       = slidePart.SlideLayoutPart;
     SetShapeNonVisualProperties(slidePart);
     SetSpecificProperties(slidePart);
     Id         = "s1s0";
     Transition = JSONGenerator.GenerateTransitionAnimationObject(slidePart.Slide.Transition);
     Animations = new List <IAnimation>();
     AddAnimations(slidePart.Slide.Timing, Animations, SlideSizes);
 }
Ejemplo n.º 10
0
        private void insert(PresentationPart presentationPart, List <String> imgList)
        {
            int  idx        = 1;
            uint uid        = UInt32.MaxValue;
            var  slideParts = presentationPart.SlideParts;

            string            slideMasterRid    = "rId" + idx;
            SlideMasterIdList slideMasterIdList = new SlideMasterIdList(new SlideMasterId()
            {
                Id = uid, RelationshipId = slideMasterRid
            });
            SlideIdList slideIdList = new SlideIdList();
            SlideSize   slideSize   = new SlideSize()
            {
                Cx = 9144000, Cy = 6858000, Type = SlideSizeValues.Screen4x3
            };
            NotesSize notesSize = new NotesSize()
            {
                Cx = 6858000, Cy = 9144000
            };
            DefaultTextStyle defaultTextStyle = new DefaultTextStyle();

            presentationPart.Presentation.Append(slideMasterIdList, slideIdList, slideSize, notesSize, defaultTextStyle);

            SlideLayoutPart layoutPart = null;
            SlideMasterPart masterPart = null;
            ThemePart       themePart  = null;

            foreach (string imgPath in imgList)
            {
                String imgIdx   = "rId" + (900 + idx);
                String slideIdx = "rId" + (idx + 1);
                String themeIdx = "rId" + (idx + 4);

                var slidePart = CreateSlidePart(presentationPart, slideIdx, uid = uid - 10);
                if (null == layoutPart)
                {
                    layoutPart = CreateSlideLayoutPart(slidePart, slideMasterRid, uid = uid - 10);
                    masterPart = CreateSlideMasterPart(layoutPart, slideMasterRid, uid = uid - 10);
                    themePart  = CreateTheme(masterPart, themeIdx);
                    masterPart.AddPart(layoutPart, slideMasterRid);
                    presentationPart.AddPart(masterPart, slideMasterRid);
                    presentationPart.AddPart(themePart, themeIdx);
                }

                //insert(slidePart, imgPath, imgIdx, uid = uid - 10);
                idx += 5;
            }
            presentationPart.Presentation.Save();
        }
Ejemplo n.º 11
0
            public IOpenXmlParagraphTextStyle GetParagraphTextStyle(int level)
            {
                DefaultTextStyle style = this.presentation.presentationPart.Presentation.DefaultTextStyle;

                Drawing.TextParagraphPropertiesType properties = null;
                switch (level)
                {
                case 0:
                    properties = style.DefaultParagraphProperties;
                    break;

                case 1:
                    properties = style.Level1ParagraphProperties;
                    break;

                case 2:
                    properties = style.Level2ParagraphProperties;
                    break;

                case 3:
                    properties = style.Level3ParagraphProperties;
                    break;

                case 4:
                    properties = style.Level4ParagraphProperties;
                    break;

                case 5:
                    properties = style.Level5ParagraphProperties;
                    break;

                case 6:
                    properties = style.Level6ParagraphProperties;
                    break;

                case 7:
                    properties = style.Level7ParagraphProperties;
                    break;

                case 8:
                    properties = style.Level8ParagraphProperties;
                    break;

                case 9:
                    properties = style.Level9ParagraphProperties;
                    break;
                }

                return(new OpenXmlParagraphTextStyle(properties));
            }
Ejemplo n.º 12
0
        public override Widget build(BuildContext context)
        {
            Widget iconWidget;

            if (this.widget.isAnimation)
            {
                iconWidget = new RotationTransition(
                    turns: this._rotationAnimation,
                    child: new Icon(icon: Icons.keyboard_arrow_down)
                    );
            }
            else
            {
                iconWidget = new Icon(this._isDropdown ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down);
            }
            Widget result = new DefaultTextStyle(
                style: new TextStyle(
                    fontSize: 14,
                    fontFamily: "Roboto-Medium",
                    color: CColors.TextBody5
                    ),
                child: new Container(
                    height: 44.0f,
                    child: new Row(
                        mainAxisSize: MainAxisSize.min,
                        children: new List <Widget> {
                this.widget.items[this._selectedIndex ?? 0].child,
                new IconTheme(
                    data: new IconThemeData(
                        color: CColors.Icon,
                        size: 20
                        ),
                    child: iconWidget
                    )
            }
                        )
                    )
                );

            return(new GestureDetector(
                       onTap: this._handleTap,
                       behavior: HitTestBehavior.opaque,
                       child: new Container(
                           key: this._dropdownKey,
                           child: result
                           )
                       ));
        }
        Widget _wrapActiveItem(BuildContext context, Widget item, bool active)
        {
            if (!active)
            {
                return(item);
            }

            Color activeColor = this.activeColor ?? CupertinoTheme.of(context).primaryColor;

            return(IconTheme.merge(
                       data: new IconThemeData(color: activeColor),
                       child: DefaultTextStyle.merge(
                           style: new TextStyle(color: activeColor),
                           child: item
                           )
                       ));
        }
        public override Widget build(BuildContext context)
        {
            WidgetsD.debugCheckHasDirectionality(context);

            switch (Directionality.of(context))
            {
            case TextDirection.ltr:
                keys = widget.children.Keys.ToList();
                break;

            case TextDirection.rtl:
                widget.children.Keys.ToList().Reverse();
                keys = widget.children.Keys.ToList();
                break;
            }
            List <Listenable> results = new List <Listenable>();

            results.AddRange(_highlightControllers.Values);
            results.AddRange(_pressControllers.Values);
            return(new AnimatedBuilder(
                       animation: ListenableUtils.merge(results),
                       builder: (BuildContext context1, Widget child1) => {
                List <Widget> children = new List <Widget>();
                foreach (T currentKey in keys)
                {
                    TextStyle textStyle = DefaultTextStyle.of(context1).style.copyWith(
                        fontWeight: _highlightTween.evaluate(_highlightControllers[currentKey])
                        );

                    Widget child = new DefaultTextStyle(
                        style: textStyle,
                        child:
                        new Opacity(
                            opacity: _pressTween.evaluate(_pressControllers[currentKey]),
                            child: new MetaData(
                                behavior: HitTestBehavior.opaque,
                                child: new Center(child: widget.children[currentKey])
                                )
                            )
                        );

                    children.Add(child);
                }

                int selectedIndex = widget.groupValue.Equals(default) ? 0 : keys.IndexOf(widget.groupValue);
Ejemplo n.º 15
0
        public override Widget build(BuildContext context)
        {
            FocusScope.of(context).reparentIfNeeded(this.widget.focusNode);

            DefaultTextStyle defaultTextStyle   = DefaultTextStyle.of(context);
            TextStyle        effectiveTextStyle = this.widget.style;

            if (this.widget.style == null || this.widget.style.inherit)
            {
                effectiveTextStyle = defaultTextStyle.style.merge(this.widget.style);
            }

            Widget child = new WealthyText(
                key: this._richTextKey,
                textAlign: this.widget.textAlign ?? defaultTextStyle.textAlign ?? TextAlign.left,
                softWrap: this.widget.softWrap ?? defaultTextStyle.softWrap,
                overflow: this.widget.overflow ?? defaultTextStyle.overflow,
                textScaleFactor: this.widget.textScaleFactor ?? MediaQuery.textScaleFactorOf(context),
                maxLines: this.widget.maxLines ?? defaultTextStyle.maxLines,
                textSpanList: this.widget.textSpanList,
                style: effectiveTextStyle,
                onSelectionChanged: () => {
                if (this._hasFocus)
                {
                    return;
                }

                FocusScope.of(this.context).requestFocus(this.widget.focusNode);
            },
                selectionColor: this.widget.selectionColor ?? Colors.blue);

            return(new IgnorePointer(
                       ignoring: false,
                       child: new RichTextSelectionGestureDetector(
                           onTapDown: this._handleTapDown,
                           onSingleTapUp: this._handleSingleTapUp,
                           onSingleTapCancel: this._handleSingleTapCancel,
                           onSingleLongTapStart: this._handleLongPress,
                           onDragSelectionStart: this._handleDragSelectionStart,
                           onDragSelectionUpdate: this._handleDragSelectionUpdate,
                           behavior: HitTestBehavior.translucent,
                           child: child
                           )
                       ));
        }
        public override Widget build(BuildContext context)
        {
            float t = new FloatTween(begin: this.unselectedFontSize / this.selectedFontSize, end: 1.0f)
                      .evaluate(this.animation);
            Widget text = DefaultTextStyle.merge(
                style: new TextStyle(
                    fontSize: this.selectedFontSize,
                    color: this.colorTween.evaluate(this.animation)
                    ),
                child: new Transform(
                    transform: Matrix3.makeAll(t, 0, 0,
                                               0, t, 0,
                                               0, 0, 1),
                    alignment: Alignment.bottomCenter,
                    child: this.item.title
                    )
                );

            if (!this.showUnselectedLabels && !this.showSelectedLabels)
            {
                text = new Opacity(
                    opacity: 0.0f,
                    child: text
                    );
            }
            else if (!this.showUnselectedLabels)
            {
                text = new FadeTransition(
                    opacity: this.animation,
                    child: text
                    );
            }
            else if (!this.showSelectedLabels)
            {
                text = new FadeTransition(
                    opacity: new FloatTween(begin: 1.0f, end: 0.0f).animate(this.animation),
                    child: text
                    );
            }
            return(new Align(
                       alignment: Alignment.bottomCenter,
                       heightFactor: 1.0f,
                       child: new Container(child: text)
                       ));
        }
Ejemplo n.º 17
0
        public override Widget build(BuildContext context)
        {
            float textScaleFactor = MediaQuery.textScaleFactorOf(context);

            return(new Container(
                       constraints: new BoxConstraints(minHeight: GalleryOptionUtils._kItemHeight *textScaleFactor),
                       padding: GalleryOptionUtils._kItemPadding,
                       alignment: AlignmentDirectional.centerStart,
                       child: new DefaultTextStyle(
                           style: DefaultTextStyle.of(context).style,
                           maxLines: 2,
                           overflow: TextOverflow.fade,
                           child: new IconTheme(
                               data: Theme.of(context).primaryIconTheme,
                               child: this.child
                               )
                           )
                       ));
        }
Ejemplo n.º 18
0
        public void Draw(IEnumerable <Feature> features, BoundingBox boundingBox, Canvas canvas, DrawContext drawContext, bool shadow)
        {
            var enumerable = features as IList <Feature> ?? features.ToList();

            if (CustomStyles.Count > 0)
            {
                foreach (var style in CustomStyles)
                {
                    style.Draw(enumerable, boundingBox, canvas, drawContext, shadow);
                }
            }
            else
            {
                DefaultPointStyle.Draw(enumerable, boundingBox, canvas, drawContext, shadow);
                DefaultLineStyle.Draw(enumerable, boundingBox, canvas, drawContext, shadow);
                DefaultAreaStyle.Draw(enumerable, boundingBox, canvas, drawContext, shadow);
                DefaultTextStyle.Draw(enumerable, boundingBox, canvas, drawContext, shadow);
            }
        }
Ejemplo n.º 19
0
        public override Widget build(BuildContext context)
        {
            var defaultTextStyle   = DefaultTextStyle.of(context);
            var effectiveTextStyle = style;

            if (style == null || style.inherit)
            {
                effectiveTextStyle = defaultTextStyle.style.merge(style);
            }

            if (MediaQuery.boldTextOverride(context))
            {
                effectiveTextStyle = effectiveTextStyle.merge(new TextStyle(fontWeight: FontWeight.w700));
            }

            var textSpan = new TextSpan(
                "",
                style: effectiveTextStyle,
                children: _textSpanList
                );

            textSpan.children.ForEach(child =>
            {
                if (child is ImageSpan imageSpan)
                {
                    imageSpan.UpdateImageConfiguration(context);
                }
            });

            var result = new WealthyTextWrapper(
                textAlign: textAlign ?? defaultTextStyle.textAlign ?? TextAlign.left,
                softWrap: softWrap ?? defaultTextStyle.softWrap,
                overflow: overflow ?? defaultTextStyle.overflow,
                textScaleFactor: textScaleFactor ?? MediaQuery.textScaleFactorOf(context),
                maxLines: maxLines ?? defaultTextStyle.maxLines,
                text: textSpan,
                onSelectionChanged: _onSelectionChanged,
                selectionColor: _selectionColor
                );

            return(result);
        }
Ejemplo n.º 20
0
        public override Widget build(BuildContext context)
        {
            float?width = this.shrinkToFit ? (float?)null : MediaQuery.of(context).size.width;

            return(new Container(
                       padding: this.padding,
                       color: this.backgroundColor,
                       width: width,
                       child: DefaultTextStyle.merge(
                           style: this.defaultTextStyle ?? DefaultTextStyle.of(context).style,
                           child: (this.useRichText)
                        ? (Widget) new HtmlRichTextParser(
                               shrinkToFit: this.shrinkToFit,
                               onLinkTap: this.onLinkTap,
                               renderNewlines: this.renderNewlines,
                               customEdgeInsets: this.customEdgeInsets,
                               customTextStyle: this.customTextStyle,
                               customTextAlign: this.customTextAlign,
                               html: this.data,
                               onImageError: this.onImageError,
                               linkStyle: this.linkStyle,
                               imageProperties: this.imageProperties,
                               onImageTap: this.onImageTap,
                               showImages: this.showImages
                               )
                        : new HtmlOldParser(
                               width: width,
                               onLinkTap: this.onLinkTap,
                               renderNewlines: this.renderNewlines,
                               customRender: this.customRender,
                               html: this.data,
                               blockSpacing: this.blockSpacing,
                               onImageError: this.onImageError,
                               linkStyle: this.linkStyle,
                               showImages: this.showImages
                               )
                           )
                       ));
        }
        private static void CreatePresentationTempalte(PresentationPart presentationPart)
        {
            // create template pptx
            SlideMasterIdList slideMasterIdList = new SlideMasterIdList(new SlideMasterId()
            {
                Id = (UInt32Value)2147483648U, RelationshipId = slideMasterRId
            });
            SlideIdList slideIdList = new SlideIdList(new SlideId()
            {
                Id = (UInt32Value)256U, RelationshipId = slidePartRId
            });
            SlideSize slideSize = new SlideSize()
            {
                Cx = slideCx, Cy = slideCy, Type = SlideSizeValues.Screen4x3
            };
            NotesSize notesSize = new NotesSize()
            {
                Cx = slideCy, Cy = slideCx
            };
            DefaultTextStyle defaultTextStyle = new DefaultTextStyle();

            presentationPart.Presentation.Append(slideMasterIdList, slideIdList, slideSize, notesSize, defaultTextStyle);

            SlidePart       templateSlidePart;
            SlideLayoutPart slideLayoutPart;
            SlideMasterPart slideMasterPart;
            ThemePart       themePart;


            templateSlidePart = CreateSlidePart(presentationPart);
            slideLayoutPart   = CreateSlideLayoutPart(templateSlidePart);
            slideMasterPart   = CreateSlideMasterPart(slideLayoutPart);
            themePart         = CreateTheme(slideMasterPart);

            slideMasterPart.AddPart(slideLayoutPart, slideMasterRId);
            presentationPart.AddPart(slideMasterPart, slideMasterRId);
            presentationPart.AddPart(themePart, themPartRId);
        }
        private static void CreatePresentationParts(PresentationPart presentationPart)
        {
            SlideMasterIdList slideMasterIdList1 = new SlideMasterIdList(new SlideMasterId()
            {
                Id = (UInt32Value)2147483648U, RelationshipId = "rId1"
            });
            SlideIdList slideIdList1 = new SlideIdList(new SlideId()
            {
                Id = (UInt32Value)256U, RelationshipId = "rId2"
            });
            SlideSize slideSize1 = new SlideSize()
            {
                Cx = 9144000, Cy = 6858000, Type = SlideSizeValues.Screen4x3
            };
            NotesSize notesSize1 = new NotesSize()
            {
                Cx = 6858000, Cy = 9144000
            };
            DefaultTextStyle defaultTextStyle1 = new DefaultTextStyle();

            presentationPart.Presentation.Append(slideMasterIdList1, slideIdList1, slideSize1, notesSize1, defaultTextStyle1);

            SlidePart       slidePart1;
            SlideLayoutPart slideLayoutPart1;
            SlideMasterPart slideMasterPart1;
            ThemePart       themePart1;


            slidePart1       = CreateSlidePart(presentationPart);
            slideLayoutPart1 = CreateSlideLayoutPart(slidePart1);
            slideMasterPart1 = CreateSlideMasterPart(slideLayoutPart1);
            themePart1       = CreateTheme(slideMasterPart1);

            slideMasterPart1.AddPart(slideLayoutPart1, "rId1");
            presentationPart.AddPart(slideMasterPart1, "rId1");
            presentationPart.AddPart(themePart1, "rId5");
        }
Ejemplo n.º 23
0
        private static void CreatePresentationParts(PresentationPart presentationPart)
        {
            SlideMasterIdList slideMasterIdList1 = new SlideMasterIdList(new SlideMasterId()
            {
                Id = (UInt32Value)2147483648U, RelationshipId = "rId1"
            });
            SlideIdList slideIdList1 = new SlideIdList(new SlideId()
            {
                Id = (DocumentFormat.OpenXml.UInt32Value) 256U, RelationshipId = "rId2"
            });
            SlideSize slideSize1 = new SlideSize()
            {
                Cx = 12192000, Cy = 6858000
            };
            NotesSize notesSize1 = new NotesSize()
            {
                Cy = 6858000, Cx = 12192000
            };
            DefaultTextStyle defaultTextStyle1 = new DefaultTextStyle();

            presentationPart.Presentation.Append(slideMasterIdList1, slideIdList1, slideSize1, notesSize1, defaultTextStyle1);

            SlidePart       slidePart1;
            SlideLayoutPart slideLayoutPart1;
            SlideMasterPart slideMasterPart1;
            ThemePart       themePart1;


            slidePart1       = CreateAddSlidePart(presentationPart, "rId2");
            slideLayoutPart1 = CreateSlideLayoutPart(slidePart1);
            slideMasterPart1 = CreateSlideMasterPart(slideLayoutPart1);
            themePart1       = CreateTheme(slideMasterPart1);

            slideMasterPart1.AddPart(slideLayoutPart1, "rId1");
            presentationPart.AddPart(slideMasterPart1, "rId1");
            presentationPart.AddPart(themePart1, "rId5");
        }
Ejemplo n.º 24
0
        public override Widget build(BuildContext context)
        {
            Color resolvedBackgroundColor = CupertinoDynamicColor.resolve(widget.backgroundColor, context);

            Widget result = new DefaultTextStyle(
                style: CupertinoTheme.of(context).textTheme.pickerTextStyle,
                child: new Stack(
                    children: new List <Widget> {
                Positioned.fill(
                    child: new _CupertinoPickerSemantics(
                        scrollController: widget.scrollController ?? _controller,
                        child: new ListWheelScrollView(
                            controller: widget.scrollController ?? _controller,
                            physics: new FixedExtentScrollPhysics(),
                            diameterRatio: widget.diameterRatio ?? RenderListWheelViewport.defaultDiameterRatio,
                            perspective: CupertinoPickerUtils._kDefaultPerspective,
                            offAxisFraction: widget.offAxisFraction,
                            useMagnifier: widget.useMagnifier,
                            magnification: widget.magnification,
                            overAndUnderCenterOpacity: CupertinoPickerUtils._kOverAndUnderCenterOpacity,
                            itemExtent: widget.itemExtent,
                            squeeze: widget.squeeze ?? CupertinoPickerUtils._kSqueeze,
                            onSelectedItemChanged: _handleSelectedItemChanged,
                            childDelegate: widget.childDelegate
                            )
                        )
                    ),
                _buildMagnifierScreen(),
            }
                    )
                );

            return(new DecoratedBox(
                       decoration: new BoxDecoration(color: resolvedBackgroundColor),
                       child: result
                       ));
        }
Ejemplo n.º 25
0
        // Generates content of part.
        private void GeneratePartContent_4x3(PresentationPart part)
        {
            Presentation presentation1 = new Presentation()
            {
                SaveSubsetFonts = true
            };

            presentation1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main");
            presentation1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            presentation1.AddNamespaceDeclaration("p", "http://schemas.openxmlformats.org/presentationml/2006/main");

            SlideMasterIdList slideMasterIdList1 = new SlideMasterIdList();
            SlideMasterId     slideMasterId1     = new SlideMasterId()
            {
                Id = (UInt32Value)2147483660U, RelationshipId = "rId1"
            };

            slideMasterIdList1.Append(slideMasterId1);

            SlideIdList slideIdList1 = new SlideIdList();
            SlideId     slideId1     = new SlideId()
            {
                Id = (UInt32Value)256U, RelationshipId = "rId2"
            };

            slideIdList1.Append(slideId1);
            SlideSize slideSize1 = new SlideSize()
            {
                Cx = 9144000, Cy = 6858000, Type = SlideSizeValues.Screen4x3
            };
            NotesSize notesSize1 = new NotesSize()
            {
                Cx = 6858000L, Cy = 9144000L
            };

            DefaultTextStyle defaultTextStyle1 = new DefaultTextStyle();

            A.DefaultParagraphProperties defaultParagraphProperties2 = new A.DefaultParagraphProperties();
            A.DefaultRunProperties       defaultRunProperties100     = new A.DefaultRunProperties()
            {
                Language = "en-US"
            };

            defaultParagraphProperties2.Append(defaultRunProperties100);

            A.Level1ParagraphProperties level1ParagraphProperties19 = new A.Level1ParagraphProperties()
            {
                LeftMargin = 0, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties101 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill38   = new A.SolidFill();
            A.SchemeColor schemeColor48 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill38.Append(schemeColor48);
            A.LatinFont latinFont22 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont22 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont22 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties101.Append(solidFill38);
            defaultRunProperties101.Append(latinFont22);
            defaultRunProperties101.Append(eastAsianFont22);
            defaultRunProperties101.Append(complexScriptFont22);

            level1ParagraphProperties19.Append(defaultRunProperties101);

            A.Level2ParagraphProperties level2ParagraphProperties11 = new A.Level2ParagraphProperties()
            {
                LeftMargin = 457200, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties102 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill39   = new A.SolidFill();
            A.SchemeColor schemeColor49 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill39.Append(schemeColor49);
            A.LatinFont latinFont23 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont23 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont23 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties102.Append(solidFill39);
            defaultRunProperties102.Append(latinFont23);
            defaultRunProperties102.Append(eastAsianFont23);
            defaultRunProperties102.Append(complexScriptFont23);

            level2ParagraphProperties11.Append(defaultRunProperties102);

            A.Level3ParagraphProperties level3ParagraphProperties11 = new A.Level3ParagraphProperties()
            {
                LeftMargin = 914400, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties103 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill40   = new A.SolidFill();
            A.SchemeColor schemeColor50 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill40.Append(schemeColor50);
            A.LatinFont latinFont24 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont24 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont24 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties103.Append(solidFill40);
            defaultRunProperties103.Append(latinFont24);
            defaultRunProperties103.Append(eastAsianFont24);
            defaultRunProperties103.Append(complexScriptFont24);

            level3ParagraphProperties11.Append(defaultRunProperties103);

            A.Level4ParagraphProperties level4ParagraphProperties11 = new A.Level4ParagraphProperties()
            {
                LeftMargin = 1371600, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties104 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill41   = new A.SolidFill();
            A.SchemeColor schemeColor51 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill41.Append(schemeColor51);
            A.LatinFont latinFont25 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont25 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont25 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties104.Append(solidFill41);
            defaultRunProperties104.Append(latinFont25);
            defaultRunProperties104.Append(eastAsianFont25);
            defaultRunProperties104.Append(complexScriptFont25);

            level4ParagraphProperties11.Append(defaultRunProperties104);

            A.Level5ParagraphProperties level5ParagraphProperties11 = new A.Level5ParagraphProperties()
            {
                LeftMargin = 1828800, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties105 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill42   = new A.SolidFill();
            A.SchemeColor schemeColor52 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill42.Append(schemeColor52);
            A.LatinFont latinFont26 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont26 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont26 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties105.Append(solidFill42);
            defaultRunProperties105.Append(latinFont26);
            defaultRunProperties105.Append(eastAsianFont26);
            defaultRunProperties105.Append(complexScriptFont26);

            level5ParagraphProperties11.Append(defaultRunProperties105);

            A.Level6ParagraphProperties level6ParagraphProperties11 = new A.Level6ParagraphProperties()
            {
                LeftMargin = 2286000, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties106 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill43   = new A.SolidFill();
            A.SchemeColor schemeColor53 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill43.Append(schemeColor53);
            A.LatinFont latinFont27 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont27 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont27 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties106.Append(solidFill43);
            defaultRunProperties106.Append(latinFont27);
            defaultRunProperties106.Append(eastAsianFont27);
            defaultRunProperties106.Append(complexScriptFont27);

            level6ParagraphProperties11.Append(defaultRunProperties106);

            A.Level7ParagraphProperties level7ParagraphProperties11 = new A.Level7ParagraphProperties()
            {
                LeftMargin = 2743200, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties107 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill44   = new A.SolidFill();
            A.SchemeColor schemeColor54 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill44.Append(schemeColor54);
            A.LatinFont latinFont28 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont28 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont28 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties107.Append(solidFill44);
            defaultRunProperties107.Append(latinFont28);
            defaultRunProperties107.Append(eastAsianFont28);
            defaultRunProperties107.Append(complexScriptFont28);

            level7ParagraphProperties11.Append(defaultRunProperties107);

            A.Level8ParagraphProperties level8ParagraphProperties11 = new A.Level8ParagraphProperties()
            {
                LeftMargin = 3200400, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties108 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill45   = new A.SolidFill();
            A.SchemeColor schemeColor55 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill45.Append(schemeColor55);
            A.LatinFont latinFont29 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont29 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont29 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties108.Append(solidFill45);
            defaultRunProperties108.Append(latinFont29);
            defaultRunProperties108.Append(eastAsianFont29);
            defaultRunProperties108.Append(complexScriptFont29);

            level8ParagraphProperties11.Append(defaultRunProperties108);

            A.Level9ParagraphProperties level9ParagraphProperties11 = new A.Level9ParagraphProperties()
            {
                LeftMargin = 3657600, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties109 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill46   = new A.SolidFill();
            A.SchemeColor schemeColor56 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill46.Append(schemeColor56);
            A.LatinFont latinFont30 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont30 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont30 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties109.Append(solidFill46);
            defaultRunProperties109.Append(latinFont30);
            defaultRunProperties109.Append(eastAsianFont30);
            defaultRunProperties109.Append(complexScriptFont30);

            level9ParagraphProperties11.Append(defaultRunProperties109);

            defaultTextStyle1.Append(defaultParagraphProperties2);
            defaultTextStyle1.Append(level1ParagraphProperties19);
            defaultTextStyle1.Append(level2ParagraphProperties11);
            defaultTextStyle1.Append(level3ParagraphProperties11);
            defaultTextStyle1.Append(level4ParagraphProperties11);
            defaultTextStyle1.Append(level5ParagraphProperties11);
            defaultTextStyle1.Append(level6ParagraphProperties11);
            defaultTextStyle1.Append(level7ParagraphProperties11);
            defaultTextStyle1.Append(level8ParagraphProperties11);
            defaultTextStyle1.Append(level9ParagraphProperties11);

            PresentationExtensionList presentationExtensionList1 = new PresentationExtensionList();

            PresentationExtension presentationExtension1 = new PresentationExtension()
            {
                Uri = "{EFAFB233-063F-42B5-8137-9DF3F51BA10A}"
            };

            P15.SlideGuideList slideGuideList1 = new P15.SlideGuideList();
            slideGuideList1.AddNamespaceDeclaration("p15", "http://schemas.microsoft.com/office/powerpoint/2012/main");

            presentationExtension1.Append(slideGuideList1);

            presentationExtensionList1.Append(presentationExtension1);

            presentation1.Append(slideMasterIdList1);
            presentation1.Append(slideIdList1);
            presentation1.Append(slideSize1);
            presentation1.Append(notesSize1);
            presentation1.Append(defaultTextStyle1);
            presentation1.Append(presentationExtensionList1);

            part.Presentation = presentation1;
        }
Ejemplo n.º 26
0
        public override Widget build(BuildContext context)
        {
            D.assert(material_.debugCheckHasMaterial(context));
            D.assert(material_.debugCheckHasMaterialLocalizations(context));
            Orientation?newOrientation = _getOrientation(context);

            _lastOrientation = _lastOrientation ?? newOrientation;
            if (newOrientation != _lastOrientation)
            {
                _removeDropdownRoute();
                _lastOrientation = newOrientation;
            }

            List <Widget> items = null;

            if (_enabled)
            {
                items = widget.selectedItemBuilder == null
                    ? new List <Widget>(widget.items)
                    : widget.selectedItemBuilder(context);
            }
            else
            {
                items = widget.selectedItemBuilder == null
                    ? new List <Widget>()
                    : widget.selectedItemBuilder(context);
            }

            int hintIndex = 0;

            if (widget.hint != null || (!_enabled && widget.disabledHint != null))
            {
                Widget displayedHint = _enabled ? widget.hint : widget.disabledHint ?? widget.hint;
                if (widget.selectedItemBuilder == null)
                {
                    displayedHint = new _DropdownMenuItemContainer(child: displayedHint);
                }

                hintIndex = items.Count;
                items.Add(new DefaultTextStyle(
                              style: _textStyle.copyWith(color: Theme.of(context).hintColor),
                              child: new IgnorePointer(
                                  child: displayedHint
                                  )
                              ));
            }

            EdgeInsetsGeometry padding = ButtonTheme.of(context).alignedDropdown
                ? material_._kAlignedButtonPadding
                : material_._kUnalignedButtonPadding;

            int    index            = _enabled ? (_selectedIndex ?? hintIndex) : hintIndex;
            Widget innerItemsWidget = null;

            if (items.isEmpty())
            {
                innerItemsWidget = new Container();
            }
            else
            {
                innerItemsWidget = new IndexedStack(
                    index: index,
                    alignment: AlignmentDirectional.centerStart,
                    children: widget.isDense
                        ? items
                        : LinqUtils <Widget> .SelectList(items, (Widget item) => {
                    return(widget.itemHeight != null
                                ? new SizedBox(height: widget.itemHeight, child: item)
                                : (Widget) new Column(mainAxisSize: MainAxisSize.min,
                                                      children: new List <Widget>()
                    {
                        item
                    }));
                }));
            }

            Icon   defaultIcon = new Icon(Icons.arrow_drop_down);
            Widget result      = new DefaultTextStyle(
                style: _textStyle,
                child: new Container(
                    decoration: _showHighlight ?? false
                        ? new BoxDecoration(
                        color: widget.focusColor ?? Theme.of(context).focusColor,
                        borderRadius: BorderRadius.all(Radius.circular(4.0f))
                        )
                        : null,
                    padding: padding,
                    height: widget.isDense ? _denseButtonHeight : null,
                    child: new Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        mainAxisSize: MainAxisSize.min,
                        children: new List <Widget> {
                widget.isExpanded ? new Expanded(child: innerItemsWidget) : (Widget)innerItemsWidget,
                new IconTheme(
                    data: new IconThemeData(
                        color: _iconColor,
                        size: widget.iconSize
                        ),
                    child: widget.icon ?? defaultIcon
                    )
            }
                        )
                    )
                );

            if (!DropdownButtonHideUnderline.at(context))
            {
                float bottom = widget.isDense || widget.itemHeight == null ? 0.0f : 8.0f;
                result = new Stack(
                    children: new List <Widget> {
                    result,
                    new Positioned(
                        left: 0.0f,
                        right: 0.0f,
                        bottom: bottom,
                        child: widget.underline ?? new Container(
                            height: 1.0f,
                            decoration: new BoxDecoration(
                                border: new Border(
                                    bottom: new BorderSide(color: new Color(0xFFBDBDBD), width: 0.0f))
                                )
                            )
                        )
                }
                    );
            }

            return(new Focus(
                       canRequestFocus: _enabled,
                       focusNode: focusNode,
                       autofocus: widget.autofocus,
                       child: new GestureDetector(
                           onTap: _enabled ? (GestureTapCallback)_handleTap : null,
                           behavior: HitTestBehavior.opaque,
                           child: result
                           )
                       ));
        }
Ejemplo n.º 27
0
        public override Widget build(BuildContext context)
        {
            D.assert(MaterialD.debugCheckHasMaterialLocalizations(context));
            ThemeData     themeData   = Theme.of(context);
            ScaffoldState scaffold    = Scaffold.of(context, nullOk: true);
            ModalRoute    parentRoute = ModalRoute.of(context);

            bool hasDrawer      = scaffold?.hasDrawer ?? false;
            bool hasEndDrawer   = scaffold?.hasEndDrawer ?? false;
            bool canPop         = parentRoute?.canPop ?? false;
            bool useCloseButton = parentRoute is PageRoute && ((PageRoute)parentRoute).fullscreenDialog;

            IconThemeData appBarIconTheme = this.widget.iconTheme ?? themeData.primaryIconTheme;
            TextStyle     centerStyle     = this.widget.textTheme?.title ?? themeData.primaryTextTheme.title;
            TextStyle     sideStyle       = this.widget.textTheme?.body1 ?? themeData.primaryTextTheme.body1;

            if (this.widget.toolbarOpacity != 1.0f)
            {
                float opacity =
                    new Interval(0.25f, 1.0f, curve: Curves.fastOutSlowIn).transform(this.widget.toolbarOpacity);
                if (centerStyle?.color != null)
                {
                    centerStyle = centerStyle.copyWith(color: centerStyle.color.withOpacity(opacity));
                }

                if (sideStyle?.color != null)
                {
                    sideStyle = sideStyle.copyWith(color: sideStyle.color.withOpacity(opacity));
                }

                appBarIconTheme = appBarIconTheme.copyWith(
                    opacity: opacity * (appBarIconTheme.opacity ?? 1.0f)
                    );
            }

            Widget leading = this.widget.leading;

            if (leading == null && this.widget.automaticallyImplyLeading)
            {
                if (hasDrawer)
                {
                    leading = new IconButton(
                        icon: new Icon(Icons.menu),
                        onPressed: this._handleDrawerButton,
                        tooltip: MaterialLocalizations.of(context).openAppDrawerTooltip);
                }
                else
                {
                    if (canPop)
                    {
                        leading = useCloseButton ? (Widget) new CloseButton() : new BackButton();
                    }
                }
            }

            if (leading != null)
            {
                leading = new ConstrainedBox(
                    constraints: BoxConstraints.tightFor(width: AppBarUtils._kLeadingWidth),
                    child: leading);
            }

            Widget title = this.widget.title;

            if (title != null)
            {
                title = new DefaultTextStyle(
                    style: centerStyle,
                    softWrap: false,
                    overflow: TextOverflow.ellipsis,
                    child: title);
            }

            Widget actions = null;

            if (this.widget.actions != null && this.widget.actions.isNotEmpty())
            {
                actions = new Row(
                    mainAxisSize: MainAxisSize.min,
                    crossAxisAlignment: CrossAxisAlignment.stretch,
                    children: this.widget.actions);
            }
            else if (hasEndDrawer)
            {
                actions = new IconButton(
                    icon: new Icon(Icons.menu),
                    onPressed: this._handleDrawerButtonEnd,
                    tooltip: MaterialLocalizations.of(context).openAppDrawerTooltip);
            }

            Widget toolbar = new NavigationToolbar(
                leading: leading,
                middle: title,
                trailing: actions,
                centerMiddle: this.widget._getEffectiveCenterTitle(themeData).Value,
                middleSpacing: this.widget.titleSpacing);

            Widget appBar = new ClipRect(
                child: new CustomSingleChildLayout(
                    layoutDelegate: new _ToolbarContainerLayout(),
                    child: IconTheme.merge(
                        data: appBarIconTheme,
                        child: new DefaultTextStyle(
                            style: sideStyle,
                            child: toolbar)
                        )
                    )
                );

            if (this.widget.bottom != null)
            {
                appBar = new Column(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: new List <Widget> {
                    new Flexible(
                        child: new ConstrainedBox(
                            constraints: new BoxConstraints(maxHeight: Constants.kToolbarHeight),
                            child: appBar
                            )
                        ),
                    this.widget.bottomOpacity == 1.0f
                            ? (Widget)this.widget.bottom
                            : new Opacity(
                        opacity: new Interval(0.25f, 1.0f, curve: Curves.fastOutSlowIn).transform(this.widget
                                                                                                  .bottomOpacity),
                        child: this.widget.bottom
                        )
                }
                    );
            }

            if (this.widget.primary)
            {
                appBar = new SafeArea(
                    top: true,
                    child: appBar);
            }

            appBar = new Align(
                alignment: Alignment.topCenter,
                child: appBar);

            if (this.widget.flexibleSpace != null)
            {
                appBar = new Stack(
                    fit: StackFit.passthrough,
                    children: new List <Widget> {
                    this.widget.flexibleSpace,
                    appBar
                }
                    );
            }

            Brightness           brightness   = this.widget.brightness ?? themeData.primaryColorBrightness;
            SystemUiOverlayStyle overlayStyle = brightness == Brightness.dark
                ? SystemUiOverlayStyle.light
                : SystemUiOverlayStyle.dark;

            return(new AnnotatedRegion <SystemUiOverlayStyle>(
                       value: overlayStyle,
                       child: new Material(
                           color: this.widget.backgroundColor ?? themeData.primaryColor,
                           elevation: this.widget.elevation,
                           child: appBar
                           )));
        }
Ejemplo n.º 28
0
        private void GeneratePresentationPart1Content_16x9(PresentationPart presentationPart1)
        {
            Presentation presentation1 = new Presentation()
            {
                SaveSubsetFonts = true
            };

            presentation1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main");
            presentation1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            presentation1.AddNamespaceDeclaration("p", "http://schemas.openxmlformats.org/presentationml/2006/main");

            SlideMasterIdList slideMasterIdList1 = new SlideMasterIdList();
            SlideMasterId     slideMasterId1     = new SlideMasterId()
            {
                Id = (UInt32Value)2147483648U, RelationshipId = "rId1"
            };

            slideMasterIdList1.Append(slideMasterId1);

            SlideIdList slideIdList1 = new SlideIdList();
            SlideId     slideId1     = new SlideId()
            {
                Id = (UInt32Value)256U, RelationshipId = "rId2"
            };

            slideIdList1.Append(slideId1);
            SlideSize slideSize1 = new SlideSize()
            {
                Cx = 12192000, Cy = 6858000
            };
            NotesSize notesSize1 = new NotesSize()
            {
                Cx = 6858000L, Cy = 9144000L
            };

            DefaultTextStyle defaultTextStyle1 = new DefaultTextStyle();

            A.DefaultParagraphProperties defaultParagraphProperties1 = new A.DefaultParagraphProperties();
            A.DefaultRunProperties       defaultRunProperties1       = new A.DefaultRunProperties()
            {
                Language = "ja-JP"
            };

            defaultParagraphProperties1.Append(defaultRunProperties1);

            A.Level1ParagraphProperties level1ParagraphProperties1 = new A.Level1ParagraphProperties()
            {
                LeftMargin = 0, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties2 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill1   = new A.SolidFill();
            A.SchemeColor schemeColor1 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill1.Append(schemeColor1);
            A.LatinFont latinFont1 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont1 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont1 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties2.Append(solidFill1);
            defaultRunProperties2.Append(latinFont1);
            defaultRunProperties2.Append(eastAsianFont1);
            defaultRunProperties2.Append(complexScriptFont1);

            level1ParagraphProperties1.Append(defaultRunProperties2);

            A.Level2ParagraphProperties level2ParagraphProperties1 = new A.Level2ParagraphProperties()
            {
                LeftMargin = 457200, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties3 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill2   = new A.SolidFill();
            A.SchemeColor schemeColor2 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill2.Append(schemeColor2);
            A.LatinFont latinFont2 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont2 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont2 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties3.Append(solidFill2);
            defaultRunProperties3.Append(latinFont2);
            defaultRunProperties3.Append(eastAsianFont2);
            defaultRunProperties3.Append(complexScriptFont2);

            level2ParagraphProperties1.Append(defaultRunProperties3);

            A.Level3ParagraphProperties level3ParagraphProperties1 = new A.Level3ParagraphProperties()
            {
                LeftMargin = 914400, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties4 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill3   = new A.SolidFill();
            A.SchemeColor schemeColor3 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill3.Append(schemeColor3);
            A.LatinFont latinFont3 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont3 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont3 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties4.Append(solidFill3);
            defaultRunProperties4.Append(latinFont3);
            defaultRunProperties4.Append(eastAsianFont3);
            defaultRunProperties4.Append(complexScriptFont3);

            level3ParagraphProperties1.Append(defaultRunProperties4);

            A.Level4ParagraphProperties level4ParagraphProperties1 = new A.Level4ParagraphProperties()
            {
                LeftMargin = 1371600, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties5 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill4   = new A.SolidFill();
            A.SchemeColor schemeColor4 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill4.Append(schemeColor4);
            A.LatinFont latinFont4 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont4 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont4 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties5.Append(solidFill4);
            defaultRunProperties5.Append(latinFont4);
            defaultRunProperties5.Append(eastAsianFont4);
            defaultRunProperties5.Append(complexScriptFont4);

            level4ParagraphProperties1.Append(defaultRunProperties5);

            A.Level5ParagraphProperties level5ParagraphProperties1 = new A.Level5ParagraphProperties()
            {
                LeftMargin = 1828800, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties6 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill5   = new A.SolidFill();
            A.SchemeColor schemeColor5 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill5.Append(schemeColor5);
            A.LatinFont latinFont5 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont5 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont5 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties6.Append(solidFill5);
            defaultRunProperties6.Append(latinFont5);
            defaultRunProperties6.Append(eastAsianFont5);
            defaultRunProperties6.Append(complexScriptFont5);

            level5ParagraphProperties1.Append(defaultRunProperties6);

            A.Level6ParagraphProperties level6ParagraphProperties1 = new A.Level6ParagraphProperties()
            {
                LeftMargin = 2286000, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties7 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill6   = new A.SolidFill();
            A.SchemeColor schemeColor6 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill6.Append(schemeColor6);
            A.LatinFont latinFont6 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont6 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont6 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties7.Append(solidFill6);
            defaultRunProperties7.Append(latinFont6);
            defaultRunProperties7.Append(eastAsianFont6);
            defaultRunProperties7.Append(complexScriptFont6);

            level6ParagraphProperties1.Append(defaultRunProperties7);

            A.Level7ParagraphProperties level7ParagraphProperties1 = new A.Level7ParagraphProperties()
            {
                LeftMargin = 2743200, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties8 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill7   = new A.SolidFill();
            A.SchemeColor schemeColor7 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill7.Append(schemeColor7);
            A.LatinFont latinFont7 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont7 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont7 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties8.Append(solidFill7);
            defaultRunProperties8.Append(latinFont7);
            defaultRunProperties8.Append(eastAsianFont7);
            defaultRunProperties8.Append(complexScriptFont7);

            level7ParagraphProperties1.Append(defaultRunProperties8);

            A.Level8ParagraphProperties level8ParagraphProperties1 = new A.Level8ParagraphProperties()
            {
                LeftMargin = 3200400, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties9 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill8   = new A.SolidFill();
            A.SchemeColor schemeColor8 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill8.Append(schemeColor8);
            A.LatinFont latinFont8 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont8 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont8 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties9.Append(solidFill8);
            defaultRunProperties9.Append(latinFont8);
            defaultRunProperties9.Append(eastAsianFont8);
            defaultRunProperties9.Append(complexScriptFont8);

            level8ParagraphProperties1.Append(defaultRunProperties9);

            A.Level9ParagraphProperties level9ParagraphProperties1 = new A.Level9ParagraphProperties()
            {
                LeftMargin = 3657600, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties10 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill9   = new A.SolidFill();
            A.SchemeColor schemeColor9 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill9.Append(schemeColor9);
            A.LatinFont latinFont9 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont9 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont9 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties10.Append(solidFill9);
            defaultRunProperties10.Append(latinFont9);
            defaultRunProperties10.Append(eastAsianFont9);
            defaultRunProperties10.Append(complexScriptFont9);

            level9ParagraphProperties1.Append(defaultRunProperties10);

            defaultTextStyle1.Append(defaultParagraphProperties1);
            defaultTextStyle1.Append(level1ParagraphProperties1);
            defaultTextStyle1.Append(level2ParagraphProperties1);
            defaultTextStyle1.Append(level3ParagraphProperties1);
            defaultTextStyle1.Append(level4ParagraphProperties1);
            defaultTextStyle1.Append(level5ParagraphProperties1);
            defaultTextStyle1.Append(level6ParagraphProperties1);
            defaultTextStyle1.Append(level7ParagraphProperties1);
            defaultTextStyle1.Append(level8ParagraphProperties1);
            defaultTextStyle1.Append(level9ParagraphProperties1);

            PresentationExtensionList presentationExtensionList1 = new PresentationExtensionList();

            PresentationExtension presentationExtension1 = new PresentationExtension()
            {
                Uri = "{EFAFB233-063F-42B5-8137-9DF3F51BA10A}"
            };

            P15.SlideGuideList slideGuideList1 = new P15.SlideGuideList();
            slideGuideList1.AddNamespaceDeclaration("p15", "http://schemas.microsoft.com/office/powerpoint/2012/main");

            presentationExtension1.Append(slideGuideList1);

            presentationExtensionList1.Append(presentationExtension1);

            presentation1.Append(slideMasterIdList1);
            presentation1.Append(slideIdList1);
            presentation1.Append(slideSize1);
            presentation1.Append(notesSize1);
            presentation1.Append(defaultTextStyle1);
            presentation1.Append(presentationExtensionList1);

            presentationPart1.Presentation = presentation1;
        }
Ejemplo n.º 29
0
        public override Widget build(BuildContext context)
        {
            base.build(context);
            D.assert(() => { return(_controller._textSpan.visitChildren((InlineSpan span) => span is TextSpan)); },
                     () => "SelectableText only supports TextSpan; Other type of InlineSpan is not allowed");
            D.assert(WidgetsD.debugCheckHasMediaQuery(context));
            D.assert(WidgetsD.debugCheckHasDirectionality(context));
            D.assert(
                !(widget.style != null && widget.style.inherit == false &&
                  (widget.style.fontSize == null || widget.style.textBaseline == null)),
                () => "inherit false style must supply fontSize and textBaseline"
                );

            ThemeData themeData = Theme.of(context);
            FocusNode focusNode = _effectiveFocusNode;

            TextSelectionControls textSelectionControls;
            bool   paintCursorAboveText;
            bool   cursorOpacityAnimates;
            Offset cursorOffset = Offset.zero;
            Color  cursorColor  = widget.cursorColor;
            Radius cursorRadius = widget.cursorRadius;

            switch (themeData.platform)
            {
            case RuntimePlatform.IPhonePlayer:
            case RuntimePlatform.OSXEditor:
            case RuntimePlatform.OSXPlayer:
                forcePressEnabled     = true;
                textSelectionControls = CupertinoTextFieldUtils.cupertinoTextSelectionControls;
                paintCursorAboveText  = true;
                cursorOpacityAnimates = true;
                cursorColor           = cursorColor ?? CupertinoTheme.of(context).primaryColor;
                cursorRadius          = cursorRadius ?? Radius.circular(2.0f);
                cursorOffset          =
                    new Offset(SelectableTextUtils.iOSHorizontalOffset / MediaQuery.of(context).devicePixelRatio,
                               0);
                break;

            default:
                forcePressEnabled     = false;
                textSelectionControls = _MaterialTextSelectionControls.materialTextSelectionControls;
                paintCursorAboveText  = false;
                cursorOpacityAnimates = false;
                cursorColor           = cursorColor ?? themeData.cursorColor;
                break;
            }

            DefaultTextStyle defaultTextStyle   = DefaultTextStyle.of(context);
            TextStyle        effectiveTextStyle = widget.style;

            if (widget.style == null || widget.style.inherit)
            {
                effectiveTextStyle = defaultTextStyle.style.merge(widget.style);
            }
            if (MediaQuery.boldTextOverride(context))
            {
                effectiveTextStyle = effectiveTextStyle.merge(new TextStyle(fontWeight: FontWeight.bold));
            }

            Widget child = new RepaintBoundary(
                child: new EditableText(
                    key: editableTextKey,
                    style: effectiveTextStyle,
                    readOnly: true,
                    textWidthBasis: widget.textWidthBasis ?? defaultTextStyle.textWidthBasis,
                    showSelectionHandles: _showSelectionHandles,
                    showCursor: widget.showCursor,
                    controller: _controller,
                    focusNode: focusNode,
                    strutStyle: widget.strutStyle ?? new StrutStyle(),
                    textAlign: widget.textAlign ?? defaultTextStyle.textAlign ?? TextAlign.start,
                    textDirection: widget.textDirection,
                    textScaleFactor: widget.textScaleFactor,
                    autofocus: widget.autofocus,
                    forceLine: false,
                    toolbarOptions: widget.toolbarOptions,
                    minLines: widget.minLines,
                    maxLines: widget.maxLines ?? defaultTextStyle.maxLines,
                    selectionColor: themeData.textSelectionColor,
                    selectionControls: widget.selectionEnabled ? textSelectionControls : null,
                    onSelectionChanged: _handleSelectionChanged,
                    onSelectionHandleTapped: _handleSelectionHandleTapped,
                    rendererIgnoresPointer: true,
                    cursorWidth: widget.cursorWidth,
                    cursorRadius: cursorRadius,
                    cursorColor: cursorColor,
                    cursorOpacityAnimates: cursorOpacityAnimates,
                    cursorOffset: cursorOffset,
                    paintCursorAboveText: paintCursorAboveText,
                    backgroundCursorColor: CupertinoColors.inactiveGray,
                    enableInteractiveSelection: widget.enableInteractiveSelection,
                    dragStartBehavior: widget.dragStartBehavior,
                    scrollPhysics: widget.scrollPhysics
                    )
                );

            return(_selectionGestureDetectorBuilder.buildGestureDetector(
                       behavior: HitTestBehavior.translucent,
                       child: child
                       ));
        }
Ejemplo n.º 30
0
        public override Widget build(BuildContext context)
        {
            List <Widget> _gestureChildren  = new List <Widget>();
            List <Color>  _backgroundColors = new List <Color>();
            int           index             = 0;
            int           selectedIndex     = 0;
            int           pressedIndex      = 0;

            foreach (T currentKey in widget.children.Keys)
            {
                selectedIndex = (widget.groupValue.Equals(currentKey)) ? index : selectedIndex;
                pressedIndex  = (_pressedKey.Equals(currentKey)) ? index : pressedIndex;
                TextStyle textStyle = DefaultTextStyle.of(context).style.copyWith(
                    color: getTextColor(index, currentKey)
                    );
                IconThemeData iconTheme = new IconThemeData(
                    color: getTextColor(index, currentKey)
                    );

                Widget child = new Center(
                    child: widget.children[currentKey]
                    );

                child = new GestureDetector(
                    onTapDown: (TapDownDetails _event) => {
                    _onTapDown(currentKey);
                },
                    onTapCancel: _onTapCancel,
                    onTap: () => {
                    _onTap(currentKey);
                },
                    child: new IconTheme(
                        data: iconTheme,
                        child: new DefaultTextStyle(
                            style: textStyle,
                            child: child
                            )
                        )
                    );

                _backgroundColors.Add(getBackgroundColor(index, currentKey));
                _gestureChildren.Add(child);
                index += 1;
            }

            Widget box = new _SegmentedControlRenderWidget <T>(
                children: _gestureChildren,
                selectedIndex: selectedIndex,
                pressedIndex: pressedIndex,
                backgroundColors: _backgroundColors,
                borderColor: _borderColor
                );

            return(new Padding(
                       padding: widget.padding ?? CupertinoSegmentedControlsUtils._kHorizontalItemPadding,
                       child: new UnconstrainedBox(
                           constrainedAxis: Axis.horizontal,
                           child: box
                           )
                       ));
        }