Refactor widgets & imports; add krow_domain
Add local krow_domain dependency to client, staff apps and client home package. Numerous UI/widget cleanups across features: add const where applicable, use explicit List<Widget> types and List<Widget>.generate, add super.key to constructors, tighten BlocProvider generics, replace some Containers with SizedBox, and simplify InputDecoration/Border constructors. Fix API error handler to return a const UnknownException. Update internal imports to package-style paths (staff_home, staff_payments, staff_main repository interface) and normalize Flutter imports (use material.dart). Add missing braces for early returns in tax form pages. Mostly formatting and small API/typing refactors with no behavioral changes intended.
This commit is contained in:
@@ -10,7 +10,7 @@ class EditProfilePage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _EditProfilePageState extends State<EditProfilePage> {
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||
late TextEditingController _firstNameController;
|
||||
late TextEditingController _lastNameController;
|
||||
late TextEditingController _emailController;
|
||||
@@ -50,11 +50,11 @@ class _EditProfilePageState extends State<EditProfilePage> {
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Center(
|
||||
child: Stack(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
children: <Widget>[
|
||||
const CircleAvatar(
|
||||
radius: 50,
|
||||
backgroundColor: UiColors.bgSecondary,
|
||||
child: const Icon(UiIcons.user, size: 40, color: UiColors.primary),
|
||||
|
||||
@@ -180,7 +180,7 @@ class _NotificationsSettingsCard extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<ClientSettingsBloc, ClientSettingsState>(
|
||||
builder: (context, state) {
|
||||
builder: (BuildContext context, ClientSettingsState state) {
|
||||
return Card(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
@@ -202,7 +202,7 @@ class _NotificationsSettingsCard extends StatelessWidget {
|
||||
icon: UiIcons.bell,
|
||||
title: context.t.client_settings.preferences.push,
|
||||
value: state.pushEnabled,
|
||||
onChanged: (val) =>
|
||||
onChanged: (bool val) =>
|
||||
ReadContext(context).read<ClientSettingsBloc>().add(
|
||||
ClientSettingsNotificationToggled(
|
||||
type: 'push',
|
||||
@@ -214,7 +214,7 @@ class _NotificationsSettingsCard extends StatelessWidget {
|
||||
icon: UiIcons.mail,
|
||||
title: context.t.client_settings.preferences.email,
|
||||
value: state.emailEnabled,
|
||||
onChanged: (val) =>
|
||||
onChanged: (bool val) =>
|
||||
ReadContext(context).read<ClientSettingsBloc>().add(
|
||||
ClientSettingsNotificationToggled(
|
||||
type: 'email',
|
||||
@@ -226,7 +226,7 @@ class _NotificationsSettingsCard extends StatelessWidget {
|
||||
icon: UiIcons.phone,
|
||||
title: context.t.client_settings.preferences.sms,
|
||||
value: state.smsEnabled,
|
||||
onChanged: (val) =>
|
||||
onChanged: (bool val) =>
|
||||
ReadContext(context).read<ClientSettingsBloc>().add(
|
||||
ClientSettingsNotificationToggled(
|
||||
type: 'sms',
|
||||
@@ -244,10 +244,6 @@ class _NotificationsSettingsCard extends StatelessWidget {
|
||||
}
|
||||
|
||||
class _NotificationToggle extends StatelessWidget {
|
||||
final IconData icon;
|
||||
final String title;
|
||||
final bool value;
|
||||
final ValueChanged<bool> onChanged;
|
||||
|
||||
const _NotificationToggle({
|
||||
required this.icon,
|
||||
@@ -255,14 +251,18 @@ class _NotificationToggle extends StatelessWidget {
|
||||
required this.value,
|
||||
required this.onChanged,
|
||||
});
|
||||
final IconData icon;
|
||||
final String title;
|
||||
final bool value;
|
||||
final ValueChanged<bool> onChanged;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Icon(icon, size: 20, color: UiColors.iconSecondary),
|
||||
const SizedBox(width: UiConstants.space3),
|
||||
Text(title, style: UiTypography.footnote1m.textPrimary),
|
||||
|
||||
Reference in New Issue
Block a user