This commit is contained in:
Patrick Alvin Alcala 2025-03-12 18:09:04 +08:00
parent a76d3a0f35
commit e3dc94a768
33 changed files with 368 additions and 184 deletions

View file

@ -1,6 +1,10 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:gap/gap.dart';
import 'package:pharmacy_mobile/blocs/guest/functions/bloc_setgueston.dart';
import 'package:pharmacy_mobile/blocs/guest/guest_bloc.dart';
import 'package:pharmacy_mobile/blocs/guest/guest_event.dart';
import 'package:pharmacy_mobile/widgets/button_widget.dart';
import 'package:pharmacy_mobile/widgets/image_widget.dart';
import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
@ -21,6 +25,14 @@ class IndexPage extends StatelessWidget {
context.push('/register');
}
void loginAsGuest() async {
final setGuest = await blocSetGuestOn(context);
if (setGuest) {
// ignore: use_build_context_synchronously
context.push('/customer');
}
}
return Scaffold(
resizeToAvoidBottomInset: false,
body: PageBackgroundWidget(
@ -41,6 +53,16 @@ class IndexPage extends StatelessWidget {
ButtonWidget(text: 'Login', onPressed: gotoLogin),
const Gap(8),
ButtonWidget(text: 'Register', onPressed: gotoRegister, outline: true),
const Gap(16),
GestureDetector(
onTap: loginAsGuest,
child: const TextWidget(
text: "Login as Guest",
size: 12,
underlined: true,
color: Color.fromRGBO(198, 133, 232, 1),
),
),
const Gap(32),
const SloganWidget(),
const Gap(32),