Files
flutter_test_services/lib/widgets/views/settings.dart
T
2026-07-23 09:17:56 +02:00

86 lines
2.7 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('System 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 for Web Methodes",
style: TextStyle(fontSize: 18),
),
SizedBox(height: 10),
TextField(
controller: hCtrl.userWebMethodesController.value,
decoration: InputDecoration(
labelText: 'Input User',
border: OutlineInputBorder(),
hintText: 'Enter Admin User',
),
),
SizedBox(height: 10),
TextField(
controller: hCtrl.passwordWebMethodesController.value,
obscureText: true,
decoration: InputDecoration(
labelText: 'Input Password',
border: OutlineInputBorder(),
hintText: 'Enter Admin Password',
),
),
SizedBox(height: 10),
Text(
"Please enter the URLs for WebMethodes PV data Url",
style: TextStyle(fontSize: 18),
),
SizedBox(height: 10),
TextField(
controller: hCtrl.powerUrlController.value,
decoration: InputDecoration(
labelText: 'Power URL',
border: OutlineInputBorder(),
hintText: 'Enter ASKI Power URL',
),
)
],
),
),
);
}
}