Skip to content

Commit

Permalink
feat(cat-voices): Discovery page layout (#1577)
Browse files Browse the repository at this point in the history
* feat: hero-section header

* feat: creating discovery page layout for f14

* fix: remove unused keys for widget

* feat: adding to proposalViewmodel isfavorite param

* chore: removing guard on proposals page

* feat(cat-voices):  Current campaign - Discovery Page (#1614)

* feat: making section hero widget more generic

* chore: remove unused file

* fix: typo

* feat: creating ui layout for current campaign

* feat: adding timeline card ui layout

* feat: adding idea journey

* fix: styling

* fix: formatting

* chore: making changes acording to reviews

* fix: styling

* chore: delete unused todos

* feat(cat-voices): Hero section - discovery page (#1574)

* feat: making section hero widget more generic

* chore: remove unused file

* fix: typo

* feat: adding didupdatewidget

* chore: moving init func to other widget

* fix: styling

* feat: adding _effectiveController

* fix: mounted check

* fix: formatting
  • Loading branch information
LynxLynxx authored Jan 24, 2025
1 parent fbd167b commit 88b52a6
Show file tree
Hide file tree
Showing 27 changed files with 1,601 additions and 454 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import 'package:catalyst_voices_brands/catalyst_voices_brands.dart';
import 'package:flutter/material.dart';

extension BuildContextThemeExt on BuildContext {
ThemeData get theme => Theme.of(this);
TextTheme get textTheme => theme.textTheme;
ColorScheme get colorScheme => theme.colorScheme;
VoicesColorScheme get colors => theme.colors;
}
1 change: 1 addition & 0 deletions catalyst_voices/apps/voices/lib/common/ext/ext.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export 'brand_ext.dart';
export 'build_context_ext.dart';
export 'space_ext.dart';
export 'string_ext.dart';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import 'package:intl/intl.dart';

abstract class AmountFormatter {
static String decimalFormat(num value) {
return NumberFormat.decimalPattern().format(value);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:catalyst_voices_localization/catalyst_voices_localization.dart';
import 'package:catalyst_voices_shared/catalyst_voices_shared.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';

/// A [DateTime] formatter.
Expand Down Expand Up @@ -95,4 +96,27 @@ abstract class DateFormatter {

return '${nf.format(hours)}:${nf.format(minutes)}';
}

static String formatDateRange(
MaterialLocalizations localizations,
VoicesLocalizations l10n,
DateRange range,
) {
final from = range.from;
final to = range.to;
if (from != null && to != null) {
if (range.areDatesInSameWeek(localizations.firstDayOfWeekIndex)) {
return '${l10n.weekOf} ${DateFormat.MMMd().format(from)}';
}

// ignore: lines_longer_than_80_chars
return '${DateFormat.MMMd().format(from)} - ${DateFormat.MMMd().format(to)}';
} else if (to == null && from != null) {
return '${l10n.from} ${DateFormat.MMMd().format(from)}';
} else if (to != null && from == null) {
return '${l10n.to} ${DateFormat.MMMd().format(to)}';
}

return '';
}
}
Loading

0 comments on commit 88b52a6

Please sign in to comment.