Skip to content

Commit e9be8d6

Browse files
committed
docs
1 parent 84d6a32 commit e9be8d6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/widgets/profile.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ class _UserWidget extends StatelessWidget {
314314
}
315315
}
316316

317-
@visibleForTesting
317+
/// The text of current time in [user]'s timezone.
318318
class UserLocalTimeText extends StatelessWidget {
319319
const UserLocalTimeText({
320320
super.key,
@@ -323,6 +323,11 @@ class UserLocalTimeText extends StatelessWidget {
323323

324324
final User user;
325325

326+
/// Initialize the timezone database used to know time difference from a timezone string.
327+
///
328+
/// Usually, database initialization is done using `initializeTimeZones`, but it takes >100ms and not asynchronous.
329+
/// So, we initialize database from the assets file copied from timezone library.
330+
/// This file is checked up-to-date in `test/widgets/profile_test.dart`.
326331
static Future<void> initializeTimezonesUsingAssets() async {
327332
final blob = Uint8List.sublistView(await rootBundle.load('assets/timezone/latest_all.tzf'));
328333
tz.initializeDatabase(blob);

0 commit comments

Comments
 (0)