From 011407ad863447b9ad8150591d6286c3fece73f9 Mon Sep 17 00:00:00 2001 From: Anton Malofeev Date: Mon, 25 Oct 2021 15:39:24 +0300 Subject: [PATCH] wip: localization --- lib/screens/home/small_home_screen.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/screens/home/small_home_screen.dart b/lib/screens/home/small_home_screen.dart index 3fb2ee3d..4a20ad03 100644 --- a/lib/screens/home/small_home_screen.dart +++ b/lib/screens/home/small_home_screen.dart @@ -133,7 +133,14 @@ class _SmallHomeScreenState extends State { ], ), ); - const _welcome = 'Good evening'; + final _now = DateTime.now(); + final _welcome = () { + if (_now.hour < 7) return 'Good night'; + if (_now.hour < 12 && _now.hour >= 7) return 'Good morning'; + if (_now.hour > 18) return 'Good evening'; + return 'Good day'; + }(); + final appBar = AppBar( title: Text( _welcome,