Example #1
0
 Widget _buildCountdownTimerPicker(BuildContext context)
 {
     return(new GestureDetector(
                onTap: () =>
     {
         CupertinoRouteUtils.showCupertinoModalPopup(
             context: context,
             semanticsDismissible: true,
             builder: (BuildContext context1) =>
         {
             return new _BottomPicker(
                 child: new CupertinoTimerPicker(
                     backgroundColor: CupertinoColors.systemBackground.resolveFrom(context1),
                     initialTimerDuration: timer,
                     onTimerDurationChanged: (TimeSpan newTimer) => {
                 setState(() => timer = newTimer);
             }
                     )
                 );
         }
             );
     },
                child: new _Menu(
                    children: new List <Widget> {
         new Text("Countdown Timer"),
         new Text(
             $"{timer.Hours}:" +
             $"{(timer.Minutes % 60).ToString("00")}:" +
             $"{(timer.Seconds % 60).ToString("00")}",
             style: new TextStyle(color: CupertinoDynamicColor.resolve(CupertinoColors.inactiveGray, context))
             ),
     }
                    )
                ));
 }
Example #2
0
 Widget _buildDateAndTimePicker(BuildContext context)
 {
     return(new GestureDetector(
                onTap: () => {
         CupertinoRouteUtils.showCupertinoModalPopup(
             context: context,
             semanticsDismissible: true,
             builder: (BuildContext context1) => {
             return new _BottomPicker(
                 child: new CupertinoDatePicker(
                     backgroundColor: CupertinoColors.systemBackground.resolveFrom(context1),
                     mode: CupertinoDatePickerMode.dateAndTime,
                     initialDateTime: dateTime,
                     onDateTimeChanged: (newDateTime) => {
                 setState(() => dateTime = newDateTime);
             }
                     )
                 );
         }
             );
     },
                child: new _Menu(
                    children: new List <Widget> {
         new Text("Date and Time"),
         new Text(
             dateTime.ToString("MMMM dd, yyyy") + " " + dateTime.ToString("HH:mm tt"),
             style: new TextStyle(color: CupertinoDynamicColor.resolve(CupertinoColors.inactiveGray, context))
             ),
     }
                    )
                ));
 }
 public override RenderObject createRenderObject(BuildContext context)
 {
     return(new _RenderSlidingSegmentedControl <T>(
                selectedIndex: selectedIndex,
                thumbColor: CupertinoDynamicColor.resolve(thumbColor, context),
                state: state
                ));
 }
Example #4
0
        Widget _buildColorPicker(BuildContext context)
        {
            FixedExtentScrollController scrollController = new FixedExtentScrollController(initialItem: _selectedColorIndex);

            List <Widget> widgets = new List <Widget>();

            for (int i = 0; i < CupertinoPickerDemoUtils.coolColorNames.Count; i++)
            {
                widgets.Add(new Center(
                                child: new Text(CupertinoPickerDemoUtils.coolColorNames[i])
                                ));
            }

            return(new GestureDetector(
                       onTap: () => {
                CupertinoRouteUtils.showCupertinoModalPopup(
                    context: context,
                    semanticsDismissible: true,
                    builder: (BuildContext context1) => {
                    return new _BottomPicker(
                        child: new CupertinoPicker(
                            scrollController: scrollController,
                            itemExtent: CupertinoPickerDemoUtils._kPickerItemHeight,
                            backgroundColor: CupertinoColors.systemBackground.resolveFrom(context1),
                            onSelectedItemChanged: (int index) => {
                        setState(() => _selectedColorIndex = index);
                    },
                            children: widgets
                            )
                        );
                }
                    );
            },
                       child: new _Menu(
                           children: new List <Widget> {
                new Text("Favorite Color"),
                new Text(
                    CupertinoPickerDemoUtils.coolColorNames[_selectedColorIndex],
                    style: new TextStyle(color: CupertinoDynamicColor.resolve(CupertinoColors.inactiveGray, context))
                    )
            }
                           )
                       ));
        }
Example #5
0
        public override Widget build(BuildContext context)
        {
            Color backgroundColor = null;
            Color foregroundColor = null;

            switch (color)
            {
            case Tab2ConversationBubbleColor.gray:
                backgroundColor = CupertinoDynamicColor.resolve(CupertinoColors.systemFill, context);
                foregroundColor = CupertinoDynamicColor.resolve(CupertinoColors.label, context);
                break;

            case Tab2ConversationBubbleColor.blue:
                backgroundColor = CupertinoTheme.of(context).primaryColor;
                foregroundColor = CupertinoColors.white;
                break;
            }

            return(new Container(
                       decoration: new BoxDecoration(
                           borderRadius: BorderRadius.all(Radius.circular(18.0f)),
                           color: backgroundColor
                           ),
                       margin: EdgeInsets.symmetric(horizontal: 8.0f, vertical: 8.0f),
                       padding: EdgeInsets.symmetric(horizontal: 14.0f, vertical: 10.0f),
                       child: new Text(
                           text,
                           style: new TextStyle(
                               color: foregroundColor,
                               letterSpacing: -0.4f,
                               fontSize: 15.0f,
                               fontWeight: FontWeight.w400
                               )
                           )
                       ));
        }
Example #6
0
 public override Widget build(BuildContext context)
 {
     return(new Container(
                color: CupertinoDynamicColor.resolve(CupertinoColors.systemBackground, context),
                height: 60.0f,
                padding: EdgeInsets.only(top: 9.0f),
                child: new Row(
                    children: new List <Widget> {
         new Container(
             width: 38.0f,
             child: called
             ? new Align(
                 alignment: Alignment.topCenter,
                 child: new Icon(
                     CupertinoIcons.phone_solid,
                     color: CupertinoColors.inactiveGray.resolveFrom(context),
                     size: 18.0f
                     )
                 )
             : null
             ),
         new Expanded(
             child: new Container(
                 decoration: new  BoxDecoration(
                     border: new Border(
                         bottom: new BorderSide(color: new Color(0xFFBCBBC1), width: 0.0f)
                         )
                     ),
                 padding: EdgeInsets.only(left: 1.0f, bottom: 9.0f, right: 10.0f),
                 child: new Row(
                     children: new List <Widget> {
             new Expanded(
                 child: new Column(
                     crossAxisAlignment: CrossAxisAlignment.start,
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                     children: new List <Widget> {
                 new Text(
                     name ?? "",
                     maxLines: 1,
                     overflow: TextOverflow.ellipsis,
                     style: new TextStyle(
                         fontWeight: FontWeight.w600,
                         letterSpacing: -0.18f
                         )
                     ),
                 new Text(
                     place ?? "",
                     maxLines: 1,
                     overflow: TextOverflow.ellipsis,
                     style: new TextStyle(
                         fontSize: 15.0f,
                         letterSpacing: -0.24f,
                         color: CupertinoColors.inactiveGray.resolveFrom(context)
                         )
                     ),
             }
                     )
                 ),
             new Text(
                 date ?? "",
                 style: new TextStyle(
                     color: CupertinoColors.inactiveGray.resolveFrom(context),
                     fontSize: 15.0f,
                     letterSpacing: -0.41f
                     )
                 ),
             new Padding(
                 padding: EdgeInsets.only(left: 9.0f),
                 child: new Icon(
                     CupertinoIcons.info,
                     color: CupertinoTheme.of(context).primaryColor
                     )
                 )
         }
                     )
                 )
             )
     }
                    )
                ));
 }
 public override void updateRenderObject(BuildContext context, RenderObject renderObject)
 {
     renderObject = (_RenderSlidingSegmentedControl <T>)renderObject;
     ((_RenderSlidingSegmentedControl <T>)renderObject).thumbColor = CupertinoDynamicColor.resolve(thumbColor, context);
     ((_RenderSlidingSegmentedControl <T>)renderObject).guardedSetHighlightedIndex(selectedIndex ?? 0);
 }
Example #8
0
 public override Widget build(BuildContext context)
 {
     return(new Padding(
                padding: EdgeInsets.all(16.0f),
                child: new SafeArea(
                    top: false,
                    bottom: false,
                    child: new ClipRRect(
                        borderRadius: BorderRadius.all(Radius.circular(16.0f)),
                        child: new Column(
                            mainAxisSize: MainAxisSize.min,
                            children: new List <Widget>
     {
         new Container(
             decoration: new BoxDecoration(
                 color: CupertinoDynamicColor.resolve(CupertinoColors.systemFill, context)
                 ),
             child: new Padding(
                 padding: EdgeInsets.symmetric(horizontal: 18.0f, vertical: 12.0f),
                 child: new Row(
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                     children: new List <Widget>
         {
             new Text(
                 "SUPPORT TICKET",
                 style: new TextStyle(
                     color: new Color(0xFF646464),
                     letterSpacing: -0.9f,
                     fontSize: 14.0f,
                     fontWeight: FontWeight.w500
                     )
                 ),
             new Text(
                 "Show More",
                 style: new TextStyle(
                     color: CupertinoDynamicColor.resolve(CupertinoColors.secondaryLabel, context),
                     letterSpacing: -0.6f,
                     fontSize: 12.0f,
                     fontWeight: FontWeight.w500
                     )
                 )
         }
                     )
                 )
             ),
         new Container(
             decoration: new BoxDecoration(
                 color: CupertinoDynamicColor.resolve(CupertinoColors.quaternarySystemFill, context)
                 ),
             child: new Padding(
                 padding: EdgeInsets.symmetric(horizontal: 18.0f, vertical: 12.0f),
                 child: new Column(
                     crossAxisAlignment: CrossAxisAlignment.start,
                     children: new List <Widget>
         {
             new Text(
                 "Product or product packaging damaged during transit",
                 style: new TextStyle(
                     fontSize: 16.0f,
                     fontWeight: FontWeight.w700,
                     letterSpacing: -0.46f
                     )
                 ),
             new Padding(padding: EdgeInsets.only(top: 16.0f)),
             new Text(
                 "REVIEWERS",
                 style: new TextStyle(
                     color: new Color(0xFF646464),
                     fontSize: 12.0f,
                     letterSpacing: -0.6f,
                     fontWeight: FontWeight.w500
                     )
                 ),
             new Padding(padding: EdgeInsets.only(top: 8.0f)),
             new Row(
                 children: new List <Widget>
             {
                 new Container(
                     width: 44.0f,
                     height: 44.0f,
                     decoration: new BoxDecoration(
                         image: new DecorationImage(
                             image: new FileImage(
                                 file: "gallery/people/square/trevor.png"
                                 )
                             ),
                         shape: BoxShape.circle
                         )
                     ),
                 new Padding(padding: EdgeInsets.only(left: 8.0f)),
                 new Container(
                     width: 44.0f,
                     height: 44.0f,
                     decoration: new BoxDecoration(
                         image: new DecorationImage(
                             image: new FileImage(
                                 "gallery/people/square/sandra.png"
                                 )
                             ),
                         shape: BoxShape.circle
                         )
                     ),
                 new Padding(padding: EdgeInsets.only(left: 2.0f)),
                 new Icon(
                     CupertinoIcons.check_mark_circled,
                     color: new Color(0xFF646464),
                     size: 20.0f
                     )
             }
                 )
         }
                     )
                 )
             )
     }
                            )
                        )
                    )
                ));
 }
Example #9
0
 public override Widget build(BuildContext context)
 {
     return(new CupertinoPageScaffold(
                navigationBar: new CupertinoNavigationBar(
                    trailing: new ExitButton()
                    ),
                child: new SafeArea(
                    top: false,
                    bottom: false,
                    child: new ListView(
                        children: new List <Widget> {
         new Padding(padding: EdgeInsets.only(top: 16.0f)),
         new Padding(
             padding: EdgeInsets.symmetric(horizontal: 16.0f),
             child: new Row(
                 mainAxisSize: MainAxisSize.max,
                 children: new List <Widget> {
             new Container(
                 height: 128.0f,
                 width: 128.0f,
                 decoration: new BoxDecoration(
                     color: widget.color,
                     borderRadius: BorderRadius.circular(24.0f)
                     )
                 ),
             new Padding(padding: EdgeInsets.only(left: 18.0f)),
             new Expanded(
                 child: new Column(
                     crossAxisAlignment: CrossAxisAlignment.start,
                     mainAxisSize: MainAxisSize.min,
                     children: new List <Widget> {
                 new Text(widget.colorName,
                          style: new TextStyle(fontSize: 24.0f,
                                               fontWeight: FontWeight.bold)
                          ),
                 new Padding(padding: EdgeInsets.only(top: 6.0f)),
                 new Text(
                     $"Item number {widget.index}",
                     style: new TextStyle(
                         color:  CupertinoDynamicColor.resolve(CupertinoColors.secondaryLabel, context),
                         fontSize: 16.0f,
                         fontWeight: FontWeight.w100
                         )
                     ),
                 new Padding(padding: EdgeInsets.only(top: 20.0f)),
                 new Row(
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                     children: new List <Widget> {
                     CupertinoButton.filled(
                         minSize: 30.0f,
                         padding: EdgeInsets.symmetric(horizontal: 24.0f),
                         borderRadius: BorderRadius.circular(16.0f),
                         child: new Text(
                             "GET",
                             style: new TextStyle(
                                 fontSize: 14.0f,
                                 fontWeight: FontWeight.w700,
                                 letterSpacing: -0.28f
                                 )
                             ),
                         onPressed: () => { }
                         ),
                     CupertinoButton.filled(
                         minSize: 30.0f,
                         padding: EdgeInsets.zero,
                         borderRadius: BorderRadius.circular(32.0f),
                         child: new Icon(CupertinoIcons.ellipsis),
                         onPressed: () => { }
                         )
                 }
                     )
             }
                     )
                 )
         }
                 )
             ),
         new Padding(
             padding: EdgeInsets.only(left: 16.0f, top: 28.0f, bottom: 8.0f),
             child: new Text(
                 "USERS ALSO LIKED",
                 style: new TextStyle(
                     color: new Color(0xFF646464),
                     letterSpacing: -0.60f,
                     fontSize: 15.0f,
                     fontWeight: FontWeight.w500
                     )
                 )
             ),
         new SizedBox(
             height: 200.0f,
             child: ListView.builder(
                 scrollDirection: Axis.horizontal,
                 itemCount: 10,
                 itemExtent: 160.0f,
                 itemBuilder: (BuildContext _context, int index) => {
             return new Padding(
                 padding: EdgeInsets.only(left: 16.0f),
                 child: new Container(
                     decoration: new BoxDecoration(
                         borderRadius: BorderRadius.circular(8.0f),
                         color: relatedColors[index]
                         ),
                     child: new Center(
                         child: new CupertinoButton(
                             child: new Icon(
                                 CupertinoIcons.plus_circled,
                                 color: CupertinoColors.white,
                                 size: 36.0f
                                 ),
                             onPressed: () => { }
                             )
                         )
                     )
                 );
         }
                 )
             )
     }
                        )
                    )
                ));
 }
Example #10
0
        public override Widget build(BuildContext context)
        {
            Widget row = new GestureDetector(
                behavior: HitTestBehavior.opaque,
                onTap: () =>
            {
                Navigator.of(context).push(new CupertinoPageRoute(
                                               title: colorName,
                                               builder: (BuildContext _context) => new Tab1ItemPage(
                                                   color: color,
                                                   colorName: colorName,
                                                   index: index
                                                   )
                                               ));
            },
                child: new Container(
                    color: CupertinoDynamicColor.resolve(CupertinoColors.systemBackground, context),
                    child: new SafeArea(
                        top: false,
                        bottom: false,
                        child: new Padding(
                            padding: EdgeInsets.only(left: 16.0f, top: 8.0f, bottom: 8.0f, right: 8.0f),
                            child: new Row(
                                children: new List <Widget>
            {
                new Container(
                    height: 60.0f,
                    width: 60.0f,
                    decoration: new BoxDecoration(
                        color: color,
                        borderRadius: BorderRadius.circular(8.0f)
                        )
                    ),
                new Expanded(
                    child: new Padding(
                        padding: EdgeInsets.symmetric(horizontal: 12.0f),
                        child: new Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: new List <Widget>
                {
                    new Text(colorName),
                    new Padding(padding: EdgeInsets.only(top: 8.0f)),
                    new Text(
                        "Buy this cool color",
                        style: new TextStyle(
                            color: CupertinoDynamicColor.resolve(
                                CupertinoColors.secondaryLabel, context),
                            fontSize: 13.0f,
                            fontWeight: FontWeight.w300
                            )
                        )
                }
                            )
                        )
                    ),
                new CupertinoButton(
                    padding: EdgeInsets.zero,
                    child: new Icon(CupertinoIcons.plus_circled
                                    ),
                    onPressed: () => { }
                    ),
                new CupertinoButton(
                    padding: EdgeInsets.zero,
                    child: new Icon(CupertinoIcons.share
                                    ),
                    onPressed: () => { }
                    )
            }
                                )
                            )
                        )
                    )
                );

            if (lastItem)
            {
                return(row);
            }

            return(new Column(
                       children: new List <Widget> {
                row,
                new Container(
                    height: 1.0f,
                    color: CupertinoDynamicColor.resolve(CupertinoColors.separator, context)
                    )
            }
                       ));
        }