Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
description: This file stores settings for Dart & Flutter DevTools.
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
extensions:
8 changes: 6 additions & 2 deletions lib/core/common/widgets/any_step_shimmer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';

class AnyStepShimmer extends StatelessWidget {
const AnyStepShimmer({super.key, this.height, this.width});
const AnyStepShimmer({super.key, this.height, this.width, this.borderRadius});

final double? height;
final double? width;
final BorderRadius? borderRadius;

@override
Widget build(BuildContext context) {
Expand All @@ -16,7 +17,10 @@ class AnyStepShimmer extends StatelessWidget {
child: Container(
height: height ?? 16,
width: width ?? double.infinity,
color: AnyStepColors.grayDark.withAlpha(40),
decoration: BoxDecoration(
color: AnyStepColors.grayDark.withAlpha(40),
borderRadius: borderRadius ?? BorderRadius.circular(8),
),
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class _ForgotPasswordScreenState extends ConsumerState<ForgotPasswordScreen> {
final loc = AppLocalizations.of(context);

return AnyStepScaffold(
appBar: AnyStepAppBar(title: Text(loc.forgotPasswordTitle)),
appBar: const AnyStepAppBar(),
body: MaxWidthContainer(
child: Padding(
padding: const EdgeInsets.all(AnyStepSpacing.md16),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class _ResetPasswordScreenState extends ConsumerState<ResetPasswordScreen> {
final loc = AppLocalizations.of(context);

return AnyStepScaffold(
appBar: AnyStepAppBar(title: Text(loc.resetPasswordTitle)),
appBar: const AnyStepAppBar(),
body: MaxWidthContainer(
child: Padding(
padding: const EdgeInsets.all(AnyStepSpacing.md16),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:anystep/core/common/constants/spacing.dart';
import 'package:anystep/core/common/widgets/any_step_shimmer.dart';
import 'package:anystep/core/features/events/data/event_repository.dart';
import 'package:anystep/core/features/events/domain/event.dart';
import 'package:anystep/l10n/generated/app_localizations.dart';
Expand Down Expand Up @@ -41,18 +42,31 @@ class _DashboardCalendarCardState extends ConsumerState<DashboardCalendarCard> {
child: Padding(
padding: const EdgeInsets.all(AnyStepSpacing.md16),
child: eventsAsync.when(
loading: () => const SizedBox(
height: 280,
child: Center(child: CircularProgressIndicator()),
),
error: (e, st) => SizedBox(
height: 280,
child: Center(child: Text(loc.failedToLoad)),
loading: () => SizedBox(
height: 380,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: const [
SizedBox(height: AnyStepSpacing.md14),
Center(child: AnyStepShimmer(height: 24, width: 140)),
SizedBox(height: AnyStepSpacing.sm10),
AnyStepShimmer(height: 280),
SizedBox(height: AnyStepSpacing.md12),
AnyStepShimmer(height: 16, width: 220),
SizedBox(height: AnyStepSpacing.sm8),
AnyStepShimmer(height: 16, width: 180),
],
),
),
error: (e, st) => SizedBox(height: 380, child: Center(child: Text(loc.failedToLoad))),
data: (events) {
final eventsByDay = <DateTime, List<EventModel>>{};
for (final event in events) {
final dateKey = DateTime(event.startTime.year, event.startTime.month, event.startTime.day);
final dateKey = DateTime(
event.startTime.year,
event.startTime.month,
event.startTime.day,
);
eventsByDay.putIfAbsent(dateKey, () => []).add(event);
}
final selected = _selectedDay ?? _focusedDay;
Expand Down Expand Up @@ -98,8 +112,14 @@ class _DashboardCalendarCardState extends ConsumerState<DashboardCalendarCard> {
headerStyle: HeaderStyle(
titleCentered: true,
formatButtonVisible: false,
leftChevronIcon: Icon(Icons.chevron_left, color: Theme.of(context).iconTheme.color),
rightChevronIcon: Icon(Icons.chevron_right, color: Theme.of(context).iconTheme.color),
leftChevronIcon: Icon(
Icons.chevron_left,
color: Theme.of(context).iconTheme.color,
),
rightChevronIcon: Icon(
Icons.chevron_right,
color: Theme.of(context).iconTheme.color,
),
),
),
const SizedBox(height: AnyStepSpacing.md12),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:anystep/core/common/constants/spacing.dart';
import 'package:anystep/core/common/widgets/any_step_loading_indicator.dart';
import 'package:anystep/core/common/widgets/any_step_shimmer.dart';
import 'package:anystep/core/features/reports/data/volunteer_hours_providers.dart';
import 'package:anystep/l10n/generated/app_localizations.dart';
import 'package:fl_chart/fl_chart.dart';
Expand Down Expand Up @@ -29,8 +30,7 @@ class DashboardMetricsCard extends StatelessWidget {
String Function(VolunteerHoursSummary) builder,
) {
return summary.when(
loading: () =>
const SizedBox(height: 16, width: 16, child: CircularProgressIndicator(strokeWidth: 2)),
loading: () => const AnyStepShimmer(height: 18, width: 52),
error: (e, st) => const Text('—'),
data: (data) => Text(builder(data)),
);
Expand Down Expand Up @@ -216,7 +216,7 @@ class _HeroMetric extends StatelessWidget {
height: 42,
child: Align(
alignment: Alignment.centerLeft,
child: CircularProgressIndicator.adaptive(),
child: AnyStepShimmer(height: 24, width: 52),
),
)
: Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class _EventFeedScreenState extends ConsumerState<EventFeedScreen> {
metricsCard,
const DashboardCalendarCard(),
],
aspectRatio: 1.1,
aspectRatio: 0.9,
),
);
} else {
Expand All @@ -211,7 +211,7 @@ class _EventFeedScreenState extends ConsumerState<EventFeedScreen> {
metricsCard,
const DashboardCalendarCard(),
],
aspectRatio: 1.1,
aspectRatio: 0.9,
),
);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class _SignAgreementScreenState extends ConsumerState<SignAgreementScreen> {
child: Scrollbar(
thumbVisibility: true,
child: SingleChildScrollView(
primary: true,
physics: const ClampingScrollPhysics(),
child: Column(
children: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,9 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
postalCodeFieldName: 'zipCode',
streetSecondaryLabelText: loc.streetAddress2,
isUserAddress: true,
disableSearch: true,
includeEventAddresses: false,
includeUserAddresses: true,
includeUserAddresses: false,
),

const SizedBox(height: AnyStepSpacing.md16),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class _ProfileFormState extends ConsumerState<ProfileForm> {
formKey: _formKey,
initialAddressId: widget.user.addressId ?? widget.user.address?.id,
isUserAddress: true,
disableSearch: true,
includeEventAddresses: false,
includeUserAddresses: true,
),
Expand Down