initial router setup

This commit is contained in:
2023-08-27 16:43:24 -03:00
parent c02ea580c7
commit 30c69dd5a8
9 changed files with 118 additions and 16 deletions
+5 -12
View File
@@ -1,4 +1,6 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:lixo/components/nc_base_page.dart';
import 'package:lixo/components/nc_button.dart';
class InitialPage extends StatelessWidget {
@@ -6,8 +8,7 @@ class InitialPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xffa600f9),
return NcBasePage(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@@ -16,7 +17,7 @@ class InitialPage extends StatelessWidget {
caption: "Quero me registrar",
backgroundColor: Colors.black,
captionColor: Colors.white,
onPressed: _register,
onPressed: () => context.go('/register'),
),
const SizedBox(
height: 40,
@@ -25,19 +26,11 @@ class InitialPage extends StatelessWidget {
caption: "Já sou cliente",
backgroundColor: Colors.black,
captionColor: Colors.white,
onPressed: _login,
onPressed: () => context.go('/login'),
),
],
),
),
);
}
void _register() {
print("Quero me registrar");
}
void _login() {
print("Quero fazer login");
}
}
+20
View File
@@ -0,0 +1,20 @@
import 'package:flutter/material.dart';
import 'package:lixo/components/nc_base_page.dart';
class LoginPage extends StatelessWidget {
const LoginPage({super.key});
@override
Widget build(BuildContext context) {
return const NcBasePage(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("Login Page"),
],
),
),
);
}
}
+20
View File
@@ -0,0 +1,20 @@
import 'package:flutter/material.dart';
import 'package:lixo/components/nc_base_page.dart';
class RegisterPage extends StatelessWidget {
const RegisterPage({super.key});
@override
Widget build(BuildContext context) {
return const NcBasePage(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("Register Page"),
],
),
),
);
}
}