update
This commit is contained in:
parent
2d3f5bd96e
commit
f4119130a6
17 changed files with 232 additions and 138 deletions
|
|
@ -31,7 +31,7 @@ class _CustomerPageState extends State<CustomerPage> {
|
|||
|
||||
final Color selectedBarColor = const Color.fromRGBO(241, 255, 255, 0.83);
|
||||
final Color unselectedBarColor = const Color.fromRGBO(206, 206, 206, 1);
|
||||
final double barFontSize = 12;
|
||||
final double barFontSize = 8;
|
||||
final double barIconInactiveSize = 20;
|
||||
final double barIconActiveSize = 20;
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class _CustomerMainPageState extends State<CustomerMainPage> {
|
|||
name: 'Ofelia Franco-Alcala, RPh',
|
||||
description: 'Pharmacist',
|
||||
contact: '09205436095',
|
||||
imagePath: 'assets/images/ofelia.webp',
|
||||
imagePath: 'assets/images/profile.webp',
|
||||
color: 'pink',
|
||||
margin: 32,
|
||||
),
|
||||
|
|
@ -49,7 +49,7 @@ class _CustomerMainPageState extends State<CustomerMainPage> {
|
|||
name: 'Pamela Claire Alcala, RPh',
|
||||
description: 'Pharmacist',
|
||||
contact: '09205436095',
|
||||
imagePath: 'assets/images/pamela.webp',
|
||||
imagePath: 'assets/images/profile.webp',
|
||||
color: 'pink',
|
||||
margin: 32,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:pharmacy_mobile/tables/stocks.dart';
|
||||
|
|
@ -8,6 +10,7 @@ import 'package:pharmacy_mobile/widgets/input_widget.dart';
|
|||
import 'package:pharmacy_mobile/widgets/item_card_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/logo_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
|
||||
import 'package:redacted/redacted.dart';
|
||||
|
||||
class CustomerSearchPage extends StatefulWidget {
|
||||
// final NotchBottomBarController? controller;
|
||||
|
|
@ -35,6 +38,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
|
||||
Future<void> _getAllStocks() async {
|
||||
_stockList = await _stocks.getList();
|
||||
log(_stockList.toString());
|
||||
}
|
||||
|
||||
// void getURLs() async {
|
||||
|
|
@ -135,12 +139,14 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
text: 'sample',
|
||||
price: 500,
|
||||
quantity: 15,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
),
|
||||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
price: 20,
|
||||
quantity: 85,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
@ -159,12 +165,14 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
text: 'sample',
|
||||
price: 500,
|
||||
quantity: 15,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
),
|
||||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
price: 20,
|
||||
quantity: 85,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:glossy/glossy.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:pharmacy_mobile/auth/auth_service.dart';
|
||||
import 'package:pharmacy_mobile/widgets/buttonwithprogress_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/glossy_container_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/input_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/snackbar_widget.dart';
|
||||
|
|
@ -25,7 +27,8 @@ class _LoginPageState extends State<LoginPage> {
|
|||
final _passwordController = TextEditingController();
|
||||
final FocusNode _focusNode = FocusNode();
|
||||
|
||||
bool _isLoading = false;
|
||||
late bool _isLoading = false;
|
||||
late double containerHeight = 0.35;
|
||||
|
||||
void _signIn() async {
|
||||
final email = _emailController.text;
|
||||
|
|
@ -45,7 +48,10 @@ class _LoginPageState extends State<LoginPage> {
|
|||
return;
|
||||
}
|
||||
|
||||
setState(() => _isLoading = true);
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
containerHeight = 0.365;
|
||||
});
|
||||
|
||||
try {
|
||||
if (await InternetConnectionChecker.instance.hasConnection) {
|
||||
|
|
@ -82,7 +88,10 @@ class _LoginPageState extends State<LoginPage> {
|
|||
}
|
||||
}
|
||||
} finally {
|
||||
setState(() => _isLoading = false);
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
containerHeight = 0.35;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -118,19 +127,8 @@ class _LoginPageState extends State<LoginPage> {
|
|||
const Gap(16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 32, right: 32),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.fromLTRB(32, 32, 32, 40),
|
||||
decoration: const BoxDecoration(
|
||||
color: Color.fromRGBO(57, 38, 62, 0.6),
|
||||
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color.fromRGBO(0, 0, 0, 0.2), // Subtle shadow to give depth
|
||||
spreadRadius: 0,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
)
|
||||
]),
|
||||
child: GlossyContainerWidget(
|
||||
height: containerHeight,
|
||||
child: Form(
|
||||
child: Column(
|
||||
children: [
|
||||
|
|
@ -150,11 +148,6 @@ class _LoginPageState extends State<LoginPage> {
|
|||
),
|
||||
),
|
||||
const Gap(40),
|
||||
// TextButton(onPressed: () => {_signIn()}, child: const Text('Login'))
|
||||
// if (_isLoading)
|
||||
// const Center(child: CircularProgressIndicator(color: Color.fromRGBO(255, 255, 255, 1)))
|
||||
// else
|
||||
// ButtonWidget(text: 'Login', onPressed: _signIn),
|
||||
ButtonWithProgressWidget(
|
||||
trigger: _isLoading, progressText: 'Logging In', buttonText: 'Login', onPressed: _signIn)
|
||||
],
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:glossy/glossy.dart';
|
||||
import 'package:internet_connection_checker/internet_connection_checker.dart';
|
||||
import 'package:pharmacy_mobile/auth/auth_service.dart';
|
||||
import 'package:pharmacy_mobile/widgets/buttonwithprogress_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/glossy_container_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/input_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/snackbar_widget.dart';
|
||||
|
|
@ -24,7 +26,8 @@ class _RegisterPageState extends State<RegisterPage> {
|
|||
final _confirmPasswordController = TextEditingController();
|
||||
final FocusNode _focusNode = FocusNode();
|
||||
|
||||
bool _isLoading = false;
|
||||
late bool _isLoading = false;
|
||||
late double containerHeight = 0.44;
|
||||
|
||||
Future<void> _signUp() async {
|
||||
final email = _emailController.text;
|
||||
|
|
@ -57,7 +60,10 @@ class _RegisterPageState extends State<RegisterPage> {
|
|||
return;
|
||||
}
|
||||
|
||||
setState(() => _isLoading = true);
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
containerHeight = 0.456;
|
||||
});
|
||||
|
||||
try {
|
||||
if (await InternetConnectionChecker.instance.hasConnection) {
|
||||
|
|
@ -82,7 +88,10 @@ class _RegisterPageState extends State<RegisterPage> {
|
|||
showNotification(context, 'Error: $e', false);
|
||||
}
|
||||
} finally {
|
||||
setState(() => _isLoading = false);
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
containerHeight = 0.44;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -119,19 +128,8 @@ class _RegisterPageState extends State<RegisterPage> {
|
|||
const Gap(16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 32, right: 32),
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(32, 32, 32, 40),
|
||||
decoration: const BoxDecoration(
|
||||
color: Color.fromRGBO(57, 38, 62, 0.6),
|
||||
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color.fromRGBO(0, 0, 0, 0.2), // Subtle shadow to give depth
|
||||
spreadRadius: 0,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
)
|
||||
]),
|
||||
child: GlossyContainerWidget(
|
||||
height: containerHeight,
|
||||
child: Form(
|
||||
child: Column(
|
||||
children: [
|
||||
|
|
|
|||
22
lib/widgets/glossy_container_widget.dart
Normal file
22
lib/widgets/glossy_container_widget.dart
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:glossy/glossy.dart';
|
||||
|
||||
class GlossyContainerWidget extends StatelessWidget {
|
||||
final double height;
|
||||
final Widget child;
|
||||
const GlossyContainerWidget({super.key, required this.height, required this.child});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GlossyContainer(
|
||||
height: MediaQuery.of(context).size.height * height,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
||||
color: const Color.fromRGBO(20, 13, 22, 1),
|
||||
border: Border.all(width: 0, color: const Color.fromRGBO(169, 132, 172, 1)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(32, 32, 32, 40),
|
||||
child: child,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
@ -2,15 +2,22 @@ import 'package:flutter/material.dart';
|
|||
import 'package:gap/gap.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:redacted/redacted.dart';
|
||||
|
||||
class ItemCardWidget extends StatelessWidget {
|
||||
final String imageUrl;
|
||||
final String text;
|
||||
final double price;
|
||||
final double quantity;
|
||||
final bool isLoading;
|
||||
|
||||
const ItemCardWidget(
|
||||
{super.key, required this.imageUrl, required this.text, required this.price, required this.quantity});
|
||||
{super.key,
|
||||
required this.imageUrl,
|
||||
required this.text,
|
||||
required this.price,
|
||||
required this.quantity,
|
||||
required this.isLoading});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
@ -74,7 +81,7 @@ class ItemCardWidget extends StatelessWidget {
|
|||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
).redacted(context: context, redact: isLoading),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue