88 lines
2.7 KiB
Dart
88 lines
2.7 KiB
Dart
|
|
import 'package:agrilink_vocpro/core/constant/app_theme.dart';
|
||
|
|
import 'package:agrilink_vocpro/features/control/provider/control_provider.dart';
|
||
|
|
import 'package:flutter/material.dart';
|
||
|
|
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(
|
||
|
|
title: const Text('Control 1'),
|
||
|
|
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();
|
||
|
|
},
|
||
|
|
),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
));
|
||
|
|
}),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|