add some colors
This commit is contained in:
parent
6a04ad02a1
commit
e3d59949af
7
lib/core/theme/app_colors.dart
Normal file
7
lib/core/theme/app_colors.dart
Normal file
@ -0,0 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AppColors {
|
||||
const AppColors._();
|
||||
|
||||
static const Color primary = Color(0xFF2A60AF);
|
||||
}
|
||||
@ -1,8 +1,23 @@
|
||||
import 'package:e_receipt_mobile/core/theme/app_colors.dart';
|
||||
import 'package:e_receipt_mobile/presentation/login/login_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
void main() {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
SystemChrome.setEnabledSystemUIMode(
|
||||
SystemUiMode.manual,
|
||||
overlays: SystemUiOverlay.values,
|
||||
);
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
const SystemUiOverlayStyle(
|
||||
statusBarColor: AppColors.primary,
|
||||
statusBarIconBrightness: Brightness.light,
|
||||
statusBarBrightness: Brightness.dark,
|
||||
),
|
||||
);
|
||||
runApp(const ProviderScope(child: EReceiptApp()));
|
||||
}
|
||||
|
||||
@ -15,7 +30,19 @@ class EReceiptApp extends StatelessWidget {
|
||||
title: 'E-Receipt',
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: ThemeData(
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: AppColors.primary,
|
||||
),
|
||||
primaryColor: AppColors.primary,
|
||||
appBarTheme: const AppBarTheme(
|
||||
backgroundColor: AppColors.primary,
|
||||
foregroundColor: Colors.white,
|
||||
systemOverlayStyle: SystemUiOverlayStyle(
|
||||
statusBarColor: AppColors.primary,
|
||||
statusBarIconBrightness: Brightness.light,
|
||||
statusBarBrightness: Brightness.dark,
|
||||
),
|
||||
),
|
||||
useMaterial3: true,
|
||||
),
|
||||
home: const LoginPage(),
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import 'package:e_receipt_mobile/core/theme/app_colors.dart';
|
||||
import 'package:e_receipt_mobile/domain/entities/login_user.dart';
|
||||
import 'package:e_receipt_mobile/presentation/auth/session_controller.dart';
|
||||
import 'package:e_receipt_mobile/presentation/home/home_view_model.dart';
|
||||
@ -21,22 +22,41 @@ class HomeScreen extends ConsumerWidget {
|
||||
centerTitle: true,
|
||||
),
|
||||
drawer: Drawer(
|
||||
child: SafeArea(
|
||||
backgroundColor: Colors.white,
|
||||
|
||||
child: Column(
|
||||
children: [
|
||||
UserAccountsDrawerHeader(
|
||||
accountName: Text(user.username),
|
||||
accountEmail: Text('Role: ${user.role}'),
|
||||
decoration: const BoxDecoration(color: AppColors.primary),
|
||||
accountName: Text(
|
||||
user.username,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
accountEmail: Text(
|
||||
'Role: ${user.role}',
|
||||
style: const TextStyle(color: Colors.white70),
|
||||
),
|
||||
currentAccountPicture: CircleAvatar(
|
||||
backgroundColor: Colors.white,
|
||||
child: Text(
|
||||
(user.username.isNotEmpty ? user.username[0] : 'U')
|
||||
.toUpperCase(),
|
||||
style: const TextStyle(color: AppColors.primary),
|
||||
),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.person_outline),
|
||||
title: const Text('Profile'),
|
||||
leading: const Icon(Icons.person_outline, color: Colors.black87),
|
||||
title: const Text(
|
||||
'Profile',
|
||||
style: TextStyle(
|
||||
color: Colors.black87,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
_showProfile(context);
|
||||
@ -48,35 +68,88 @@ class HomeScreen extends ConsumerWidget {
|
||||
// onTap: () => Navigator.of(context).pop(),
|
||||
// ),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.analytics_outlined),
|
||||
title: const Text('Reports'),
|
||||
leading: const Icon(Icons.analytics_outlined, color: Colors.black87),
|
||||
title: const Text(
|
||||
'Reports',
|
||||
style: TextStyle(
|
||||
color: Colors.black87,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
_showComingSoon(context, 'Reports');
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.settings_outlined),
|
||||
title: const Text('Settings'),
|
||||
leading: const Icon(Icons.settings_outlined, color: Colors.black87),
|
||||
title: const Text(
|
||||
'Settings',
|
||||
style: TextStyle(
|
||||
color: Colors.black87,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
_showComingSoon(context, 'Settings');
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.help_outline),
|
||||
title: const Text('Help'),
|
||||
leading: const Icon(Icons.help_outline, color: Colors.black87),
|
||||
title: const Text(
|
||||
'Help',
|
||||
style: TextStyle(
|
||||
color: Colors.black87,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
_showComingSoon(context, 'Help');
|
||||
},
|
||||
),
|
||||
const Spacer(),
|
||||
const Divider(height: 1),
|
||||
const Divider(height: 1, color: Colors.black12),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.logout),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 8,
|
||||
),
|
||||
minTileHeight: 64,
|
||||
leading: const Icon(Icons.logout, color: Colors.black87),
|
||||
title: const Text(
|
||||
'Logout',
|
||||
style: TextStyle(
|
||||
color: Colors.black87,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
onTap: () async {
|
||||
final shouldLogout = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Logout'),
|
||||
onTap: () {
|
||||
content: const Text('Are you sure want to logout?'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: const Text('Cancel'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: const Text('Logout'),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
if (shouldLogout != true || !context.mounted) {
|
||||
return;
|
||||
}
|
||||
|
||||
ref.read(sessionControllerProvider.notifier).clearUser();
|
||||
Navigator.of(context).pushAndRemoveUntil(
|
||||
MaterialPageRoute<void>(
|
||||
@ -89,7 +162,6 @@ class HomeScreen extends ConsumerWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: merchantsAsync.when(
|
||||
|
||||
@ -27,7 +27,7 @@ class _TerminalSelectionScreenState
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Select Terminals - ${widget.merchantName}'),
|
||||
title: Text(widget.merchantName),
|
||||
),
|
||||
body: terminalsAsync.when(
|
||||
loading: () => const Center(child: CircularProgressIndicator()),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user