cupertino_navigation_demo.dart 25.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:async';
import 'dart:math' as math;

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

11 12
import '../../gallery/demo.dart';

13 14
const String _kGalleryAssetsPackage = 'flutter_gallery_assets';

15 16 17 18 19 20 21 22 23
const List<Color> coolColors = <Color>[
  Color.fromARGB(255, 255, 59, 48),
  Color.fromARGB(255, 255, 149, 0),
  Color.fromARGB(255, 255, 204, 0),
  Color.fromARGB(255, 76, 217, 100),
  Color.fromARGB(255, 90, 200, 250),
  Color.fromARGB(255, 0, 122, 255),
  Color.fromARGB(255, 88, 86, 214),
  Color.fromARGB(255, 255, 45, 85),
24 25
];

26
const List<String> coolColorNames = <String>[
27 28
  'Sarcoline', 'Coquelicot', 'Smaragdine', 'Mikado', 'Glaucous', 'Wenge',
  'Fulvous', 'Xanadu', 'Falu', 'Eburnean', 'Amaranth', 'Australien',
Josh Soref's avatar
Josh Soref committed
29
  'Banan', 'Falu', 'Gingerline', 'Incarnadine', 'Labrador', 'Nattier',
30 31 32
  'Pervenche', 'Sinoper', 'Verditer', 'Watchet', 'Zaffre',
];

33 34
const int _kChildCount = 50;

35 36
class CupertinoNavigationDemo extends StatelessWidget {
  CupertinoNavigationDemo()
37
      : colorItems = List<Color>.generate(_kChildCount, (int index) {
38
          return coolColors[math.Random().nextInt(coolColors.length)];
39
        }) ,
40
        colorNameItems = List<String>.generate(_kChildCount, (int index) {
41
          return coolColorNames[math.Random().nextInt(coolColorNames.length)];
42 43 44 45 46 47 48 49 50
        });

  static const String routeName = '/cupertino/navigation';

  final List<Color> colorItems;
  final List<String> colorNameItems;

  @override
  Widget build(BuildContext context) {
51
    return WillPopScope(
52
      // Prevent swipe popping of this page. Use explicit exit buttons only.
53 54
      onWillPop: () => Future<bool>.value(true),
      child: DefaultTextStyle(
xster's avatar
xster committed
55
        style: CupertinoTheme.of(context).textTheme.textStyle,
56 57
        child: CupertinoTabScaffold(
          tabBar: CupertinoTabBar(
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
            items: const <BottomNavigationBarItem>[
              BottomNavigationBarItem(
                icon: Icon(CupertinoIcons.home),
                title: Text('Home'),
              ),
              BottomNavigationBarItem(
                icon: Icon(CupertinoIcons.conversation_bubble),
                title: Text('Support'),
              ),
              BottomNavigationBarItem(
                icon: Icon(CupertinoIcons.profile_circled),
                title: Text('Profile'),
              ),
            ],
          ),
          tabBuilder: (BuildContext context, int index) {
74
            assert(index >= 0 && index <= 2);
75 76
            switch (index) {
              case 0:
77
                return CupertinoTabView(
78
                  builder: (BuildContext context) {
79
                    return CupertinoDemoTab1(
80 81 82
                      colorItems: colorItems,
                      colorNameItems: colorNameItems
                    );
83 84 85 86 87
                  },
                  defaultTitle: 'Colors',
                );
                break;
              case 1:
88
                return CupertinoTabView(
89 90 91 92 93
                  builder: (BuildContext context) => CupertinoDemoTab2(),
                  defaultTitle: 'Support Chat',
                );
                break;
              case 2:
94
                return CupertinoTabView(
95 96 97 98 99
                  builder: (BuildContext context) => CupertinoDemoTab3(),
                  defaultTitle: 'Account',
                );
                break;
            }
100
            return null;
101 102
          },
        ),
103 104 105 106 107 108 109 110 111 112
      ),
    );
  }
}

class ExitButton extends StatelessWidget {
  const ExitButton();

  @override
  Widget build(BuildContext context) {
113
    return CupertinoButton(
114 115 116
      padding: EdgeInsets.zero,
      child: const Tooltip(
        message: 'Back',
117
        child: Text('Exit'),
118
        excludeFromSemantics: true,
119 120 121 122 123 124 125 126 127
      ),
      onPressed: () {
        // The demo is on the root navigator.
        Navigator.of(context, rootNavigator: true).pop();
      },
    );
  }
}

128 129 130 131 132 133 134 135 136
final Widget trailingButtons = Row(
  mainAxisSize: MainAxisSize.min,
  children: <Widget>[
    CupertinoDemoDocumentationButton(CupertinoNavigationDemo.routeName),
    const Padding(padding: EdgeInsets.only(left: 8.0)),
    const ExitButton(),
  ],
);

137 138 139 140 141 142 143 144
class CupertinoDemoTab1 extends StatelessWidget {
  const CupertinoDemoTab1({this.colorItems, this.colorNameItems});

  final List<Color> colorItems;
  final List<String> colorNameItems;

  @override
  Widget build(BuildContext context) {
145 146
    return CupertinoPageScaffold(
      child: CustomScrollView(
147
        semanticChildCount: _kChildCount,
148
        slivers: <Widget>[
149 150
          CupertinoSliverNavigationBar(
            trailing: trailingButtons,
151
          ),
152
          SliverPadding(
153 154 155 156 157 158 159
            // Top media padding consumed by CupertinoSliverNavigationBar.
            // Left/Right media padding consumed by Tab1RowItem.
            padding: MediaQuery.of(context).removePadding(
              removeTop: true,
              removeLeft: true,
              removeRight: true,
            ).padding,
160 161
            sliver: SliverList(
              delegate: SliverChildBuilderDelegate(
162
                (BuildContext context, int index) {
163
                  return Tab1RowItem(
164
                    index: index,
165
                    lastItem: index == _kChildCount - 1,
166 167 168 169
                    color: colorItems[index],
                    colorName: colorNameItems[index],
                  );
                },
170
                childCount: _kChildCount,
171
              ),
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
            ),
          ),
        ],
      ),
    );
  }
}

class Tab1RowItem extends StatelessWidget {
  const Tab1RowItem({this.index, this.lastItem, this.color, this.colorName});

  final int index;
  final bool lastItem;
  final Color color;
  final String colorName;

  @override
  Widget build(BuildContext context) {
190
    final Widget row = GestureDetector(
191 192
      behavior: HitTestBehavior.opaque,
      onTap: () {
193
        Navigator.of(context).push(CupertinoPageRoute<void>(
194
          title: colorName,
195
          builder: (BuildContext context) => Tab1ItemPage(
196 197 198 199 200 201
            color: color,
            colorName: colorName,
            index: index,
          ),
        ));
      },
202
      child: SafeArea(
203 204
        top: false,
        bottom: false,
205
        child: Padding(
206
          padding: const EdgeInsets.only(left: 16.0, top: 8.0, bottom: 8.0, right: 8.0),
207
          child: Row(
208
            children: <Widget>[
209
              Container(
210 211
                height: 60.0,
                width: 60.0,
212
                decoration: BoxDecoration(
213
                  color: color,
214
                  borderRadius: BorderRadius.circular(8.0),
215
                ),
216
              ),
217 218
              Expanded(
                child: Padding(
219
                  padding: const EdgeInsets.symmetric(horizontal: 12.0),
220
                  child: Column(
221 222
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: <Widget>[
223
                      Text(colorName),
224
                      const Padding(padding: EdgeInsets.only(top: 8.0)),
225 226
                      const Text(
                        'Buy this cool color',
227 228
                        style: TextStyle(
                          color: Color(0xFF8E8E93),
229 230 231
                          fontSize: 13.0,
                          fontWeight: FontWeight.w300,
                        ),
232
                      ),
233 234
                    ],
                  ),
235 236
                ),
              ),
237
              CupertinoButton(
238
                padding: EdgeInsets.zero,
239 240 241
                child: const Icon(CupertinoIcons.plus_circled,
                  semanticLabel: 'Add',
                ),
242 243
                onPressed: () { },
              ),
244
              CupertinoButton(
245
                padding: EdgeInsets.zero,
246 247 248
                child: const Icon(CupertinoIcons.share,
                  semanticLabel: 'Share',
                ),
249 250 251 252
                onPressed: () { },
              ),
            ],
          ),
253 254 255 256 257 258 259 260
        ),
      ),
    );

    if (lastItem) {
      return row;
    }

261
    return Column(
262 263
      children: <Widget>[
        row,
264
        Container(
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280
          height: 1.0,
          color: const Color(0xFFD9D9D9),
        ),
      ],
    );
  }
}

class Tab1ItemPage extends StatefulWidget {
  const Tab1ItemPage({this.color, this.colorName, this.index});

  final Color color;
  final String colorName;
  final int index;

  @override
281
  State<StatefulWidget> createState() => Tab1ItemPageState();
282 283 284 285 286 287
}

class Tab1ItemPageState extends State<Tab1ItemPage> {
  @override
  void initState() {
    super.initState();
288 289 290
    relatedColors = List<Color>.generate(10, (int index) {
      final math.Random random = math.Random();
      return Color.fromARGB(
291 292 293 294 295 296 297 298 299 300 301 302
        255,
      (widget.color.red + random.nextInt(100) - 50).clamp(0, 255),
        (widget.color.green + random.nextInt(100) - 50).clamp(0, 255),
        (widget.color.blue + random.nextInt(100) - 50).clamp(0, 255),
      );
    });
  }

  List<Color> relatedColors;

  @override
  Widget build(BuildContext context) {
303
    return CupertinoPageScaffold(
304 305
      navigationBar: const CupertinoNavigationBar(
        trailing: ExitButton(),
306
      ),
307
      child: SafeArea(
308 309
        top: false,
        bottom: false,
310
        child: ListView(
311
          children: <Widget>[
312
            const Padding(padding: EdgeInsets.only(top: 16.0)),
313
            Padding(
314
              padding: const EdgeInsets.symmetric(horizontal: 16.0),
315
              child: Row(
316 317
                mainAxisSize: MainAxisSize.max,
                children: <Widget>[
318
                  Container(
319 320
                    height: 128.0,
                    width: 128.0,
321
                    decoration: BoxDecoration(
322
                      color: widget.color,
323
                      borderRadius: BorderRadius.circular(24.0),
324
                    ),
325
                  ),
326
                  const Padding(padding: EdgeInsets.only(left: 18.0)),
327 328
                  Expanded(
                    child: Column(
329 330 331
                      crossAxisAlignment: CrossAxisAlignment.start,
                      mainAxisSize: MainAxisSize.min,
                      children: <Widget>[
332
                        Text(
333 334
                          widget.colorName,
                          style: const TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold),
335
                        ),
336
                        const Padding(padding: EdgeInsets.only(top: 6.0)),
337
                        Text(
338 339
                          'Item number ${widget.index}',
                          style: const TextStyle(
340
                            color: Color(0xFF8E8E93),
341 342 343 344
                            fontSize: 16.0,
                            fontWeight: FontWeight.w100,
                          ),
                        ),
345
                        const Padding(padding: EdgeInsets.only(top: 20.0)),
346
                        Row(
347 348
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: <Widget>[
xster's avatar
xster committed
349
                            CupertinoButton.filled(
350 351
                              minSize: 30.0,
                              padding: const EdgeInsets.symmetric(horizontal: 24.0),
352
                              borderRadius: BorderRadius.circular(32.0),
353 354
                              child: const Text(
                                'GET',
355
                                style: TextStyle(
356 357 358 359
                                  fontSize: 14.0,
                                  fontWeight: FontWeight.w700,
                                  letterSpacing: -0.28,
                                ),
360
                              ),
361
                              onPressed: () { },
362
                            ),
xster's avatar
xster committed
363
                            CupertinoButton.filled(
364 365
                              minSize: 30.0,
                              padding: EdgeInsets.zero,
366
                              borderRadius: BorderRadius.circular(32.0),
xster's avatar
xster committed
367
                              child: const Icon(CupertinoIcons.ellipsis),
368 369 370 371 372 373
                              onPressed: () { },
                            ),
                          ],
                        ),
                      ],
                    ),
374
                  ),
375 376
                ],
              ),
377
            ),
378
            const Padding(
379 380
              padding: EdgeInsets.only(left: 16.0, top: 28.0, bottom: 8.0),
              child: Text(
381
                'USERS ALSO LIKED',
382 383
                style: TextStyle(
                  color: Color(0xFF646464),
384 385 386 387
                  letterSpacing: -0.60,
                  fontSize: 15.0,
                  fontWeight: FontWeight.w500,
                ),
388 389
              ),
            ),
390
            SizedBox(
391
              height: 200.0,
392
              child: ListView.builder(
393 394 395 396
                scrollDirection: Axis.horizontal,
                itemCount: 10,
                itemExtent: 160.0,
                itemBuilder: (BuildContext context, int index) {
397
                  return Padding(
398
                    padding: const EdgeInsets.only(left: 16.0),
399 400 401
                    child: Container(
                      decoration: BoxDecoration(
                        borderRadius: BorderRadius.circular(8.0),
402 403
                        color: relatedColors[index],
                      ),
404 405
                      child: Center(
                        child: CupertinoButton(
406 407 408 409 410 411
                          child: const Icon(
                            CupertinoIcons.plus_circled,
                            color: CupertinoColors.white,
                            size: 36.0,
                          ),
                          onPressed: () { },
412 413 414
                        ),
                      ),
                    ),
415 416 417
                  );
                },
              ),
418
            ),
419 420
          ],
        ),
421 422 423 424 425 426 427 428
      ),
    );
  }
}

class CupertinoDemoTab2 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
429
    return CupertinoPageScaffold(
430 431
      navigationBar: CupertinoNavigationBar(
        trailing: trailingButtons,
432
      ),
433
      child: ListView(
434
        children: <Widget>[
435
          Tab2Header(),
436 437 438 439 440 441 442 443 444
        ]..addAll(buildTab2Conversation()),
      ),
    );
  }
}

class Tab2Header extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
445
    return Padding(
446
      padding: const EdgeInsets.all(16.0),
447
      child: SafeArea(
448 449
        top: false,
        bottom: false,
450
        child: ClipRRect(
451
          borderRadius: const BorderRadius.all(Radius.circular(16.0)),
452
          child: Column(
453 454
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
455
              Container(
456
                decoration: const BoxDecoration(
457
                  color: Color(0xFFE5E5E5),
458
                ),
459
                child: Padding(
460
                  padding: const EdgeInsets.symmetric(horizontal: 18.0, vertical: 12.0),
461
                  child: Row(
462
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
463
                    children: const <Widget>[
464
                      Text(
465
                        'SUPPORT TICKET',
466 467
                        style: TextStyle(
                          color: Color(0xFF646464),
468
                          letterSpacing: -0.9,
469 470 471
                          fontSize: 14.0,
                          fontWeight: FontWeight.w500,
                        ),
472
                      ),
473
                      Text(
474
                        'Show More',
475 476
                        style: TextStyle(
                          color: Color(0xFF646464),
477 478 479 480
                          letterSpacing: -0.6,
                          fontSize: 12.0,
                          fontWeight: FontWeight.w500,
                        ),
481
                      ),
482 483
                    ],
                  ),
484 485
                ),
              ),
486
              Container(
487
                decoration: const BoxDecoration(
488
                  color: Color(0xFFF3F3F3),
489
                ),
490
                child: Padding(
491
                  padding: const EdgeInsets.symmetric(horizontal: 18.0, vertical: 12.0),
492
                  child: Column(
493 494 495 496
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: <Widget>[
                      const Text(
                        'Product or product packaging damaged during transit',
497
                        style: TextStyle(
498
                          fontSize: 16.0,
499 500
                          fontWeight: FontWeight.w700,
                          letterSpacing: -0.46,
501
                        ),
502
                      ),
503
                      const Padding(padding: EdgeInsets.only(top: 16.0)),
504 505
                      const Text(
                        'REVIEWERS',
506 507
                        style: TextStyle(
                          color: Color(0xFF646464),
508 509 510 511
                          fontSize: 12.0,
                          letterSpacing: -0.6,
                          fontWeight: FontWeight.w500,
                        ),
512
                      ),
513
                      const Padding(padding: EdgeInsets.only(top: 8.0)),
514
                      Row(
515
                        children: <Widget>[
516
                          Container(
517 518 519
                            width: 44.0,
                            height: 44.0,
                            decoration: const BoxDecoration(
520 521
                              image: DecorationImage(
                                image: AssetImage(
522
                                  'people/square/trevor.png',
523
                                  package: _kGalleryAssetsPackage,
524
                                ),
525
                              ),
526
                              shape: BoxShape.circle,
527 528
                            ),
                          ),
529
                          const Padding(padding: EdgeInsets.only(left: 8.0)),
530
                          Container(
531 532 533
                            width: 44.0,
                            height: 44.0,
                            decoration: const BoxDecoration(
534 535
                              image: DecorationImage(
                                image: AssetImage(
536
                                  'people/square/sandra.png',
537
                                  package: _kGalleryAssetsPackage,
538
                                ),
539
                              ),
540
                              shape: BoxShape.circle,
541 542
                            ),
                          ),
543
                          const Padding(padding: EdgeInsets.only(left: 2.0)),
544 545
                          const Icon(
                            CupertinoIcons.check_mark_circled,
546
                            color: Color(0xFF646464),
547 548 549 550 551 552
                            size: 20.0,
                          ),
                        ],
                      ),
                    ],
                  ),
553 554
                ),
              ),
555 556
            ],
          ),
557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575
        ),
      ),
    );
  }
}

enum Tab2ConversationBubbleColor {
  blue,
  gray,
}

class Tab2ConversationBubble extends StatelessWidget {
  const Tab2ConversationBubble({this.text, this.color});

  final String text;
  final Tab2ConversationBubbleColor color;

  @override
  Widget build(BuildContext context) {
576 577
    return Container(
      decoration: BoxDecoration(
578
        borderRadius: const BorderRadius.all(Radius.circular(18.0)),
579 580 581 582 583 584
        color: color == Tab2ConversationBubbleColor.blue
            ? CupertinoColors.activeBlue
            : CupertinoColors.lightBackgroundGray,
      ),
      margin: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 8.0),
      padding: const EdgeInsets.symmetric(horizontal: 14.0, vertical: 10.0),
585
      child: Text(
586
        text,
587
        style: TextStyle(
588 589 590 591
          color: color == Tab2ConversationBubbleColor.blue
              ? CupertinoColors.white
              : CupertinoColors.black,
          letterSpacing: -0.4,
592 593
          fontSize: 15.0,
          fontWeight: FontWeight.w400,
594 595 596 597 598 599 600 601 602 603 604 605 606 607
        ),
      ),
    );
  }
}

class Tab2ConversationAvatar extends StatelessWidget {
  const Tab2ConversationAvatar({this.text, this.color});

  final String text;
  final Color color;

  @override
  Widget build(BuildContext context) {
608 609
    return Container(
      decoration: BoxDecoration(
610
        shape: BoxShape.circle,
611
        gradient: LinearGradient(
612 613 614 615
          begin: FractionalOffset.topCenter,
          end: FractionalOffset.bottomCenter,
          colors: <Color>[
            color,
616
            Color.fromARGB(
617 618 619 620 621 622 623 624 625 626
              color.alpha,
              (color.red - 60).clamp(0, 255),
              (color.green - 60).clamp(0, 255),
              (color.blue - 60).clamp(0, 255),
            ),
          ],
        ),
      ),
      margin: const EdgeInsets.only(left: 8.0, bottom: 8.0),
      padding: const EdgeInsets.all(12.0),
627
      child: Text(
628 629 630 631 632 633 634 635 636 637 638
        text,
        style: const TextStyle(
          color: CupertinoColors.white,
          fontSize: 13.0,
          fontWeight: FontWeight.w500,
        ),
      ),
    );
  }
}

639 640 641 642 643 644 645 646 647 648 649 650 651 652
class Tab2ConversationRow extends StatelessWidget {
  const Tab2ConversationRow({this.avatar, this.text});

  final Tab2ConversationAvatar avatar;
  final String text;

  @override
  Widget build(BuildContext context) {
    final List<Widget> children = <Widget>[];
    if (avatar != null)
      children.add(avatar);

    final bool isSelf = avatar == null;
    children.add(
653
      Tab2ConversationBubble(
654 655 656 657 658 659
        text: text,
        color: isSelf
          ? Tab2ConversationBubbleColor.blue
          : Tab2ConversationBubbleColor.gray,
      ),
    );
660 661
    return SafeArea(
      child: Row(
662 663 664 665 666
        mainAxisAlignment: isSelf ? MainAxisAlignment.end : MainAxisAlignment.start,
        mainAxisSize: MainAxisSize.min,
        crossAxisAlignment: isSelf ? CrossAxisAlignment.center : CrossAxisAlignment.end,
        children: children,
      ),
667 668 669 670
    );
  }
}

671 672
List<Widget> buildTab2Conversation() {
 return <Widget>[
673 674
    const Tab2ConversationRow(
      text: "My Xanadu doesn't look right",
675
    ),
676
    const Tab2ConversationRow(
677
      avatar: Tab2ConversationAvatar(
678
        text: 'KL',
679
        color: Color(0xFFFD5015),
680 681
      ),
      text: "We'll rush you a new one.\nIt's gonna be incredible",
682
    ),
683 684
    const Tab2ConversationRow(
      text: 'Awesome thanks!',
685
    ),
686
    const Tab2ConversationRow(
687
      avatar: Tab2ConversationAvatar(
688
        text: 'SJ',
689
        color: Color(0xFF34CAD6),
690
      ),
Josh Soref's avatar
Josh Soref committed
691
      text: "We'll send you our\nnewest Labrador too!",
692
    ),
693 694
    const Tab2ConversationRow(
      text: 'Yay',
695
    ),
696
    const Tab2ConversationRow(
697
      avatar: Tab2ConversationAvatar(
698
        text: 'KL',
699
        color: Color(0xFFFD5015),
700 701
      ),
      text: "Actually there's one more thing...",
702
    ),
703 704
    const Tab2ConversationRow(
      text: "What's that?",
705 706 707 708 709 710 711
    ),
  ];
}

class CupertinoDemoTab3 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
712
    return CupertinoPageScaffold(
713 714
      navigationBar: CupertinoNavigationBar(
        trailing: trailingButtons,
715
      ),
716
      child: DecoratedBox(
xster's avatar
xster committed
717 718 719 720 721
        decoration: BoxDecoration(
          color: CupertinoTheme.of(context).brightness == Brightness.light
              ? CupertinoColors.extraLightBackgroundGray
              : CupertinoColors.darkBackgroundGray,
        ),
722
        child: ListView(
723
          children: <Widget>[
724
            const Padding(padding: EdgeInsets.only(top: 32.0)),
725
            GestureDetector(
726 727
              onTap: () {
                Navigator.of(context, rootNavigator: true).push(
728
                  CupertinoPageRoute<bool>(
729
                    fullscreenDialog: true,
730
                    builder: (BuildContext context) => Tab3Dialog(),
731 732 733
                  ),
                );
              },
734
              child: Container(
xster's avatar
xster committed
735 736 737
                decoration: BoxDecoration(
                  color: CupertinoTheme.of(context).scaffoldBackgroundColor,
                  border: const Border(
738 739
                    top: BorderSide(color: Color(0xFFBCBBC1), width: 0.0),
                    bottom: BorderSide(color: Color(0xFFBCBBC1), width: 0.0),
740 741 742
                  ),
                ),
                height: 44.0,
743
                child: Padding(
744
                  padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
745
                  child: SafeArea(
746 747
                    top: false,
                    bottom: false,
748
                    child: Row(
xster's avatar
xster committed
749
                      children: <Widget>[
750
                        Text(
751
                          'Sign in',
xster's avatar
xster committed
752
                          style: TextStyle(color: CupertinoTheme.of(context).primaryColor),
753 754 755
                        )
                      ],
                    ),
756
                  ),
757 758 759 760 761 762 763 764 765 766 767 768 769
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}

class Tab3Dialog extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
770 771 772
    return CupertinoPageScaffold(
      navigationBar: CupertinoNavigationBar(
        leading: CupertinoButton(
773 774 775 776 777 778 779
          child: const Text('Cancel'),
          padding: EdgeInsets.zero,
          onPressed: () {
            Navigator.of(context).pop(false);
          },
        ),
      ),
780 781
      child: Center(
        child: Column(
782 783 784 785 786
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            const Icon(
              CupertinoIcons.profile_circled,
              size: 160.0,
787
              color: Color(0xFF646464),
788
            ),
789
            const Padding(padding: EdgeInsets.only(top: 18.0)),
xster's avatar
xster committed
790
            CupertinoButton.filled(
791 792
              child: const Text('Sign in'),
              onPressed: () {
793
                Navigator.pop(context);
794 795 796 797 798 799 800 801
              },
            ),
          ],
        ),
      ),
    );
  }
}