Initial dump, and side bar

This commit is contained in:
Juan Marulanda De Los Rios 2024-07-24 22:12:20 -04:00
commit 961607f978
8 changed files with 160 additions and 0 deletions

16
README.md Normal file
View File

@ -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 Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
assets/communications.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
assets/contact-book.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
assets/email.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

86
lib/home_page.dart Normal file
View File

@ -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
lib/main.dart Normal file
View File

@ -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
pubspec.yaml Normal file
View File

@ -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