Skip to content

Commit 31d2e8d

Browse files
committed
Revert "Merge branch 'mve3' into main"
This reverts commit 01db066, reversing changes made to 3bf0ccf.
1 parent 01db066 commit 31d2e8d

File tree

30 files changed

+120
-1277
lines changed

30 files changed

+120
-1277
lines changed

catalyst_voices/apps/voices/lib/common/formatters/date_formatter.dart

+3-26
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,10 @@ abstract class DateFormatter {
1010
/// - Yesterday
1111
/// - 2 days ago
1212
/// - Other cases: yMMMMd date format.
13-
static String formatRecentDate(
14-
VoicesLocalizations l10n,
15-
DateTime dateTime, {
16-
DateTime? from,
17-
}) {
18-
from ??= DateTimeExt.now();
13+
static String formatRecentDate(VoicesLocalizations l10n, DateTime dateTime) {
14+
final now = DateTimeExt.now();
1915

20-
final today = DateTime(from.year, from.month, from.day, 12);
16+
final today = DateTime(now.year, now.month, now.day, 12);
2117
if (dateTime.isSameDateAs(today)) return l10n.today;
2218

2319
final tomorrow = today.plusDays(1);
@@ -31,23 +27,4 @@ abstract class DateFormatter {
3127

3228
return DateFormat.yMMMMd().format(dateTime);
3329
}
34-
35-
static String formatInDays(
36-
VoicesLocalizations l10n,
37-
DateTime dateTime, {
38-
DateTime? from,
39-
}) {
40-
from ??= DateTimeExt.now();
41-
42-
final days = dateTime.isAfter(from) ? dateTime.difference(from).inDays : 0;
43-
44-
return l10n.inXDays(days);
45-
}
46-
47-
static String formatShortMonth(
48-
VoicesLocalizations l10n,
49-
DateTime dateTime,
50-
) {
51-
return DateFormat.MMM().format(dateTime);
52-
}
5330
}

catalyst_voices/apps/voices/lib/pages/account/unlock_keychain_dialog.dart

-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ class _UnlockPassword extends StatelessWidget {
155155
Widget build(BuildContext context) {
156156
return VoicesPasswordTextField(
157157
controller: controller,
158-
autofocus: true,
159158
decoration: VoicesTextFieldDecoration(
160159
labelText: context.l10n.unlockDialogHint,
161160
errorText: error?.message(context),

catalyst_voices/apps/voices/lib/pages/workspace/workspace_guidance_view.dart

+19-20
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import 'package:flutter/material.dart';
77

88
class GuidanceView extends StatefulWidget {
99
final List<Guidance> guidances;
10-
1110
const GuidanceView(this.guidances, {super.key});
1211

1312
@override
@@ -19,6 +18,25 @@ class _GuidanceViewState extends State<GuidanceView> {
1918

2019
GuidanceType? selectedType;
2120

21+
@override
22+
void initState() {
23+
super.initState();
24+
filteredGuidances
25+
..clear()
26+
..addAll(widget.guidances);
27+
}
28+
29+
@override
30+
void didUpdateWidget(GuidanceView oldWidget) {
31+
super.didUpdateWidget(oldWidget);
32+
if (oldWidget.guidances != widget.guidances) {
33+
filteredGuidances
34+
..clear()
35+
..addAll(widget.guidances);
36+
_filterGuidances(selectedType);
37+
}
38+
}
39+
2240
@override
2341
Widget build(BuildContext context) {
2442
return Column(
@@ -56,25 +74,6 @@ class _GuidanceViewState extends State<GuidanceView> {
5674
);
5775
}
5876

59-
@override
60-
void didUpdateWidget(GuidanceView oldWidget) {
61-
super.didUpdateWidget(oldWidget);
62-
if (oldWidget.guidances != widget.guidances) {
63-
filteredGuidances
64-
..clear()
65-
..addAll(widget.guidances);
66-
_filterGuidances(selectedType);
67-
}
68-
}
69-
70-
@override
71-
void initState() {
72-
super.initState();
73-
filteredGuidances
74-
..clear()
75-
..addAll(widget.guidances);
76-
}
77-
7877
void _filterGuidances(GuidanceType? type) {
7978
selectedType = type;
8079
filteredGuidances

catalyst_voices/apps/voices/lib/widgets/empty_state/empty_state.dart

-77
This file was deleted.

catalyst_voices/apps/voices/lib/widgets/images/voices_image_scheme.dart

-23
This file was deleted.

catalyst_voices/apps/voices/lib/widgets/menu/voices_menu.dart

+18-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:catalyst_voices_assets/catalyst_voices_assets.dart';
2-
import 'package:catalyst_voices_view_models/catalyst_voices_view_models.dart';
32
import 'package:flutter/material.dart';
43

54
/// A menu of the app that
@@ -69,7 +68,7 @@ class _MenuButton extends StatelessWidget {
6968

7069
final textStyle = textTheme.bodyMedium?.copyWith(
7170
color:
72-
menuItem.isEnabled ? textTheme.bodySmall?.color : theme.disabledColor,
71+
menuItem.enabled ? textTheme.bodySmall?.color : theme.disabledColor,
7372
);
7473

7574
final children = menuChildren;
@@ -86,7 +85,7 @@ class _MenuButton extends StatelessWidget {
8685
child: IconTheme(
8786
data: IconThemeData(
8887
size: 24,
89-
color: menuItem.isEnabled
88+
color: menuItem.enabled
9089
? textTheme.bodySmall?.color
9190
: theme.disabledColor,
9291
),
@@ -139,29 +138,32 @@ class _MenuButton extends StatelessWidget {
139138
}
140139

141140
/// Model representing Menu Item
142-
final class MenuItem extends BasicPopupMenuItem {
143-
const MenuItem({
144-
required super.id,
145-
required super.label,
146-
super.isEnabled = true,
147-
super.icon,
148-
super.showDivider = false,
141+
class MenuItem {
142+
final int id;
143+
final String label;
144+
final Widget? icon;
145+
final bool showDivider;
146+
final bool enabled;
147+
148+
MenuItem({
149+
required this.id,
150+
required this.label,
151+
this.icon,
152+
this.showDivider = false,
153+
this.enabled = true,
149154
});
150155
}
151156

152157
/// Model representing Submenu Item
153158
/// and extending from MenuItem
154-
final class SubMenuItem extends MenuItem {
155-
final List<MenuItem> children;
159+
class SubMenuItem extends MenuItem {
160+
List<MenuItem> children;
156161

157-
const SubMenuItem({
162+
SubMenuItem({
158163
required super.id,
159164
required super.label,
160165
required this.children,
161166
super.icon,
162167
super.showDivider,
163168
});
164-
165-
@override
166-
List<Object?> get props => super.props + [children];
167169
}

0 commit comments

Comments
 (0)