home_page.dart 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. import 'package:crab_ui/email.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter_html/flutter_html.dart';
  4. import 'api_service.dart';
  5. class HomeScreen extends StatefulWidget {
  6. @override
  7. _HomeScreenState createState() => _HomeScreenState();
  8. }
  9. class _HomeScreenState extends State<HomeScreen> {
  10. bool _isSidebarOpen = true;
  11. @override
  12. Widget build(BuildContext context) {
  13. return Scaffold(
  14. body: Stack(
  15. children: [
  16. Row(
  17. children: [
  18. // Sidebar
  19. if (_isSidebarOpen)
  20. Container(
  21. width: 70,
  22. color: Color.fromARGB(17, 96, 122, 135),
  23. child: Column(
  24. crossAxisAlignment: CrossAxisAlignment.start,
  25. children: [
  26. ListTile(
  27. leading: Icon(Icons.home),
  28. onTap: () {
  29. // Navigate to Home
  30. },
  31. ),
  32. ListTile(
  33. leading: Icon(Icons.settings),
  34. onTap: () {
  35. // Navigate to Settings
  36. },
  37. ),
  38. Spacer(),
  39. Padding(
  40. padding: const EdgeInsets.all(8.0),
  41. child: Align(
  42. alignment: Alignment.bottomLeft,
  43. child: IconButton(
  44. icon: Icon(Icons.close, color: Colors.white),
  45. onPressed: () {
  46. setState(() {
  47. _isSidebarOpen = false;
  48. });
  49. },
  50. ),
  51. ),
  52. ),
  53. ],
  54. ),
  55. ),
  56. // Main content
  57. Expanded(
  58. child: Column(
  59. children: [
  60. Container(
  61. padding: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 4.0),
  62. color: Color.fromARGB(42, 36, 102, 132),
  63. child: Row(
  64. mainAxisAlignment: MainAxisAlignment.center,
  65. children: [
  66. Container(
  67. width: 800,
  68. height: 40,
  69. child: TextField(
  70. decoration: InputDecoration(
  71. hintText: 'Search...',
  72. border: OutlineInputBorder(),
  73. prefixIcon: Icon(Icons.search),
  74. ),
  75. ),
  76. ),
  77. ],
  78. ),
  79. ),
  80. Container(
  81. padding: EdgeInsets.all(0.0),
  82. color: Color.fromARGB(42, 36, 102, 132),
  83. child: Row(
  84. children: [
  85. Container(
  86. height: 2,
  87. )
  88. ],
  89. ),
  90. ),
  91. Container(
  92. padding: EdgeInsets.all(8.0),
  93. color: Colors.white,
  94. child: Row(
  95. children: [
  96. Container(
  97. child: Text('hiiiiiii'),
  98. ),
  99. ],
  100. ),
  101. ),
  102. Expanded(
  103. child: Center(
  104. child: EmailPage(),
  105. ),
  106. )
  107. ],
  108. ),
  109. ),
  110. ],
  111. ),
  112. if (!_isSidebarOpen)
  113. Positioned(
  114. bottom: 16,
  115. left: 16,
  116. child: FloatingActionButton(
  117. child: Icon(Icons.menu),
  118. onPressed: () {
  119. setState(() {
  120. _isSidebarOpen = true;
  121. });
  122. },
  123. ),
  124. ),
  125. ],
  126. ),
  127. );
  128. }
  129. }