step 8 : add ui homescreen

This commit is contained in:
sindhu
2024-01-25 15:08:52 +07:00
parent b772e74e17
commit b85e3515e8
21 changed files with 928 additions and 158 deletions

25
lib/widget/real_date.dart Normal file
View File

@@ -0,0 +1,25 @@
import 'dart:async';
import 'package:absensi_sas_flutter/app/constant.dart';
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:intl/intl.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
class RealTimeFormattedDate extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final currentTime = useState<DateTime>(DateTime.now());
// Format waktu menjadi tanggal yang diinginkan
String formattedDate =
DateFormat('EEEE, d MMMM y', 'id_ID').format(currentTime.value);
// Tampilkan widget Text dengan tanggal yang diformat
return Text(
formattedDate,
style: Constant.date_600(context: context)
.copyWith(color: Constant.textBlack),
);
}
}