Merge to main #1

Merged
agrilink merged 19 commits from develop-gitea into main 2024-12-30 04:37:02 +00:00
15 changed files with 53 additions and 83 deletions
Showing only changes of commit b797ac3f5e - Show all commits

View File

@ -1,28 +1 @@
import 'package:flutter/material.dart';
Future<dynamic> showInfo(BuildContext context, String title, String content) {
return showDialog(
context: context,
builder: (context) => AlertDialog(
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(title),
const SizedBox(height: 16),
Text(
style: Theme.of(context).textTheme.bodySmall,
content,
),
],
),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: const Text('OK'),
)
],
),
);
}

View File

@ -16,7 +16,7 @@ class ControlScreen extends StatelessWidget {
final provider = Provider.of<ControlProvider>(context, listen: true);
return Scaffold(
appBar: AppBar(
title: Text('Control', style: AppTheme.labelMedium),
title: Text('Kontrol', style: AppTheme.labelMedium),
centerTitle: true,
backgroundColor: Colors.white,
scrolledUnderElevation: 0,

View File

@ -26,22 +26,22 @@ class DashboardScreen extends StatelessWidget {
BottomNavigationBarItem(
icon: Icon(BootstrapIcons.house),
activeIcon: Icon(BootstrapIcons.house_fill),
label: 'Home',
label: 'Beranda',
),
BottomNavigationBarItem(
icon: Icon(BootstrapIcons.toggle_off),
activeIcon: Icon(BootstrapIcons.toggle_on),
label: 'Control',
label: 'Kontrol',
),
BottomNavigationBarItem(
icon: Icon(BootstrapIcons.flower1),
activeIcon: Icon(BootstrapIcons.flower1),
label: 'Plants',
label: 'Tanaman',
),
BottomNavigationBarItem(
icon: Icon(BootstrapIcons.gear),
activeIcon: Icon(BootstrapIcons.gear_fill),
label: 'Setting',
label: 'Pengaturan',
),
],
),

View File

@ -95,7 +95,7 @@ class ConductivityScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Soil Condutivity',
'Konduktifitas Tanah',
style: AppTheme.labelMedium,
textAlign: TextAlign.center,
),

View File

@ -1,5 +1,7 @@
import 'package:agrilink_vocpro/core/constant/app_theme.dart';
import 'package:agrilink_vocpro/core/state/result_state.dart';
import 'package:agrilink_vocpro/core/widgets/error_data_state_widget.dart';
import 'package:agrilink_vocpro/core/widgets/no_data_state_widget.dart';
import 'package:agrilink_vocpro/features/home/detail_pages/humidity/provider/humidity_provider.dart';
import 'package:agrilink_vocpro/features/home/provider/home_provider.dart';
import 'package:agrilink_vocpro/features/home/widgets/graphic_widget.dart';
@ -94,7 +96,7 @@ class HumidityScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Humidity',
'Kelembaban Udara',
style: AppTheme.labelMedium,
textAlign: TextAlign.center,
),
@ -145,39 +147,9 @@ class HumidityScreen extends StatelessWidget {
0),
);
case ResultState.error:
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
BootstrapIcons.exclamation_circle,
color: Colors.grey.shade400,
),
SizedBox(height: 8.h),
Text(
'Terjadi Kesalahan',
style: AppTheme.labelSmall,
),
],
),
);
return const ErrorDataStateWidget();
case ResultState.noData:
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
BootstrapIcons.database_fill_x,
color: Colors.grey.shade400,
),
SizedBox(height: 8.h),
Text(
'Tidak Ada Data',
style: AppTheme.labelSmall,
),
],
),
);
return const NoDataStateWidget();
case ResultState.initial:
return const SizedBox.shrink();
default:

View File

@ -95,7 +95,7 @@ class NitrogenScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Soil Nitrogen',
'Nitrogen Tanah',
style: AppTheme.labelMedium,
textAlign: TextAlign.center,
),

View File

@ -86,7 +86,7 @@ class PhScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Soil Acidity',
'pH Tanah',
style: AppTheme.labelMedium,
textAlign: TextAlign.center,
),

View File

@ -95,7 +95,7 @@ class PhosphorusScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Soil Phosphorus',
'Fosfor Tanah',
style: AppTheme.labelMedium,
textAlign: TextAlign.center,
),

View File

@ -25,7 +25,7 @@ class PotassiumScreen extends StatelessWidget {
length: 2,
child: Scaffold(
appBar: AppBar(
title: Text('Soil Potassium', style: AppTheme.labelMedium),
title: Text('Soil Potassium (Kalium)', style: AppTheme.labelMedium),
centerTitle: true,
backgroundColor: Colors.white,
scrolledUnderElevation: 0,
@ -95,7 +95,7 @@ class PotassiumScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Soil Potassium',
'Kalium Tanah',
style: AppTheme.labelMedium,
textAlign: TextAlign.center,
),

View File

@ -125,7 +125,7 @@ class SoilMoistureScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Soil Moisture',
'Kelembaban Tanah',
style: AppTheme.labelMedium,
textAlign: TextAlign.center,
),
@ -151,7 +151,6 @@ class SoilMoistureScreen extends StatelessWidget {
child: Consumer<SoilMoistureProvider>(
builder: (context, provider, child) {
final dataState = provider.dataState;
switch (dataState) {
case ResultState.loading:
return const Center(child: CupertinoActivityIndicator());

View File

@ -7,7 +7,6 @@ import 'package:provider/provider.dart';
import 'package:agrilink_vocpro/core/constant/app_constant.dart';
import 'package:agrilink_vocpro/core/constant/app_theme.dart';
import 'package:agrilink_vocpro/core/state/result_state.dart';
import 'package:agrilink_vocpro/core/widgets/show_info.dart';
import 'package:agrilink_vocpro/features/home/detail_pages/soil_temperature/provider/soil_temp_provider.dart';
import 'package:agrilink_vocpro/features/home/widgets/graphic_widget.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -172,7 +171,7 @@ class SoilTemperatureScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Soil Temperature',
'Suhu Tanah',
style: AppTheme.labelMedium,
textAlign: TextAlign.center,
),
@ -180,7 +179,7 @@ class SoilTemperatureScreen extends StatelessWidget {
iconSize: 20.r,
color: Colors.blue,
onPressed: () {
showInfo(context, 'Soil Temperature', AppConstant.soilTempInfo);
showInfo(context, 'Suhu Tanah', AppConstant.soilTempInfo);
},
icon: const Icon(BootstrapIcons.info_circle),
),
@ -240,3 +239,30 @@ class SoilTemperatureScreen extends StatelessWidget {
);
}
}
Future<dynamic> showInfo(BuildContext context, String title, String content) {
return showDialog(
context: context,
builder: (context) => AlertDialog(
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(title),
const SizedBox(height: 16),
Text(
style: Theme.of(context).textTheme.bodySmall,
content,
),
],
),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: const Text('OK'),
)
],
),
);
}

View File

@ -98,7 +98,7 @@ class TemperatureScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Temperature',
'Suhu Ruangan',
style: AppTheme.labelMedium,
textAlign: TextAlign.center,
),

View File

@ -15,10 +15,10 @@ class PlantsScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.eco_rounded, size: 100.r, color: AppColor.secondary),
Text('Coming Soon', style: AppTheme.titleLarge),
Text('Segera Hadir', style: AppTheme.titleLarge),
SizedBox(height: 8.h),
Text(
'This featureis under development',
'Fitur ini sedang dalam tahap pengembangan',
textAlign: TextAlign.center,
style: AppTheme.labelSmall,
),

View File

@ -11,7 +11,7 @@ class AccountScreen extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Detail Account', style: AppTheme.labelMedium),
title: Text('Detail Akun', style: AppTheme.labelMedium),
centerTitle: true,
backgroundColor: Colors.white,
scrolledUnderElevation: 0,

View File

@ -16,7 +16,7 @@ class SettingScreen extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Setting', style: AppTheme.labelMedium),
title: Text('Pengaturan', style: AppTheme.labelMedium),
centerTitle: true,
backgroundColor: Colors.white,
scrolledUnderElevation: 0,
@ -52,7 +52,7 @@ class SettingScreen extends StatelessWidget {
children: [
ListTile(
tileColor: Colors.white,
title: Text('Account',
title: Text('Akun',
style: AppTheme.labelSmall
.copyWith(color: Colors.black87)),
leading: const Icon(BootstrapIcons.person),
@ -90,7 +90,7 @@ class SettingScreen extends StatelessWidget {
// ),
ListTile(
tileColor: Colors.white,
title: Text('Logout',
title: Text('Keluar',
style: AppTheme.labelSmall.copyWith(color: Colors.red)),
leading: const Icon(
BootstrapIcons.box_arrow_right,