109 lines
3.5 KiB
Dart
109 lines
3.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
import '../../controller/home_controller.dart';
|
|
|
|
class SettingsView extends StatelessWidget {
|
|
const SettingsView({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var hCtrl = Get.find<HomeController>();
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Data Settings'),
|
|
centerTitle: true,
|
|
backgroundColor: Colors.blueGrey,
|
|
foregroundColor: Colors.white,
|
|
titleTextStyle: const TextStyle(fontSize: 30, color: Colors.white),
|
|
iconTheme: const IconThemeData(size: 30, color: Colors.white),
|
|
leading: IconButton(
|
|
icon: const Icon(Icons.arrow_back),
|
|
onPressed: () {
|
|
hCtrl.changeView(MainView.dashboard);
|
|
},
|
|
),
|
|
actions: [
|
|
IconButton(
|
|
icon: const Icon(Icons.save),
|
|
onPressed: () {
|
|
// Save the login URL to the controller
|
|
hCtrl.saveSettings();
|
|
},
|
|
),
|
|
],
|
|
),
|
|
body: Padding(
|
|
padding: const EdgeInsets.all(18.0),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
SizedBox(height: 10),
|
|
Text(
|
|
"Please enter User and Password",
|
|
style: TextStyle(fontSize: 18),
|
|
),
|
|
SizedBox(height: 10),
|
|
TextField(
|
|
controller: hCtrl.askiUserController.value,
|
|
decoration: InputDecoration(
|
|
labelText: 'Input User',
|
|
border: OutlineInputBorder(),
|
|
hintText: 'Enter ASKI User',
|
|
),
|
|
),
|
|
SizedBox(height: 10),
|
|
TextField(
|
|
controller: hCtrl.askiPasswordController.value,
|
|
obscureText: true,
|
|
decoration: InputDecoration(
|
|
labelText: 'Input Password',
|
|
border: OutlineInputBorder(),
|
|
hintText: 'Enter ASKI Password',
|
|
),
|
|
),
|
|
SizedBox(height: 10),
|
|
Text(
|
|
"Please enter the URLs for the ASKI login and power data",
|
|
style: TextStyle(fontSize: 18),
|
|
),
|
|
SizedBox(height: 10),
|
|
TextField(
|
|
controller: hCtrl.loginUrlController.value,
|
|
decoration: InputDecoration(
|
|
labelText: 'Login URL',
|
|
border: OutlineInputBorder(),
|
|
hintText: 'Enter ASKI Login URL',
|
|
),
|
|
),
|
|
SizedBox(height: 10),
|
|
TextField(
|
|
controller: hCtrl.powerUrlController.value,
|
|
decoration: InputDecoration(
|
|
labelText: 'Power URL',
|
|
border: OutlineInputBorder(),
|
|
hintText: 'Enter ASKI Power URL',
|
|
),
|
|
),
|
|
SizedBox(height: 10),
|
|
Text(
|
|
"Please enter the device for PV Traun and PV Sarleinsbach and PV Lannach",
|
|
style: TextStyle(fontSize: 18),
|
|
),
|
|
SizedBox(height: 10),
|
|
TextField(
|
|
controller: hCtrl.pvTraunDeviceController.value,
|
|
decoration: InputDecoration(
|
|
labelText: 'PV Traun Device',
|
|
border: OutlineInputBorder(),
|
|
hintText: 'Enter PV Traun Device',
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|