2024-10-01 03:49:55 +00:00
|
|
|
import 'package:agrilink_vocpro/core/constant/app_theme.dart';
|
|
|
|
|
import 'package:agrilink_vocpro/features/control/provider/control_provider.dart';
|
2024-10-01 07:44:18 +00:00
|
|
|
import 'package:agrilink_vocpro/features/home/widgets/graphic_widget.dart';
|
2024-10-01 03:49:55 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2024-10-01 07:44:18 +00:00
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
2024-10-01 03:49:55 +00:00
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
class ControlScreen extends StatelessWidget {
|
|
|
|
|
const ControlScreen({super.key});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: AppBar(
|
|
|
|
|
title: Text('Control', style: AppTheme.labelMedium),
|
|
|
|
|
centerTitle: true,
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
scrolledUnderElevation: 0,
|
|
|
|
|
),
|
|
|
|
|
body: Consumer<ControlProvider>(builder: (context, provider, child) {
|
|
|
|
|
return SafeArea(
|
|
|
|
|
child: ListView(
|
|
|
|
|
children: [
|
|
|
|
|
ListTile(
|
2024-10-01 07:44:18 +00:00
|
|
|
title: Text('Control 1', style: AppTheme.labelMedium),
|
2024-10-01 03:49:55 +00:00
|
|
|
subtitle: const Text('Control 1 description'),
|
|
|
|
|
trailing: Switch(
|
|
|
|
|
value: provider.control_1,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
provider.switchControl1();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ListTile(
|
|
|
|
|
title: const Text('Control 2'),
|
|
|
|
|
subtitle: const Text('Control 2 description'),
|
|
|
|
|
trailing: Switch(
|
|
|
|
|
value: provider.control_2,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
provider.switchControl2();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ListTile(
|
|
|
|
|
title: const Text('Control 3'),
|
|
|
|
|
subtitle: const Text('Control 3 description'),
|
|
|
|
|
trailing: Switch(
|
|
|
|
|
value: provider.control_3,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
provider.switchControl3();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ListTile(
|
|
|
|
|
title: const Text('Control 4'),
|
|
|
|
|
subtitle: const Text('Control 4 description'),
|
|
|
|
|
trailing: Switch(
|
|
|
|
|
value: provider.control_4,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
provider.switchControl4();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ListTile(
|
|
|
|
|
title: const Text('Control 5'),
|
|
|
|
|
subtitle: const Text('Control 5 description'),
|
|
|
|
|
trailing: Switch(
|
|
|
|
|
value: provider.control_5,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
provider.switchControl5();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ListTile(
|
|
|
|
|
title: const Text('Control 6'),
|
|
|
|
|
subtitle: const Text('Control 6 description'),
|
|
|
|
|
trailing: Switch(
|
|
|
|
|
value: provider.control_6,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
provider.switchControl6();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|