Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. Tabs.dart-
  2. class Tabs extends StatelessWidget {
  3. @override
  4. Widget build(BuildContext context) {
  5. return Row(
  6. crossAxisAlignment: CrossAxisAlignment.end,
  7. children: <Widget>[
  8. SizedBox(width: 24),
  9. MyTab(text: 'Nearby', isSelected: false),
  10. MyTab(text: 'Recent', isSelected: true),
  11. MyTab(text: 'Notice', isSelected: false),
  12. ],
  13. );
  14. }
  15. }
  16.  
  17. class MyTab extends StatelessWidget {
  18. final String text;
  19. final bool isSelected;
  20.  
  21. const MyTab({Key key, @required this.isSelected, @required this.text})
  22. : super(key: key);
  23.  
  24. @override
  25. Widget build(BuildContext context) {
  26. return Padding(
  27. padding: const EdgeInsets.all(8.0),
  28. child: Column(
  29. crossAxisAlignment: CrossAxisAlignment.start,
  30. children: <Widget>[
  31. Text(
  32. text,
  33. style: TextStyle(
  34. fontSize: isSelected ? 16 : 14,
  35. color: isSelected ? Colors.black : Colors.grey,
  36. fontWeight: isSelected ? FontWeight.w600 : FontWeight.w500,
  37. ),
  38. ),
  39. Container(
  40. height: 6,
  41. width: 20,
  42. decoration: BoxDecoration(
  43. borderRadius: BorderRadius.circular(4),
  44. color: isSelected ? Color(0xFFFF5A1D) : Colors.white,
  45. ),
  46. )
  47. ],
  48. ),
  49. );
  50. }
  51. }
  52.  
  53. class HomePage extends StatelessWidget {
  54. @override
  55. Widget build(BuildContext context) {
  56. return Scaffold(
  57. backgroundColor: Colors.white,
  58. body: Stack(
  59. children: <Widget>[
  60. SafeArea(
  61. child: Column(
  62. crossAxisAlignment: CrossAxisAlignment.start,
  63. children: <Widget>[
  64. SizedBox(height: 8),
  65. Header(),
  66. SizedBox(height: 40),
  67. Tabs(),
  68. SizedBox(height: 8),
  69. SlidingCardsView(),
  70. ],
  71. ),
  72. ),
  73. ],
  74. ),
  75. );
  76. }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement