Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Komyyy committed Feb 6, 2025
1 parent 84d6a32 commit e9be8d6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/widgets/profile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class _UserWidget extends StatelessWidget {
}
}

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

final User user;

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

0 comments on commit e9be8d6

Please sign in to comment.