123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- // import 'package:crab_ui/email.dart';
- import 'api_service.dart';
- import 'package:flutter/material.dart';
- import 'email.dart';
- import 'api_service.dart';
- import 'dart:html' as html;
- import 'dart:ui_web' as ui;
- class HomeScreen extends StatefulWidget {
- @override
- _HomeScreenState createState() => _HomeScreenState();
- }
- class _HomeScreenState extends State<HomeScreen> {
- @override
- void initState() {
- super.initState();
- }
- bool _isSidebarOpen = true;
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: Stack(
- children: [
- Row(
- children: [
- // Sidebar
- if (_isSidebarOpen)
- Container(
- width: 70,
- color: Color.fromARGB(17, 96, 122, 135),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- ListTile(
- leading: Icon(Icons.home),
- onTap: () {
- // Navigate to Home
- },
- ),
- ListTile(
- leading: Icon(Icons.settings),
- onTap: () {
- // Navigate to Settings
- },
- ),
- ListTile(
- leading: Icon(Icons.email),
- onTap: () {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => EmailPage()),
- );
- },
- ),
- Spacer(),
- Padding(
- padding: const EdgeInsets.all(8.0),
- child: Align(
- alignment: Alignment.bottomLeft,
- child: IconButton(
- icon: Icon(Icons.close, color: Colors.white),
- onPressed: () {
- setState(() {
- _isSidebarOpen = false;
- });
- },
- ),
- ),
- ),
- ],
- ),
- ),
- // Main content
- Expanded(
- child: Column(
- children: [
- Container(
- padding: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 4.0),
- color: Color.fromARGB(42, 36, 102, 132),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Container(
- width: 800,
- height: 40,
- child: TextField(
- decoration: InputDecoration(
- hintText: 'Search...',
- border: OutlineInputBorder(),
- prefixIcon: Icon(Icons.search),
- ),
- ),
- ),
- ],
- ),
- ),
- Container(
- padding: EdgeInsets.all(0.0),
- color: Color.fromARGB(42, 36, 102, 132),
- child: Row(
- children: [
- Container(
- height: 2,
- )
- ],
- ),
- ),
- Container(
- padding: EdgeInsets.all(8.0),
- color: Colors.white,
- child: Row(
- children: [
- Container(
- child: Text('hiiiiiii'),
- ),
- ],
- ),
- ),
- // Expanded(
- // child: Center(
- // child: EmailPage(),
- // ),
- // )
- ],
- ),
- ),
- ],
- ),
- if (!_isSidebarOpen)
- Positioned(
- bottom: 16,
- left: 16,
- child: FloatingActionButton(
- child: Icon(Icons.menu),
- onPressed: () {
- setState(() {
- _isSidebarOpen = true;
- });
- },
- ),
- ),
- ],
- ),
- );
- }
- }
|