Skip to content
Merged
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
9 changes: 8 additions & 1 deletion lib/src/view/home/home_tab_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,13 @@ class _EditableWidget extends ConsumerWidget {
class _HelloWidget extends ConsumerWidget {
const _HelloWidget();

/// Returns the string representing the current time of day
/// Used in the greeting widget to provide visual time indicator
String getTimeOfDayIcon() {
final hour = DateTime.now().hour;
return hour >= 6 && hour < 18 ? 'β˜€οΈ' : 'πŸŒ™';
}

@override
Widget build(BuildContext context, WidgetRef ref) {
final session = ref.watch(authSessionProvider);
Expand Down Expand Up @@ -459,7 +466,7 @@ class _HelloWidget extends ConsumerWidget {
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.wb_sunny, size: iconSize, color: context.lichessColors.brag),
Text(getTimeOfDayIcon(), style: const TextStyle(fontSize: iconSize, height: 1.0)),
const SizedBox(width: 5.0),
if (user != null)
Flexible(
Expand Down