feat: Add a script for bulk GitHub issue creation and simplify the client settings profile header UI.
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:krow_core/core.dart';
|
||||
|
||||
import '../../blocs/client_settings_bloc.dart';
|
||||
|
||||
/// A widget that displays the primary actions for the settings page.
|
||||
@@ -27,10 +28,6 @@ class SettingsActions extends StatelessWidget {
|
||||
_QuickLinksCard(labels: labels),
|
||||
const SizedBox(height: UiConstants.space4),
|
||||
|
||||
// Notifications section
|
||||
_NotificationsSettingsCard(),
|
||||
const SizedBox(height: UiConstants.space4),
|
||||
|
||||
// Log Out button (outlined)
|
||||
BlocBuilder<ClientSettingsBloc, ClientSettingsState>(
|
||||
builder: (BuildContext context, ClientSettingsState state) {
|
||||
@@ -80,15 +77,14 @@ class SettingsActions extends StatelessWidget {
|
||||
|
||||
/// Handles the sign-out button click event.
|
||||
void _onSignoutClicked(BuildContext context) {
|
||||
ReadContext(context)
|
||||
.read<ClientSettingsBloc>()
|
||||
.add(const ClientSettingsSignOutRequested());
|
||||
ReadContext(
|
||||
context,
|
||||
).read<ClientSettingsBloc>().add(const ClientSettingsSignOutRequested());
|
||||
}
|
||||
}
|
||||
|
||||
/// Quick Links card — inline here since it's always part of SettingsActions ordering.
|
||||
class _QuickLinksCard extends StatelessWidget {
|
||||
|
||||
const _QuickLinksCard({required this.labels});
|
||||
final TranslationsClientSettingsProfileEn labels;
|
||||
|
||||
@@ -130,7 +126,6 @@ class _QuickLinksCard extends StatelessWidget {
|
||||
|
||||
/// A single quick link row item.
|
||||
class _QuickLinkItem extends StatelessWidget {
|
||||
|
||||
const _QuickLinkItem({
|
||||
required this.icon,
|
||||
required this.title,
|
||||
@@ -198,24 +193,36 @@ class _NotificationsSettingsCard extends StatelessWidget {
|
||||
icon: UiIcons.bell,
|
||||
title: context.t.client_settings.preferences.push,
|
||||
value: state.pushEnabled,
|
||||
onChanged: (val) => ReadContext(context).read<ClientSettingsBloc>().add(
|
||||
ClientSettingsNotificationToggled(type: 'push', isEnabled: val),
|
||||
onChanged: (val) =>
|
||||
ReadContext(context).read<ClientSettingsBloc>().add(
|
||||
ClientSettingsNotificationToggled(
|
||||
type: 'push',
|
||||
isEnabled: val,
|
||||
),
|
||||
),
|
||||
),
|
||||
_NotificationToggle(
|
||||
icon: UiIcons.mail,
|
||||
title: context.t.client_settings.preferences.email,
|
||||
value: state.emailEnabled,
|
||||
onChanged: (val) => ReadContext(context).read<ClientSettingsBloc>().add(
|
||||
ClientSettingsNotificationToggled(type: 'email', isEnabled: val),
|
||||
onChanged: (val) =>
|
||||
ReadContext(context).read<ClientSettingsBloc>().add(
|
||||
ClientSettingsNotificationToggled(
|
||||
type: 'email',
|
||||
isEnabled: val,
|
||||
),
|
||||
),
|
||||
),
|
||||
_NotificationToggle(
|
||||
icon: UiIcons.phone,
|
||||
title: context.t.client_settings.preferences.sms,
|
||||
value: state.smsEnabled,
|
||||
onChanged: (val) => ReadContext(context).read<ClientSettingsBloc>().add(
|
||||
ClientSettingsNotificationToggled(type: 'sms', isEnabled: val),
|
||||
onChanged: (val) =>
|
||||
ReadContext(context).read<ClientSettingsBloc>().add(
|
||||
ClientSettingsNotificationToggled(
|
||||
type: 'sms',
|
||||
isEnabled: val,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -12,7 +12,8 @@ class SettingsProfileHeader extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final TranslationsClientSettingsProfileEn labels = t.client_settings.profile;
|
||||
final TranslationsClientSettingsProfileEn labels =
|
||||
t.client_settings.profile;
|
||||
final dc.ClientSession? session = dc.ClientSessionStore.instance.session;
|
||||
final String businessName =
|
||||
session?.business?.businessName ?? 'Your Company';
|
||||
@@ -26,9 +27,7 @@ class SettingsProfileHeader extends StatelessWidget {
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.only(bottom: 36),
|
||||
decoration: const BoxDecoration(
|
||||
color: UiColors.primary,
|
||||
),
|
||||
decoration: const BoxDecoration(color: UiColors.primary),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
@@ -75,13 +74,6 @@ class SettingsProfileHeader extends StatelessWidget {
|
||||
color: UiColors.white.withValues(alpha: 0.6),
|
||||
width: 3,
|
||||
),
|
||||
boxShadow: <BoxShadow>[
|
||||
BoxShadow(
|
||||
color: UiColors.black.withValues(alpha: 0.15),
|
||||
blurRadius: 16,
|
||||
offset: const Offset(0, 6),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: ClipOval(
|
||||
child: photoUrl != null && photoUrl.isNotEmpty
|
||||
@@ -103,9 +95,7 @@ class SettingsProfileHeader extends StatelessWidget {
|
||||
// ── Business Name ─────────────────────────────────
|
||||
Text(
|
||||
businessName,
|
||||
style: UiTypography.headline3m.copyWith(
|
||||
color: UiColors.white,
|
||||
),
|
||||
style: UiTypography.headline3m.copyWith(color: UiColors.white),
|
||||
),
|
||||
|
||||
const SizedBox(height: UiConstants.space2),
|
||||
@@ -128,21 +118,6 @@ class SettingsProfileHeader extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: UiConstants.space5),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 100),
|
||||
child: UiButton.secondary(
|
||||
text: labels.edit_profile,
|
||||
size: UiButtonSize.small,
|
||||
onPressed: () =>
|
||||
Modular.to.pushNamed('${ClientPaths.settings}/edit-profile'),
|
||||
style: OutlinedButton.styleFrom(
|
||||
foregroundColor: UiColors.white,
|
||||
side: const BorderSide(color: UiColors.white, width: 1.5),
|
||||
backgroundColor: UiColors.white.withValues(alpha: 0.1),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user