Browse Source

Initial dump, and side bar

juan 1 month ago
commit
961607f978
8 changed files with 160 additions and 0 deletions
  1. 16 0
      README.md
  2. BIN
      assets/back.png
  3. BIN
      assets/communications.png
  4. BIN
      assets/contact-book.png
  5. BIN
      assets/email.png
  6. 86 0
      lib/home_page.dart
  7. 28 0
      lib/main.dart
  8. 30 0
      pubspec.yaml

+ 16 - 0
README.md

@@ -0,0 +1,16 @@
+# crab_ui
+
+A new Flutter project.
+
+## Getting Started
+
+This project is a starting point for a Flutter application.
+
+A few resources to get you started if this is your first Flutter project:
+
+- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
+- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
+
+For help getting started with Flutter development, view the
+[online documentation](https://docs.flutter.dev/), which offers tutorials,
+samples, guidance on mobile development, and a full API reference.

BIN
assets/back.png


BIN
assets/communications.png


BIN
assets/contact-book.png


BIN
assets/email.png


+ 86 - 0
lib/home_page.dart

@@ -0,0 +1,86 @@
+import 'package:flutter/material.dart';
+
+
+class HomePage extends StatefulWidget {
+  const HomePage({super.key});
+
+  @override
+  State<HomePage> createState() => _HomePageState();
+}
+
+class _HomePageState extends State<HomePage> {
+  // bool _isVisible = true;
+  final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
+
+  @override
+  void initState() {
+    super.initState();
+    WidgetsBinding.instance.addPostFrameCallback((_) {
+      _scaffoldKey.currentState?.openDrawer();
+    });
+  }
+
+  void _closeDrawer() {
+    Navigator.of(context).pop();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      key: _scaffoldKey,
+      appBar: AppBar(
+        title: Text("utils"),
+
+        // leading: IconButton(
+        //   icon: Icon(Icons.menu),
+        //   onPressed: () {
+        //     _scaffoldKey.currentState?.openDrawer();
+        //   },
+        // ),
+      ),
+      drawer: Container(
+        width: 70.0,
+        child: Drawer(
+          child: ListView(
+            padding: EdgeInsets.zero,
+            children: <Widget>[
+              ListTile(
+                leading: Image.asset('email.png', height: 24, width: 24),
+                onTap: () {
+                  // Handle email tap
+                  // Navigator.of(context).pop(); // Close the drawer
+                  print("email");
+                },
+              ),
+              ListTile(
+                leading: Image.asset('contact-book.png', height: 24, width: 24),
+                onTap: () {
+                  print("contact");
+                  // Handle contact tap
+                  // Navigator.of(context).pop(); // Close the drawer
+                },
+              ),
+              ListTile(
+                leading:
+                    Image.asset('communications.png', height: 24, width: 24),
+                onTap: () {
+                  // Handle calendar tap
+                  // Navigator.of(context).pop(); // Close the drawer
+                  print("communications");
+                },
+              ),
+              ListTile(
+                leading: Image.asset('back.png', height: 24, width: 24),
+                onTap: () {
+                  // Handle tasks tap
+                  // Navigator.of(context).pop(); // Close the drawer
+                  _closeDrawer();
+                },
+              ),
+            ],
+          ),
+        ),
+      ),
+    );
+  }
+}

+ 28 - 0
lib/main.dart

@@ -0,0 +1,28 @@
+import 'package:flutter/material.dart';
+import 'home_page.dart';
+import 'email.dart';
+
+
+void main() {
+  runApp(const HyM());
+}
+
+class HyM extends StatelessWidget {
+  const HyM({super.key});
+
+  @override
+  Widget build(BuildContext context){
+    return MaterialApp(
+      debugShowCheckedModeBanner: false,
+      theme: ThemeData.dark(),
+      title: 'HyM',
+      home: const HomePage(),
+      routes: {
+        "/email": (context) => EmailPage(),
+
+      },
+    );
+  }
+
+
+}

+ 30 - 0
pubspec.yaml

@@ -0,0 +1,30 @@
+name: crab_ui
+description: A new Flutter project.
+
+publish_to: 'none' # Remove this line if you wish to publish to pub.dev
+
+version: 0.0.1+1
+
+environment:
+  sdk: ^3.1.1
+
+dependencies:
+  flutter:
+    sdk: flutter
+
+  english_words: ^4.0.0
+  provider: ^6.0.0
+
+dev_dependencies:
+  flutter_test:
+    sdk: flutter
+
+  flutter_lints: ^2.0.0
+
+flutter:
+  uses-material-design: true
+  assets:
+    - assets/back.png
+    - assets/communications.png
+    - assets/contact-book.png
+    - assets/email.png