feat(flutter): 应用克莱因蓝主题与印尼语适配
This commit is contained in:
1 parent
e1147cfcba
commit
10d448c8ba
31 files changed
+891
-521
No files matched your search
@@ -0,0 +1,15 @@
|
||||
// Author: fruit.com.cn
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Formats a timestamp with the active Material locale and 12/24-hour setting.
|
||||
String formatLocalizedDateTime(BuildContext context, DateTime value) {
|
||||
final localizations = MaterialLocalizations.of(context);
|
||||
final local = value.toLocal();
|
||||
final date = localizations.formatCompactDate(local);
|
||||
final time = localizations.formatTimeOfDay(
|
||||
TimeOfDay.fromDateTime(local),
|
||||
alwaysUse24HourFormat: MediaQuery.alwaysUse24HourFormatOf(context),
|
||||
);
|
||||
return '$date $time';
|
||||
}
|
||||
Reference in new issue
Block a user