adding multilingual support
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:base_project/commans/widgets/custom_textform_field.dart';
|
||||
import 'package:base_project/commans/widgets/custome_elevated_button.dart';
|
||||
import 'package:base_project/core/constants/ui_constants.dart';
|
||||
import 'package:base_project/core/providers/dynamic_theme_provider.dart';
|
||||
import 'package:base_project/l10n/app_localizations.dart';
|
||||
import 'package:base_project/utils/validator/text_feild_validator.dart';
|
||||
import 'package:base_project/view/auth/sign_up_view.dart';
|
||||
import 'package:base_project/view_model/auth/auth_view_model.dart';
|
||||
@@ -231,7 +232,8 @@ class _AdminRegViewState extends State<AdminRegView>
|
||||
builder: (context, provider, child) {
|
||||
return MyCustomElevatedButton(
|
||||
isLoading: provider.isLoading,
|
||||
child: const Text("Register Company"),
|
||||
child: Text(AppLocalizations.of(context)!
|
||||
.registerCompany),
|
||||
onPressed: () async {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
final Map<String, dynamic> signUpData = {
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
|
||||
class GetOtpView extends StatefulWidget {
|
||||
const GetOtpView({super.key});
|
||||
@@ -483,7 +484,7 @@ class _GetOtpViewState extends State<GetOtpView> with TickerProviderStateMixin {
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'Get OTP',
|
||||
AppLocalizations.of(context)!.getOtp,
|
||||
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
|
||||
color: colorScheme.primary,
|
||||
fontWeight: FontWeight.w700,
|
||||
@@ -493,7 +494,7 @@ class _GetOtpViewState extends State<GetOtpView> with TickerProviderStateMixin {
|
||||
),
|
||||
const SizedBox(height: UIConstants.spacing12),
|
||||
Text(
|
||||
'Enter your email to receive a one-time password',
|
||||
AppLocalizations.of(context)!.otpEmailPrompt,
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: colorScheme.onSurface.withOpacity(0.8),
|
||||
fontWeight: FontWeight.w400,
|
||||
@@ -543,8 +544,8 @@ class _GetOtpViewState extends State<GetOtpView> with TickerProviderStateMixin {
|
||||
children: [
|
||||
// Email Field
|
||||
_buildEnhancedTextField(
|
||||
label: 'Email Address',
|
||||
hint: 'Enter your email address',
|
||||
label: AppLocalizations.of(context)!.emailAddress,
|
||||
hint: AppLocalizations.of(context)!.enterEmailAddress,
|
||||
controller: _emailController,
|
||||
focusNode: _emailFocusNode,
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
@@ -554,12 +555,12 @@ class _GetOtpViewState extends State<GetOtpView> with TickerProviderStateMixin {
|
||||
textInputAction: TextInputAction.done,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Email is required';
|
||||
return AppLocalizations.of(context)!.emailRequired;
|
||||
}
|
||||
if (!RegExp(
|
||||
r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$')
|
||||
.hasMatch(value)) {
|
||||
return 'Please enter a valid email';
|
||||
return AppLocalizations.of(context)!.validEmail;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -847,7 +848,9 @@ class _GetOtpViewState extends State<GetOtpView> with TickerProviderStateMixin {
|
||||
) ??
|
||||
const TextStyle(),
|
||||
child: Text(
|
||||
isLoading ? 'Sending OTP...' : 'Send OTP',
|
||||
isLoading
|
||||
? AppLocalizations.of(context)!.sendingOtp
|
||||
: AppLocalizations.of(context)!.sendOtp,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -919,7 +922,7 @@ class _GetOtpViewState extends State<GetOtpView> with TickerProviderStateMixin {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"Already have an account? ",
|
||||
'${AppLocalizations.of(context)!.alreadyHaveAccount} ',
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: Colors.grey.shade700,
|
||||
fontWeight: FontWeight.w500,
|
||||
@@ -928,7 +931,7 @@ class _GetOtpViewState extends State<GetOtpView> with TickerProviderStateMixin {
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
child: Text(
|
||||
'Back to Login',
|
||||
AppLocalizations.of(context)!.backToLogin,
|
||||
style: Theme.of(context).textTheme.labelLarge?.copyWith(
|
||||
color: colorScheme.primary,
|
||||
fontWeight: FontWeight.w700,
|
||||
@@ -982,8 +985,10 @@ class _GetOtpViewState extends State<GetOtpView> with TickerProviderStateMixin {
|
||||
? Icons.info_outline
|
||||
: (_isEmailValid ? Icons.check_circle : Icons.error_outline);
|
||||
final msg = _emailController.text.isEmpty
|
||||
? 'Enter your email address'
|
||||
: (_isEmailValid ? 'Email looks good' : 'Invalid email address');
|
||||
? AppLocalizations.of(context)!.enterEmailAddress
|
||||
: (_isEmailValid
|
||||
? AppLocalizations.of(context)!.emailLooksGood
|
||||
: AppLocalizations.of(context)!.invalidEmailAddress);
|
||||
|
||||
return Container(
|
||||
width: UIConstants.getResponsiveValue(
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:base_project/routes/route_names.dart';
|
||||
import 'package:base_project/view_model/auth/auth_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
|
||||
import '../../core/providers/dynamic_theme_provider.dart';
|
||||
import '../../core/providers/theme_provider.dart';
|
||||
@@ -497,7 +498,7 @@ class _LoginViewState extends State<LoginView> with TickerProviderStateMixin {
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'Welcome Back!',
|
||||
AppLocalizations.of(context)!.welcomeBack,
|
||||
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
|
||||
color: colorScheme.primary,
|
||||
fontWeight: FontWeight.w700,
|
||||
@@ -507,7 +508,7 @@ class _LoginViewState extends State<LoginView> with TickerProviderStateMixin {
|
||||
),
|
||||
const SizedBox(height: UIConstants.spacing12),
|
||||
Text(
|
||||
'Sign in to continue to your account',
|
||||
AppLocalizations.of(context)!.signInToContinue,
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: colorScheme.onSurface.withOpacity(0.8),
|
||||
fontWeight: FontWeight.w400,
|
||||
@@ -557,8 +558,8 @@ class _LoginViewState extends State<LoginView> with TickerProviderStateMixin {
|
||||
children: [
|
||||
// Email Field
|
||||
_buildEnhancedTextField(
|
||||
label: 'Email Address',
|
||||
hint: 'Enter your email',
|
||||
label: AppLocalizations.of(context)!.emailAddress,
|
||||
hint: AppLocalizations.of(context)!.enterYourEmail,
|
||||
controller: _emailController,
|
||||
focusNode: _emailFocusNode,
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
@@ -569,11 +570,11 @@ class _LoginViewState extends State<LoginView> with TickerProviderStateMixin {
|
||||
onSubmitted: (_) => _passwordFocusNode.requestFocus(),
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Email is required';
|
||||
return AppLocalizations.of(context)!.emailRequired;
|
||||
}
|
||||
if (!RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$')
|
||||
.hasMatch(value)) {
|
||||
return 'Please enter a valid email';
|
||||
return AppLocalizations.of(context)!.validEmail;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -583,8 +584,8 @@ class _LoginViewState extends State<LoginView> with TickerProviderStateMixin {
|
||||
|
||||
// Password Field
|
||||
_buildEnhancedTextField(
|
||||
label: 'Password',
|
||||
hint: 'Enter your password',
|
||||
label: AppLocalizations.of(context)!.password,
|
||||
hint: AppLocalizations.of(context)!.enterYourPassword,
|
||||
controller: _passwordController,
|
||||
focusNode: _passwordFocusNode,
|
||||
obscureText: !_isPasswordVisible,
|
||||
@@ -607,10 +608,10 @@ class _LoginViewState extends State<LoginView> with TickerProviderStateMixin {
|
||||
textInputAction: TextInputAction.done,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Password is required';
|
||||
return AppLocalizations.of(context)!.passwordRequired;
|
||||
}
|
||||
if (value.length < 6) {
|
||||
return 'Password must be at least 6 characters';
|
||||
return AppLocalizations.of(context)!.passwordMinLength;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -727,7 +728,7 @@ class _LoginViewState extends State<LoginView> with TickerProviderStateMixin {
|
||||
),
|
||||
const SizedBox(width: UIConstants.spacing6),
|
||||
Text(
|
||||
'Forgot Password?',
|
||||
AppLocalizations.of(context)!.forgotPassword,
|
||||
style: Theme.of(context).textTheme.labelSmall?.copyWith(
|
||||
color: colorScheme.primary,
|
||||
fontWeight: FontWeight.w600,
|
||||
@@ -771,7 +772,7 @@ class _LoginViewState extends State<LoginView> with TickerProviderStateMixin {
|
||||
child: Consumer<AuthViewModel>(
|
||||
builder: (context, provider, child) {
|
||||
return ModernButton(
|
||||
text: 'Sign In',
|
||||
text: AppLocalizations.of(context)!.signIn,
|
||||
type: ModernButtonType.primary,
|
||||
size: ModernButtonSize.large,
|
||||
isLoading: provider.isLoading,
|
||||
@@ -823,7 +824,7 @@ class _LoginViewState extends State<LoginView> with TickerProviderStateMixin {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"Don't have an account? ",
|
||||
'${AppLocalizations.of(context)!.noAccount} ',
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: Colors.grey.shade700,
|
||||
fontWeight: FontWeight.w500,
|
||||
@@ -834,7 +835,7 @@ class _LoginViewState extends State<LoginView> with TickerProviderStateMixin {
|
||||
Navigator.pushNamed(context, RouteNames.getOtpView);
|
||||
},
|
||||
child: Text(
|
||||
'Sign Up',
|
||||
AppLocalizations.of(context)!.signUp,
|
||||
style: Theme.of(context).textTheme.labelLarge?.copyWith(
|
||||
color: colorScheme.primary,
|
||||
fontWeight: FontWeight.w700,
|
||||
@@ -870,7 +871,7 @@ class _LoginViewState extends State<LoginView> with TickerProviderStateMixin {
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: UIConstants.spacing16),
|
||||
child: Text(
|
||||
'Or continue with',
|
||||
AppLocalizations.of(context)!.orContinueWith,
|
||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||
color: Colors.white.withOpacity(0.9),
|
||||
fontWeight: FontWeight.w500,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:base_project/core/constants/ui_constants.dart';
|
||||
import 'package:base_project/core/providers/dynamic_theme_provider.dart';
|
||||
import 'package:base_project/l10n/app_localizations.dart';
|
||||
import 'package:base_project/routes/route_names.dart';
|
||||
import 'package:base_project/shared/widgets/app_bar/modern_app_bar.dart';
|
||||
import 'package:base_project/shared/widgets/buttons/modern_button.dart';
|
||||
@@ -322,7 +323,7 @@ class _SignUpViewState extends State<SignUpView> with TickerProviderStateMixin {
|
||||
Consumer<AuthViewModel>(
|
||||
builder: (context, provider, child) {
|
||||
return ModernButton(
|
||||
text: 'Sign Up',
|
||||
text: AppLocalizations.of(context)!.signUp,
|
||||
type: ModernButtonType.primary,
|
||||
size: ModernButtonSize.large,
|
||||
isLoading: provider.isLoading,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:base_project/l10n/app_localizations.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SignupView extends StatelessWidget {
|
||||
@@ -14,7 +15,7 @@ class SignupView extends StatelessWidget {
|
||||
},
|
||||
icon: Icon(Icons.adaptive.arrow_back),
|
||||
),
|
||||
title: const Text("SignUp"),
|
||||
title: Text(AppLocalizations.of(context)!.signUp),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:pinput/pinput.dart';
|
||||
import 'package:base_project/commans/widgets/custome_elevated_button.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
import 'package:base_project/core/constants/ui_constants.dart';
|
||||
import 'package:base_project/core/providers/dynamic_theme_provider.dart';
|
||||
|
||||
@@ -83,7 +84,7 @@ class _VerifyOtpViewState extends State<VerifyOtpView>
|
||||
color: colorScheme.primary,
|
||||
),
|
||||
title: Text(
|
||||
'Verify OTP',
|
||||
AppLocalizations.of(context)!.verifyOtp,
|
||||
style: Theme.of(context).textTheme.titleLarge?.copyWith(
|
||||
color: colorScheme.primary,
|
||||
fontWeight: FontWeight.w700,
|
||||
@@ -147,7 +148,7 @@ class _VerifyOtpViewState extends State<VerifyOtpView>
|
||||
),
|
||||
const SizedBox(height: UIConstants.spacing16),
|
||||
Text(
|
||||
'Enter the 6-digit code sent to',
|
||||
AppLocalizations.of(context)!.otpSentTo,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium
|
||||
@@ -157,7 +158,7 @@ class _VerifyOtpViewState extends State<VerifyOtpView>
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
Text(
|
||||
widget.email ?? 'your email',
|
||||
widget.email ?? AppLocalizations.of(context)!.yourEmail,
|
||||
style:
|
||||
Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||
color: colorScheme.primary,
|
||||
@@ -233,7 +234,7 @@ class _VerifyOtpViewState extends State<VerifyOtpView>
|
||||
onPressed: () async {
|
||||
if (_otpController.text.length < 6) {
|
||||
ToastMessageUtil.showToast(
|
||||
message: 'Enter 6-digit OTP',
|
||||
message: AppLocalizations.of(context)!.enterOtp,
|
||||
toastType: ToastType.error,
|
||||
);
|
||||
return;
|
||||
@@ -268,7 +269,7 @@ class _VerifyOtpViewState extends State<VerifyOtpView>
|
||||
);
|
||||
}
|
||||
},
|
||||
child: const Text('Verify OTP'),
|
||||
child: Text(AppLocalizations.of(context)!.verifyOtp),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -285,8 +286,9 @@ class _VerifyOtpViewState extends State<VerifyOtpView>
|
||||
children: [
|
||||
Text(
|
||||
provider.isResendEnabled
|
||||
? "Didn't receive code?"
|
||||
: 'Resend in ${provider.start}s',
|
||||
? AppLocalizations.of(context)!.didNotReceiveCode
|
||||
: AppLocalizations.of(context)!
|
||||
.resendIn(provider.start),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium
|
||||
@@ -304,7 +306,7 @@ class _VerifyOtpViewState extends State<VerifyOtpView>
|
||||
}
|
||||
: null,
|
||||
child: Text(
|
||||
'Resend',
|
||||
AppLocalizations.of(context)!.resend,
|
||||
style: TextStyle(
|
||||
color: provider.isResendEnabled
|
||||
? colorScheme.primary
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:base_project/utils/managers/user_manager.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:base_project/view_model/system_params/system_params_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
|
||||
class HomeView extends StatefulWidget {
|
||||
const HomeView({super.key});
|
||||
@@ -32,54 +33,54 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
|
||||
// Dashboard stats (replace with real API data)
|
||||
List<Map<String, dynamic>> _dashboardStats = [];
|
||||
|
||||
final List<Map<String, dynamic>> _quickActions = [
|
||||
List<Map<String, dynamic>> _quickActions(BuildContext context) => [
|
||||
{
|
||||
'label': 'Profile',
|
||||
'label': AppLocalizations.of(context)!.profile,
|
||||
'icon': Icons.person,
|
||||
'onTap': () {},
|
||||
'backgroundColor': null, // Use theme default
|
||||
},
|
||||
{
|
||||
'label': 'Settings',
|
||||
'label': AppLocalizations.of(context)!.settings,
|
||||
'icon': Icons.settings,
|
||||
'onTap': () {},
|
||||
'backgroundColor': null,
|
||||
},
|
||||
{
|
||||
'label': 'Security',
|
||||
'label': AppLocalizations.of(context)!.security,
|
||||
'icon': Icons.security,
|
||||
'onTap': () {},
|
||||
'backgroundColor': null,
|
||||
},
|
||||
{
|
||||
'label': 'Reports',
|
||||
'label': AppLocalizations.of(context)!.reports,
|
||||
'icon': Icons.analytics,
|
||||
'onTap': () {},
|
||||
'backgroundColor': null,
|
||||
},
|
||||
];
|
||||
|
||||
final List<DrawerItem> _drawerItems = [
|
||||
List<DrawerItem> _drawerItems(BuildContext context) => [
|
||||
DrawerItem(
|
||||
icon: Icons.person,
|
||||
title: 'Profile',
|
||||
subtitle: 'Manage your account',
|
||||
title: AppLocalizations.of(context)!.profile,
|
||||
subtitle: AppLocalizations.of(context)!.manageAccount,
|
||||
onTap: (context) {
|
||||
Navigator.pushNamed(context, RouteNames.profileView);
|
||||
},
|
||||
),
|
||||
DrawerItem(
|
||||
icon: Icons.system_security_update,
|
||||
title: 'System Parameters',
|
||||
subtitle: 'Configure system settings',
|
||||
title: AppLocalizations.of(context)!.systemParameters,
|
||||
subtitle: AppLocalizations.of(context)!.configureSystemSettings,
|
||||
onTap: (context) {
|
||||
Navigator.pushNamed(context, RouteNames.systemParamsView);
|
||||
},
|
||||
),
|
||||
DrawerItem(
|
||||
icon: Icons.password,
|
||||
title: 'Change Password',
|
||||
subtitle: 'Update your password',
|
||||
title: AppLocalizations.of(context)!.changePassword,
|
||||
subtitle: AppLocalizations.of(context)!.updateYourPassword,
|
||||
onTap: (context) {
|
||||
Navigator.pushNamed(context, RouteNames.changePasswordView);
|
||||
},
|
||||
@@ -226,7 +227,7 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
|
||||
return Scaffold(
|
||||
backgroundColor: colorScheme.background,
|
||||
appBar: ModernAppBar(
|
||||
title: 'Dashboard',
|
||||
title: AppLocalizations.of(context)!.dashboard,
|
||||
centerTitle: false,
|
||||
showLogoInTitle: true,
|
||||
logoImage: _getDashboardLogoImage(colorScheme),
|
||||
@@ -237,7 +238,7 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
|
||||
Navigator.pushNamed(context, RouteNames.profileView);
|
||||
},
|
||||
),
|
||||
drawer: ModernDrawer(items: _drawerItems),
|
||||
drawer: ModernDrawer(items: _drawerItems(context)),
|
||||
body: Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
@@ -339,7 +340,8 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Welcome back, ${userName ?? 'User'}! ð',
|
||||
AppLocalizations.of(context)!
|
||||
.helloUser(userName ?? AppLocalizations.of(context)!.user),
|
||||
style: theme.textTheme.headlineMedium?.copyWith(
|
||||
color: colorScheme.onBackground,
|
||||
fontWeight: FontWeight.w700,
|
||||
@@ -468,9 +470,9 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
|
||||
mainAxisSpacing: UIConstants.spacing16,
|
||||
childAspectRatio: 1.0,
|
||||
),
|
||||
itemCount: _quickActions.length,
|
||||
itemCount: _quickActions(context).length,
|
||||
itemBuilder: (context, index) {
|
||||
final action = _quickActions[index];
|
||||
final action = _quickActions(context)[index];
|
||||
return QuickActionButton(
|
||||
label: action['label'],
|
||||
icon: action['icon'],
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:base_project/core/constants/ui_constants.dart';
|
||||
import 'package:base_project/core/providers/dynamic_theme_provider.dart';
|
||||
import 'package:base_project/l10n/app_localizations.dart';
|
||||
import 'package:base_project/shared/widgets/app_bar/modern_app_bar.dart';
|
||||
import 'package:base_project/shared/widgets/inputs/modern_text_field.dart';
|
||||
import 'package:base_project/shared/widgets/buttons/modern_button.dart';
|
||||
@@ -160,33 +161,37 @@ class _AccountUpdateViewState extends State<AccountUpdateView>
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
ModernTextField(
|
||||
label: 'Company Name',
|
||||
hint: 'Enter company name',
|
||||
label: AppLocalizations.of(context)!.accCompanyName,
|
||||
hint: AppLocalizations.of(context)!.accCompanyHint,
|
||||
controller: _companyName,
|
||||
prefixIcon: const Icon(Icons.business),
|
||||
validator: (v) =>
|
||||
(v == null || v.isEmpty) ? 'Required' : null,
|
||||
(v == null || v.isEmpty)
|
||||
? AppLocalizations.of(context)!.requiredVal
|
||||
: null,
|
||||
),
|
||||
SizedBox(height: UIConstants.spacing20),
|
||||
ModernTextField(
|
||||
label: 'Workspace',
|
||||
hint: 'Enter workspace',
|
||||
label: AppLocalizations.of(context)!.accWorkspace,
|
||||
hint: AppLocalizations.of(context)!.accWorkspaceHint,
|
||||
controller: _workspace,
|
||||
prefixIcon: const Icon(Icons.apartment_outlined),
|
||||
validator: (v) =>
|
||||
(v == null || v.isEmpty) ? 'Required' : null,
|
||||
(v == null || v.isEmpty)
|
||||
? AppLocalizations.of(context)!.requiredVal
|
||||
: null,
|
||||
),
|
||||
SizedBox(height: UIConstants.spacing20),
|
||||
ModernTextField(
|
||||
label: 'GST Number',
|
||||
hint: 'Enter GST number',
|
||||
label: AppLocalizations.of(context)!.accGst,
|
||||
hint: AppLocalizations.of(context)!.accGstHint,
|
||||
controller: _gstNumber,
|
||||
prefixIcon: const Icon(Icons.confirmation_number_outlined),
|
||||
),
|
||||
SizedBox(height: UIConstants.spacing20),
|
||||
ModernTextField(
|
||||
label: 'Mobile',
|
||||
hint: 'Enter mobile number',
|
||||
label: AppLocalizations.of(context)!.accMobile,
|
||||
hint: AppLocalizations.of(context)!.accMobileHint,
|
||||
controller: _mobile,
|
||||
keyboardType: TextInputType.phone,
|
||||
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
|
||||
@@ -195,23 +200,23 @@ class _AccountUpdateViewState extends State<AccountUpdateView>
|
||||
SizedBox(height: UIConstants.spacing20),
|
||||
AbsorbPointer(
|
||||
child: ModernTextField(
|
||||
label: 'Email (read-only)',
|
||||
hint: 'Email',
|
||||
label: AppLocalizations.of(context)!.accEmailReadonly,
|
||||
hint: AppLocalizations.of(context)!.email,
|
||||
controller: _email,
|
||||
prefixIcon: const Icon(Icons.email_outlined),
|
||||
),
|
||||
),
|
||||
SizedBox(height: UIConstants.spacing20),
|
||||
ModernTextField(
|
||||
label: 'PAN Card',
|
||||
hint: 'Enter PAN',
|
||||
label: AppLocalizations.of(context)!.accPan,
|
||||
hint: AppLocalizations.of(context)!.accPanHint,
|
||||
controller: _pancard,
|
||||
prefixIcon: const Icon(Icons.badge_outlined),
|
||||
),
|
||||
SizedBox(height: UIConstants.spacing20),
|
||||
ModernTextField(
|
||||
label: 'Working',
|
||||
hint: 'Working status',
|
||||
label: AppLocalizations.of(context)!.accWorking,
|
||||
hint: AppLocalizations.of(context)!.accWorkingHint,
|
||||
controller: _working,
|
||||
prefixIcon: const Icon(Icons.work_outline),
|
||||
),
|
||||
@@ -223,7 +228,7 @@ class _AccountUpdateViewState extends State<AccountUpdateView>
|
||||
onChanged: (v) => setState(() => _active = v),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
const Text('Active')
|
||||
Text(AppLocalizations.of(context)!.nActive)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
@@ -234,7 +239,7 @@ class _AccountUpdateViewState extends State<AccountUpdateView>
|
||||
desktop: UIConstants.spacing48,
|
||||
)),
|
||||
ModernButton(
|
||||
text: 'Update Account',
|
||||
text: AppLocalizations.of(context)!.accountUpdate,
|
||||
type: ModernButtonType.primary,
|
||||
size: ModernButtonSize.large,
|
||||
isLoading: vm.isUpdating,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:base_project/commans/widgets/custom_textform_field.dart';
|
||||
import 'package:base_project/commans/widgets/custome_elevated_button.dart';
|
||||
import 'package:base_project/l10n/app_localizations.dart';
|
||||
import 'package:base_project/resources/app_colors.dart';
|
||||
import 'package:base_project/utils/managers/user_manager.dart';
|
||||
import 'package:base_project/utils/validator/text_feild_validator.dart';
|
||||
@@ -372,7 +373,7 @@ class _ChangePasswordState extends State<ChangePassword>
|
||||
Consumer<ProfileViewModel>(
|
||||
builder: (context, provider, _) {
|
||||
return ModernButton(
|
||||
text: 'Change Password',
|
||||
text: AppLocalizations.of(context)!.changePassword,
|
||||
type: ModernButtonType.primary,
|
||||
size: ModernButtonSize.large,
|
||||
isLoading: provider.isUpdating,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:base_project/commans/widgets/custom_textform_field.dart';
|
||||
import 'package:base_project/commans/widgets/custome_elevated_button.dart';
|
||||
import 'package:base_project/l10n/app_localizations.dart';
|
||||
import 'package:base_project/model/user/user_profile.dart';
|
||||
import 'package:base_project/resources/app_colors.dart';
|
||||
import 'package:base_project/view_model/profile/profile_view_model.dart';
|
||||
@@ -396,7 +397,7 @@ class _EditProfileState extends State<EditProfile>
|
||||
Consumer<ProfileViewModel>(
|
||||
builder: (context, provider, _) {
|
||||
return ModernButton(
|
||||
text: 'Save Changes',
|
||||
text: AppLocalizations.of(context)!.saveChanges,
|
||||
type: ModernButtonType.primary,
|
||||
size: ModernButtonSize.large,
|
||||
isLoading: provider.isUpdating,
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:base_project/utils/managers/user_manager.dart';
|
||||
import 'package:base_project/view/dashboard/profile/edit_profile.dart';
|
||||
import 'package:base_project/view_model/profile/profile_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:base_project/core/providers/dynamic_theme_provider.dart';
|
||||
@@ -77,7 +78,7 @@ class _ProfileViewState extends State<ProfileView>
|
||||
|
||||
return Scaffold(
|
||||
appBar: ModernAppBar(
|
||||
title: 'Profile',
|
||||
title: AppLocalizations.of(context)!.profile,
|
||||
automaticallyImplyLeading: true,
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.arrow_back),
|
||||
@@ -393,7 +394,7 @@ class _ProfileViewState extends State<ProfileView>
|
||||
context,
|
||||
colorScheme: colorScheme,
|
||||
icon: Icons.edit_outlined,
|
||||
title: 'Edit Profile',
|
||||
title: AppLocalizations.of(context)!.editProfile,
|
||||
subtitle: 'Update your personal information',
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
@@ -411,7 +412,7 @@ class _ProfileViewState extends State<ProfileView>
|
||||
context,
|
||||
colorScheme: colorScheme,
|
||||
icon: Icons.manage_accounts_outlined,
|
||||
title: 'Account Update',
|
||||
title: AppLocalizations.of(context)!.accountUpdate,
|
||||
subtitle: 'Update company/workspace details',
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
@@ -427,7 +428,7 @@ class _ProfileViewState extends State<ProfileView>
|
||||
context,
|
||||
colorScheme: colorScheme,
|
||||
icon: Icons.lock_outline,
|
||||
title: 'Change Password',
|
||||
title: AppLocalizations.of(context)!.changePassword,
|
||||
subtitle: 'Update your account security',
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, RouteNames.changePasswordView);
|
||||
@@ -438,7 +439,7 @@ class _ProfileViewState extends State<ProfileView>
|
||||
context,
|
||||
colorScheme: colorScheme,
|
||||
icon: Icons.logout,
|
||||
title: 'Logout',
|
||||
title: AppLocalizations.of(context)!.logout,
|
||||
subtitle: 'Sign out of your account',
|
||||
iconColor: colorScheme.error,
|
||||
onTap: () => _showLogoutDialog(context, colorScheme),
|
||||
@@ -541,10 +542,10 @@ class _ProfileViewState extends State<ProfileView>
|
||||
size: UIConstants.iconSizeMedium,
|
||||
),
|
||||
const SizedBox(width: UIConstants.spacing12),
|
||||
const Text("Confirm Logout"),
|
||||
Text(AppLocalizations.of(context)!.confirmLogout),
|
||||
],
|
||||
),
|
||||
content: const Text("Are you sure you want to log out?"),
|
||||
content: Text(AppLocalizations.of(context)!.confirmLogoutBody),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
@@ -563,7 +564,7 @@ class _ProfileViewState extends State<ProfileView>
|
||||
backgroundColor: colorScheme.error,
|
||||
foregroundColor: colorScheme.onError,
|
||||
),
|
||||
child: const Text("Log Out"),
|
||||
child: Text(AppLocalizations.of(context)!.logoutAction),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
|
||||
class EditSystemParams extends StatelessWidget {
|
||||
const EditSystemParams({super.key});
|
||||
@@ -13,9 +14,9 @@ class EditSystemParams extends StatelessWidget {
|
||||
},
|
||||
icon: Icon(Icons.adaptive.arrow_back),
|
||||
),
|
||||
title: const Text("Edit System Parameters"),
|
||||
title: Text(AppLocalizations.of(context)!.editSystemParameters),
|
||||
),
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import 'package:base_project/shared/widgets/theme_preview.dart';
|
||||
import 'package:base_project/utils/managers/user_manager.dart';
|
||||
import 'package:base_project/view_model/system_params/system_params_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:base_project/core/providers/dynamic_theme_provider.dart';
|
||||
|
||||
@@ -235,7 +236,7 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
return Scaffold(
|
||||
backgroundColor: colorScheme.background,
|
||||
appBar: ModernAppBar(
|
||||
title: 'System Parameters',
|
||||
title: AppLocalizations.of(context)!.systemParameters,
|
||||
userAvatar: null,
|
||||
userName: userName,
|
||||
onProfilePressed: () {},
|
||||
@@ -409,7 +410,7 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'System Configuration',
|
||||
AppLocalizations.of(context)!.sysConfigTitle,
|
||||
style: theme.textTheme.headlineMedium?.copyWith(
|
||||
color: colorScheme.onBackground,
|
||||
fontWeight: FontWeight.w700,
|
||||
@@ -417,7 +418,7 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
),
|
||||
const SizedBox(height: UIConstants.spacing8),
|
||||
Text(
|
||||
'Configure system-wide parameters and settings',
|
||||
AppLocalizations.of(context)!.sysConfigSubtitle,
|
||||
style: theme.textTheme.bodyLarge?.copyWith(
|
||||
color: colorScheme.onSurfaceVariant,
|
||||
),
|
||||
@@ -691,7 +692,8 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
),
|
||||
const SizedBox(width: UIConstants.spacing8),
|
||||
Text(
|
||||
'Generating dynamic theme...',
|
||||
AppLocalizations.of(context)!
|
||||
.generatingTheme,
|
||||
style: TextStyle(
|
||||
color: Colors.blue,
|
||||
fontSize: 12,
|
||||
@@ -720,7 +722,8 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
),
|
||||
const SizedBox(width: UIConstants.spacing8),
|
||||
Text(
|
||||
'Dynamic theme applied! Colors extracted from logo.',
|
||||
AppLocalizations.of(context)!
|
||||
.themeApplied,
|
||||
style: TextStyle(
|
||||
color: Colors.green,
|
||||
fontSize: 12,
|
||||
@@ -742,7 +745,7 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: ModernButton(
|
||||
text: 'Upload Logo',
|
||||
text: AppLocalizations.of(context)!.uploadLogo,
|
||||
type: ModernButtonType.primary,
|
||||
size: ModernButtonSize.medium,
|
||||
icon: Icon(Icons.upload),
|
||||
@@ -757,7 +760,7 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: ModernButton(
|
||||
text: 'Clear Logo',
|
||||
text: AppLocalizations.of(context)!.clearLogo,
|
||||
type: ModernButtonType.outline,
|
||||
size: ModernButtonSize.medium,
|
||||
icon: Icon(Icons.delete_outline),
|
||||
@@ -788,7 +791,8 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
const SizedBox(width: UIConstants.spacing8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'Theme is applied immediately! Click "Upload Logo" to save the logo permanently to the database. The dynamic theme will work even if upload fails.',
|
||||
AppLocalizations.of(context)!
|
||||
.themeImmediateNote,
|
||||
style: TextStyle(
|
||||
color: AppColorScheme.info,
|
||||
fontSize: 12,
|
||||
@@ -806,7 +810,7 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: ModernButton(
|
||||
text: 'Upload New Logo',
|
||||
text: AppLocalizations.of(context)!.uploadNewLogo,
|
||||
type: ModernButtonType.primary,
|
||||
size: ModernButtonSize.medium,
|
||||
icon: Icon(Icons.upload),
|
||||
@@ -821,7 +825,8 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: ModernButton(
|
||||
text: 'Remove Logo',
|
||||
text:
|
||||
AppLocalizations.of(context)!.removeLogo,
|
||||
type: ModernButtonType.danger,
|
||||
size: ModernButtonSize.medium,
|
||||
icon: Icon(Icons.delete_outline),
|
||||
@@ -852,7 +857,8 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
const SizedBox(width: UIConstants.spacing8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'Company logo is already uploaded and saved in the system. You can upload a new one or remove the existing logo.',
|
||||
AppLocalizations.of(context)!
|
||||
.logoAlreadyUploaded,
|
||||
style: TextStyle(
|
||||
color: AppColorScheme.success,
|
||||
fontSize: 12,
|
||||
@@ -913,7 +919,7 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Enable Manual Override',
|
||||
AppLocalizations.of(context)!.manualOverride,
|
||||
style: theme.textTheme.titleMedium?.copyWith(
|
||||
color: cs.onSurface,
|
||||
fontWeight: FontWeight.w600,
|
||||
@@ -938,7 +944,7 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
),
|
||||
const SizedBox(height: UIConstants.spacing12),
|
||||
_buildColorRow(
|
||||
label: 'Primary',
|
||||
label: AppLocalizations.of(context)!.colorPrimary,
|
||||
color: effectivePrimary,
|
||||
onPick: () async {
|
||||
final picked = await _pickColor(context, effectivePrimary);
|
||||
@@ -949,7 +955,7 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
),
|
||||
const SizedBox(height: UIConstants.spacing12),
|
||||
_buildColorRow(
|
||||
label: 'Secondary',
|
||||
label: AppLocalizations.of(context)!.colorSecondary,
|
||||
color: effectiveSecondary,
|
||||
onPick: () async {
|
||||
final picked =
|
||||
@@ -961,7 +967,7 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
),
|
||||
const SizedBox(height: UIConstants.spacing12),
|
||||
_buildColorRow(
|
||||
label: 'Tertiary',
|
||||
label: AppLocalizations.of(context)!.colorTertiary,
|
||||
color: effectiveTertiary,
|
||||
onPick: () async {
|
||||
final picked = await _pickColor(context, effectiveTertiary);
|
||||
@@ -975,7 +981,8 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
children: [
|
||||
Expanded(
|
||||
child: ModernButton(
|
||||
text: 'Reset to Logo Colors',
|
||||
text: AppLocalizations.of(context)!
|
||||
.resetLogoColors,
|
||||
type: ModernButtonType.outline,
|
||||
size: ModernButtonSize.medium,
|
||||
icon: Icon(Icons.refresh),
|
||||
@@ -987,7 +994,8 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
const SizedBox(width: UIConstants.spacing12),
|
||||
Expanded(
|
||||
child: ModernButton(
|
||||
text: 'Reset to Default',
|
||||
text: AppLocalizations.of(context)!
|
||||
.resetDefault,
|
||||
type: ModernButtonType.danger,
|
||||
size: ModernButtonSize.medium,
|
||||
icon: Icon(Icons.settings_backup_restore),
|
||||
@@ -1041,7 +1049,7 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
),
|
||||
),
|
||||
ModernButton(
|
||||
text: 'Edit',
|
||||
text: AppLocalizations.of(context)!.edit,
|
||||
type: ModernButtonType.text,
|
||||
size: ModernButtonSize.small,
|
||||
onPressed: () async {
|
||||
@@ -1073,7 +1081,7 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Pick a color'),
|
||||
title: Text(AppLocalizations.of(context)!.pickColor),
|
||||
content: SizedBox(
|
||||
width: 320,
|
||||
child: GridView.builder(
|
||||
@@ -1105,7 +1113,7 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: const Text('Cancel'),
|
||||
child: Text(AppLocalizations.of(context)!.cancel),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -1156,7 +1164,7 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'User Registration',
|
||||
AppLocalizations.of(context)!.userRegistration,
|
||||
style: theme.textTheme.titleMedium?.copyWith(
|
||||
color: colorScheme.onSurface,
|
||||
fontWeight: FontWeight.w600,
|
||||
@@ -1164,7 +1172,7 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
),
|
||||
const SizedBox(height: UIConstants.spacing4),
|
||||
Text(
|
||||
'Allow new users to register accounts',
|
||||
AppLocalizations.of(context)!.allowUserRegistration,
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
color: colorScheme.onSurfaceVariant,
|
||||
),
|
||||
@@ -1194,7 +1202,7 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
child: ModernButton(
|
||||
text: 'Save Configuration',
|
||||
text: AppLocalizations.of(context)!.saveConfiguration,
|
||||
type: ModernButtonType.primary,
|
||||
size: ModernButtonSize.large,
|
||||
icon: Icon(Icons.save),
|
||||
@@ -1266,16 +1274,18 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
_buildDrawerItem(
|
||||
context, theme, colorScheme, Icons.home, 'Home', () {
|
||||
context, theme, colorScheme, Icons.home,
|
||||
AppLocalizations.of(context)!.drawerHome, () {
|
||||
Navigator.of(context).pushReplacementNamed('/');
|
||||
}),
|
||||
_buildDrawerItem(context, theme, colorScheme, Icons.settings,
|
||||
'System Parameters', () {
|
||||
AppLocalizations.of(context)!.systemParameters, () {
|
||||
Navigator.of(context)
|
||||
.pushReplacementNamed('/system_parameters');
|
||||
}, isSelected: true),
|
||||
_buildDrawerItem(
|
||||
context, theme, colorScheme, Icons.people, 'Users', () {
|
||||
context, theme, colorScheme, Icons.people,
|
||||
AppLocalizations.of(context)!.drawerUsers, () {
|
||||
Navigator.of(context).pushReplacementNamed('/users');
|
||||
}),
|
||||
_buildDrawerItem(
|
||||
@@ -1283,41 +1293,49 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
Navigator.of(context).pushReplacementNamed('/roles');
|
||||
}),
|
||||
_buildDrawerItem(
|
||||
context, theme, colorScheme, Icons.business, 'Departments',
|
||||
context, theme, colorScheme, Icons.business,
|
||||
AppLocalizations.of(context)!.drawerDepartments,
|
||||
() {
|
||||
Navigator.of(context).pushReplacementNamed('/departments');
|
||||
}),
|
||||
_buildDrawerItem(
|
||||
context, theme, colorScheme, Icons.work, 'Positions', () {
|
||||
context, theme, colorScheme, Icons.work,
|
||||
AppLocalizations.of(context)!.drawerPositions, () {
|
||||
Navigator.of(context).pushReplacementNamed('/positions');
|
||||
}),
|
||||
_buildDrawerItem(context, theme, colorScheme,
|
||||
Icons.monetization_on, 'Charges', () {
|
||||
Icons.monetization_on,
|
||||
AppLocalizations.of(context)!.drawerCharges, () {
|
||||
Navigator.of(context).pushReplacementNamed('/charges');
|
||||
}),
|
||||
_buildDrawerItem(
|
||||
context, theme, colorScheme, Icons.calendar_today, 'Weeks',
|
||||
context, theme, colorScheme, Icons.calendar_today,
|
||||
AppLocalizations.of(context)!.drawerWeeks,
|
||||
() {
|
||||
Navigator.of(context).pushReplacementNamed('/weeks');
|
||||
}),
|
||||
_buildDrawerItem(
|
||||
context, theme, colorScheme, Icons.schedule, 'Shifts', () {
|
||||
context, theme, colorScheme, Icons.schedule,
|
||||
AppLocalizations.of(context)!.drawerShifts, () {
|
||||
Navigator.of(context).pushReplacementNamed('/shifts');
|
||||
}),
|
||||
_buildDrawerItem(
|
||||
context, theme, colorScheme, Icons.payment, 'Billing', () {
|
||||
context, theme, colorScheme, Icons.payment,
|
||||
AppLocalizations.of(context)!.drawerBilling, () {
|
||||
Navigator.of(context).pushReplacementNamed('/billing');
|
||||
}),
|
||||
_buildDrawerItem(context, theme, colorScheme, Icons.swap_horiz,
|
||||
'EDI Settings', () {
|
||||
AppLocalizations.of(context)!.drawerEdi, () {
|
||||
Navigator.of(context).pushReplacementNamed('/edi_settings');
|
||||
}),
|
||||
_buildDrawerItem(context, theme, colorScheme,
|
||||
Icons.business_center, 'Company', () {
|
||||
Icons.business_center,
|
||||
AppLocalizations.of(context)!.drawerCompany, () {
|
||||
Navigator.of(context).pushReplacementNamed('/company');
|
||||
}),
|
||||
_buildDrawerItem(
|
||||
context, theme, colorScheme, Icons.image, 'Logo', () {
|
||||
context, theme, colorScheme, Icons.image,
|
||||
AppLocalizations.of(context)!.drawerLogo, () {
|
||||
Navigator.of(context).pushReplacementNamed('/logo');
|
||||
}),
|
||||
],
|
||||
@@ -1328,7 +1346,7 @@ class _SystemParametersViewState extends State<SystemParametersView>
|
||||
Container(
|
||||
padding: const EdgeInsets.all(UIConstants.spacing24),
|
||||
child: ModernButton(
|
||||
text: 'Logout',
|
||||
text: AppLocalizations.of(context)!.logoutAction,
|
||||
type: ModernButtonType.danger,
|
||||
size: ModernButtonSize.medium,
|
||||
icon: Icon(Icons.logout),
|
||||
|
||||
Reference in New Issue
Block a user