67 lines
1.9 KiB
Dart
67 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:mobile_monitoring/core/constants/constants.dart';
|
|
import 'package:mobile_monitoring/logic/controllers/controllers.dart';
|
|
import 'package:mobile_monitoring/ui/shared/shared.dart';
|
|
|
|
/// Graph Menu Page (Settings) - Frontend/UI Layer
|
|
/// Hanya menangani UI logic dan rendering
|
|
class GraphMenuPage extends StatefulWidget {
|
|
const GraphMenuPage({super.key});
|
|
|
|
@override
|
|
State<GraphMenuPage> createState() => _GraphMenuPageState();
|
|
}
|
|
|
|
class _GraphMenuPageState extends State<GraphMenuPage> {
|
|
final _controller = GraphController();
|
|
|
|
@override
|
|
void dispose() {
|
|
_controller.dispose();
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final userId = _controller.currentUserId;
|
|
final screenWidth = MediaQuery.of(context).size.width;
|
|
final isTablet = screenWidth >= 600;
|
|
final isSmallScreen = screenWidth < 360;
|
|
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: Text(
|
|
AppStrings.monitoringGrafik,
|
|
style: TextStyle(
|
|
fontSize: isTablet ? 22 : (isSmallScreen ? 16 : 18),
|
|
),
|
|
),
|
|
backgroundColor: AppColors.primary,
|
|
elevation: 0,
|
|
centerTitle: true,
|
|
foregroundColor: AppColors.white,
|
|
),
|
|
backgroundColor: AppColors.white,
|
|
body: Center(
|
|
child: SingleChildScrollView(
|
|
child: Padding(
|
|
padding: EdgeInsets.symmetric(
|
|
horizontal: isTablet ? 24.0 : (isSmallScreen ? 12.0 : 16.0),
|
|
),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
SizedBox(height: isTablet ? 32 : 24),
|
|
GraphWidget(userId: userId),
|
|
SizedBox(height: isTablet ? 40 : 32),
|
|
WeeklyStatsCard(userId: userId),
|
|
SizedBox(height: isTablet ? 40 : 32),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|