Skip to content

Commit

Permalink
✨ Made greeting more consistent throughout
Browse files Browse the repository at this point in the history
  • Loading branch information
devaryakjha committed Oct 23, 2023
1 parent 144f1ab commit cdb42d8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
15 changes: 14 additions & 1 deletion lib/features/home/ui/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'package:varanasi_mobile_app/features/home/bloc/home_bloc.dart';
import 'package:varanasi_mobile_app/features/home/data/helpers/home_state_selectors.dart';
import 'package:varanasi_mobile_app/features/home/ui/home_widgets/spacer.dart';
import 'package:varanasi_mobile_app/features/home/ui/home_widgets/trending/trending.dart';
import 'package:varanasi_mobile_app/gen/assets.gen.dart';
import 'package:varanasi_mobile_app/utils/extensions/extensions.dart';
import 'package:varanasi_mobile_app/utils/generate_greeting.dart';
import 'package:varanasi_mobile_app/utils/routes.dart';
import 'package:varanasi_mobile_app/widgets/animated_overflow_text.dart';
Expand All @@ -29,7 +31,18 @@ class HomePage extends StatelessWidget {
return Scaffold(
appBar: AppBar(
centerTitle: false,
title: AnimatedText(greeting, maxLines: 1),
title: Row(
children: [
Assets.icon.appIconMonotone.svg(width: 32, height: 32),
const SizedBox(width: 8),
AnimatedText(
greeting,
maxLines: 1,
style: context.textTheme.titleLarge
?.copyWith(fontWeight: FontWeight.bold),
),
],
),
actions: [
IconButton(
iconSize: 30,
Expand Down
6 changes: 3 additions & 3 deletions lib/utils/generate_greeting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ String generateGreeting() {
'Hello!'
];
if (hour < 12) {
return '${greetings[0]} Ready for some music?';
return greetings[0];
} else if (hour < 18) {
return '${greetings[1]} How about some tunes?';
return greetings[1];
} else {
return '${greetings[2]} Time for some music?';
return greetings[2];
}
}

0 comments on commit cdb42d8

Please sign in to comment.