Authentication check plus signin screen added to frontend
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
|
||||
class MyAppBar extends StatelessWidget {
|
||||
final String barTitle;
|
||||
@@ -11,6 +12,15 @@ class MyAppBar extends StatelessWidget {
|
||||
backgroundColor: Colors.blueAccent,
|
||||
elevation: 8,
|
||||
shadowColor: Colors.black,
|
||||
leading: IconButton(
|
||||
onPressed: () {
|
||||
client.auth.signOut();
|
||||
Navigator.of(context).pushNamed('/');
|
||||
},
|
||||
icon: const Icon(Icons.logout),
|
||||
iconSize: 35,
|
||||
color: Colors.black,
|
||||
),
|
||||
title: Text(
|
||||
barTitle,
|
||||
style: const TextStyle(
|
||||
|
||||
39
Frontend/patient_manager/lib/components/myTextField.dart
Normal file
39
Frontend/patient_manager/lib/components/myTextField.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MyTextField extends StatelessWidget {
|
||||
final controller;
|
||||
final String hintText;
|
||||
final bool obscureText;
|
||||
|
||||
const MyTextField({
|
||||
super.key,
|
||||
required this.controller,
|
||||
required this.hintText,
|
||||
required this.obscureText,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: TextField(
|
||||
controller: controller,
|
||||
obscureText: obscureText,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
filled: true,
|
||||
hintText: hintText,
|
||||
hintStyle: TextStyle(color: Colors.blueGrey[400]),
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors.blueAccent,
|
||||
width: 2.0,
|
||||
)),
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.blue),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
33
Frontend/patient_manager/lib/components/mybutton.dart
Normal file
33
Frontend/patient_manager/lib/components/mybutton.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MyButton extends StatelessWidget {
|
||||
final void Function() onTap;
|
||||
final String buttonText;
|
||||
|
||||
const MyButton({super.key, required this.onTap, required this.buttonText});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(25),
|
||||
margin: const EdgeInsets.symmetric(horizontal: 25),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blueAccent,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
buttonText,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user