Skip to content

Commit

Permalink
Home conductor
Browse files Browse the repository at this point in the history
Creacion de la vista inicial para los usuarios de tipo conductor.
  • Loading branch information
yon-cc committed Mar 31, 2023
1 parent 5bd8d8c commit d65c18c
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 4 deletions.
File renamed without changes
Binary file added frontend/assets/images/delivery2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 14 additions & 2 deletions frontend/lib/routes/route_generator.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import 'package:flutter/material.dart';
import 'package:frontend/views/generate_qr/generate_qr.dart';
import 'package:frontend/views/home/home.dart';
import 'package:frontend/views/scan_qr/scan_qr.dart';
import '../views/home_supervisor/home_supervisor.dart';
import '../views/initial_page/initial_page.dart';
import '../views/introduction/introduction.dart';
Expand All @@ -14,6 +17,9 @@ class RouteGenerator{
switch (settings.name) {
case "introduction":
return MaterialPageRoute(builder: (_) => const Introduction());

case "initial-page":
return MaterialPageRoute(builder: (_)=> const InitialPage());

case "/login":
return MaterialPageRoute(builder: (_) => const Login());
Expand All @@ -27,8 +33,14 @@ class RouteGenerator{
case "/initial-page":
return MaterialPageRoute(builder: (_)=> const InitialPage());

case "initial-page":
return MaterialPageRoute(builder: (_)=> const InitialPage());
case "/home":
return MaterialPageRoute(builder: (_)=> const Home());

case "/scan-qr":
return MaterialPageRoute(builder: (_)=> const ScanQR());

case "/generate-qr":
return MaterialPageRoute(builder: (_)=> const GenerateQR());

default:
return _errorRoute();
Expand Down
1 change: 0 additions & 1 deletion frontend/lib/view/register/register.dart

This file was deleted.

18 changes: 18 additions & 0 deletions frontend/lib/views/generate_qr/generate_qr.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

import '../register/widgets/header_back.dart';

class GenerateQR extends StatelessWidget {
const GenerateQR({super.key});

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: headerBack(context),
body: Center(
child: Text("Generar QR", style: GoogleFonts.rubik(fontSize: 64),),
)
);
}
}
55 changes: 55 additions & 0 deletions frontend/lib/views/home/home.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart';
import 'package:frontend/views/home/widgets/menu_button.dart';
import 'package:frontend/views/register/widgets/bottom.dart';
import 'package:google_fonts/google_fonts.dart';

class Home extends StatelessWidget {
const Home({super.key});

@override
Widget build(BuildContext context) {
return Scaffold(
bottomSheet: const SizedBox(
height: 100,
child: Center(child: Bottom())
),
body: Center(
child: Stack(
children: [
Positioned(
right: 0,
top: 20,
child: TextButton(
onPressed: (){
Navigator.pushNamed(context, "initial-page");
},
child: Image.asset("assets/images/logout.png", scale: 12, color: const Color(0xff344E41),)
),
),

Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("Bienvenido\nusername", style: GoogleFonts.rubik(fontSize: 32, fontWeight: FontWeight.bold), textAlign:TextAlign.center,),
const SizedBox(height: 70,),
Wrap(
children: const [
MenuButton(text: 'Envios', imgRoute: 'delivery2.png', btnRoute: '',),
MenuButton(text: 'Escanear QR', imgRoute: 'camara.png', btnRoute: '/scan-qr',),
MenuButton(text: 'Generar QR', imgRoute: 'codigo-qr.png', btnRoute: '/generate-qr',),
MenuButton(text: 'Perfil', imgRoute: 'user.png', btnRoute: '',),
],
)


],
),

],
),
),
);
}
}
42 changes: 42 additions & 0 deletions frontend/lib/views/home/widgets/menu_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart';
import 'package:google_fonts/google_fonts.dart';

class MenuButton extends StatelessWidget {
const MenuButton({super.key, required this.text, required this.imgRoute, required this.btnRoute});
final String text;
final String imgRoute;
final String btnRoute;

@override
Widget build(BuildContext context) {
return Container(
// decoration: const BoxDecoration(
// borderRadius: BorderRadius.all(Radius.circular(20)),
// color: Color(0xffd9d9d9),
// ),
margin: const EdgeInsets.symmetric(horizontal: 30),
child: GestureDetector(
onTap: () {
Navigator.pushNamed(context, btnRoute);
},
child: Column(
children: [
Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20)),
color: Color(0xffDAD7CD),
),
padding: const EdgeInsets.all(35),
child: Image.asset("assets/images/$imgRoute", scale: 8,)
),
const SizedBox(height: 15,),
Text(text, style: GoogleFonts.rubik(fontSize: 20, fontWeight: FontWeight.w600),),
const SizedBox(height: 40,),
],
),
),
);
}
}
2 changes: 1 addition & 1 deletion frontend/lib/views/initial_page/initial_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class InitialPage extends StatelessWidget {
const Image(
image: AssetImage("assets/images/logo200.png"),
),
RoutingButton(text: "Iniciar Sesion", route: "/login", callback: (){return true;},),
RoutingButton(text: "Iniciar Sesion", route: "/home", callback: (){return true;},),
const SizedBox(height: 10,),
RoutingButton(text: "No tengo una cuenta", route: "/register", callback: (){return true;},
btnStyle: ElevatedButton.styleFrom(
Expand Down
18 changes: 18 additions & 0 deletions frontend/lib/views/scan_qr/scan_qr.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

import '../register/widgets/header_back.dart';

class ScanQR extends StatelessWidget {
const ScanQR({super.key});

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: headerBack(context),
body: Center(
child: Text("Escanear QR", style: GoogleFonts.rubik(fontSize: 64),),
)
);
}
}

0 comments on commit d65c18c

Please sign in to comment.