home_page.dart 5.0 KB

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