preVersionfinish
This commit is contained in:
@@ -0,0 +1,148 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
|
||||
import '../helper/constants.dart';
|
||||
|
||||
enum MainView { dashboard, traun, sarleinsbach, lannach, settings }
|
||||
|
||||
class HomeController extends GetxController {
|
||||
// Der Key, mit dem wir das Scaffold von hier aus steuern
|
||||
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
final boxSettings = GetStorage();
|
||||
final currentView = MainView.dashboard.obs;
|
||||
|
||||
//--------------Settings View---------------------------
|
||||
final askiUserController = TextEditingController().obs;
|
||||
final askiPasswordController = TextEditingController().obs;
|
||||
final loginUrlController = TextEditingController().obs;
|
||||
final powerUrlController = TextEditingController().obs;
|
||||
|
||||
final pvTraunDeviceController = TextEditingController().obs;
|
||||
final pvTraunDeviceMeterIdPVController = TextEditingController().obs;
|
||||
final pvTraunDeviceMeterIdImportController = TextEditingController().obs;
|
||||
|
||||
final pvSarleinsbachDeviceController = TextEditingController().obs;
|
||||
final pvSarleinsbachDeviceMeterIdPV01Controller = TextEditingController().obs;
|
||||
final pvSarleinsbachDeviceMeterIdPV02Controller = TextEditingController().obs;
|
||||
final pvSarleinsbachDeviceMeterIdPV03Controller = TextEditingController().obs;
|
||||
final pvSarleinsbachDeviceMeterIdImportController = TextEditingController().obs;
|
||||
|
||||
final pvLannachDeviceController = TextEditingController().obs;
|
||||
final pvLannachDeviceMeterIdPVController = TextEditingController().obs;
|
||||
final pvLannachDeviceMeterIdImportController = TextEditingController().obs;
|
||||
|
||||
void saveSettings() {
|
||||
String askiUser = askiUserController.value.text;
|
||||
String askiPassword = askiPasswordController.value.text;
|
||||
String loginUrl = loginUrlController.value.text;
|
||||
String powerUrl = powerUrlController.value.text;
|
||||
//traun
|
||||
String pvTraunDevice = pvTraunDeviceController.value.text;
|
||||
int pvTraunDeviceMeterIdPV = int.parse(pvTraunDeviceMeterIdPVController.value.text);
|
||||
int pvTraunDeviceMeterIdImport = int.parse(pvTraunDeviceMeterIdImportController.value.text);
|
||||
//sarleinsbach
|
||||
String pvSarleinsbachDevice = pvSarleinsbachDeviceController.value.text;
|
||||
int pvSarleinsbachDeviceMeterIdPV01 = int.parse(pvSarleinsbachDeviceMeterIdPV01Controller.value.text);
|
||||
int pvSarleinsbachDeviceMeterIdPV02 = int.parse(pvSarleinsbachDeviceMeterIdPV02Controller.value.text);
|
||||
int pvSarleinsbachDeviceMeterIdPV03 = int.parse(pvSarleinsbachDeviceMeterIdPV03Controller.value.text);
|
||||
int pvSarleinsbachDeviceMeterIdImport = int.parse(pvSarleinsbachDeviceMeterIdImportController.value.text);
|
||||
//lannach
|
||||
String pvLannachDevice = pvLannachDeviceController.value.text;
|
||||
int pvLannachDeviceMeterIdPV = int.parse(pvLannachDeviceMeterIdPVController.value.text);
|
||||
int pvLannachDeviceMeterIdImport = int.parse(pvLannachDeviceMeterIdImportController.value.text);
|
||||
|
||||
|
||||
boxSettings.write('askiUser', askiUser);
|
||||
boxSettings.write('askiPassword', askiPassword);
|
||||
boxSettings.write('loginUrl', loginUrl);
|
||||
boxSettings.write('powerUrl', powerUrl);
|
||||
boxSettings.write('pvTraunDevice', pvTraunDevice);
|
||||
boxSettings.write('pvTraunDeviceMeterIdPV', pvTraunDeviceMeterIdPV);
|
||||
boxSettings.write('pvTraunDeviceMeterIdImport', pvTraunDeviceMeterIdImport);
|
||||
boxSettings.write('pvSarleinsbachDevice', pvSarleinsbachDevice);
|
||||
boxSettings.write('pvSarleinsbachDeviceMeterIdPV01', pvSarleinsbachDeviceMeterIdPV01);
|
||||
boxSettings.write('pvSarleinsbachDeviceMeterIdPV02', pvSarleinsbachDeviceMeterIdPV02);
|
||||
boxSettings.write('pvSarleinsbachDeviceMeterIdPV03', pvSarleinsbachDeviceMeterIdPV03);
|
||||
boxSettings.write('pvSarleinsbachDeviceMeterIdImport', pvSarleinsbachDeviceMeterIdImport);
|
||||
boxSettings.write('pvLannachDevice', pvLannachDevice);
|
||||
boxSettings.write('pvLannachDeviceMeterIdPV', pvLannachDeviceMeterIdPV);
|
||||
boxSettings.write('pvLannachDeviceMeterIdImport', pvLannachDeviceMeterIdImport);
|
||||
|
||||
kDisplaySnackBarGreen("Settings saved successfully!");
|
||||
|
||||
print('Einstellungen gespeichert:');
|
||||
print('ASKI User: $askiUser');
|
||||
print('ASKI Password: $askiPassword');
|
||||
print('Login URL: $loginUrl');
|
||||
print('Power URL: $powerUrl');
|
||||
}
|
||||
//------------------------------------------------------
|
||||
|
||||
void changeView(MainView view) {
|
||||
currentView.value = view;
|
||||
}
|
||||
|
||||
void toggleDrawer() {
|
||||
final ScaffoldState? state = scaffoldKey.currentState;
|
||||
|
||||
if (state != null) {
|
||||
if (state.isDrawerOpen) {
|
||||
print("Schließe Drawer...");
|
||||
state.closeDrawer(); // Wartet auf das Ende der Schließ-Animation
|
||||
print("Drawer geschlossen.");
|
||||
} else {
|
||||
print("Öffne Drawer...");
|
||||
state.openDrawer(); // Wartet auf das Ende der Öffnen-Animation
|
||||
print("Drawer geöffnet.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
_readStorageData();
|
||||
}
|
||||
|
||||
void _readStorageData() {
|
||||
bool hasAskiUser = boxSettings.hasData('askiUser');
|
||||
if (hasAskiUser) {
|
||||
askiUserController.value.text = boxSettings.read('askiUser');
|
||||
}
|
||||
bool hasAskiPassword = boxSettings.hasData('askiPassword');
|
||||
if (hasAskiPassword) {
|
||||
askiPasswordController.value.text = boxSettings.read('askiPassword');
|
||||
}
|
||||
bool hasLoginUrl = boxSettings.hasData('loginUrl');
|
||||
if (hasLoginUrl) {
|
||||
loginUrlController.value.text = boxSettings.read('loginUrl');
|
||||
}
|
||||
bool hasPowerUrl = boxSettings.hasData('powerUrl');
|
||||
if (hasPowerUrl) {
|
||||
powerUrlController.value.text = boxSettings.read('powerUrl');
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
askiUserController.close();
|
||||
askiPasswordController.close();
|
||||
loginUrlController.close();
|
||||
powerUrlController.close();
|
||||
pvTraunDeviceController.close();
|
||||
pvTraunDeviceMeterIdPVController.close();
|
||||
pvTraunDeviceMeterIdImportController.close();
|
||||
pvSarleinsbachDeviceController.close();
|
||||
pvSarleinsbachDeviceMeterIdPV01Controller.close();
|
||||
pvSarleinsbachDeviceMeterIdPV02Controller.close();
|
||||
pvSarleinsbachDeviceMeterIdPV03Controller.close();
|
||||
pvSarleinsbachDeviceMeterIdImportController.close();
|
||||
pvLannachDeviceController.close();
|
||||
pvLannachDeviceMeterIdPVController.close();
|
||||
pvLannachDeviceMeterIdImportController.close();
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
var kFontSizeDouble = 15.0;
|
||||
|
||||
var kTextSyleLittleGrey =
|
||||
TextStyle(fontSize: 12.0, color: Colors.grey.shade800);
|
||||
|
||||
var kTextSyleHeaderGrey =
|
||||
TextStyle(fontSize: 25.0, color: Colors.grey.shade800);
|
||||
|
||||
var kElevatetButtonStyleDrawer = ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.blueGrey,
|
||||
foregroundColor: Colors.white,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
textStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
||||
);
|
||||
|
||||
//DropDown Styles
|
||||
var kInputDecorationDropDownMenue = InputDecoration(
|
||||
//prefixIcon: Icon(Icons.date_range),
|
||||
hintText: 'User'.toUpperCase(),
|
||||
contentPadding: const EdgeInsets.all(10),
|
||||
hintStyle: TextStyle(letterSpacing: 2, fontSize: kFontSizeDouble),
|
||||
filled: true,
|
||||
fillColor: Colors.grey.shade400,
|
||||
errorStyle: const TextStyle(color: Colors.yellow),
|
||||
);
|
||||
|
||||
SnackbarController kDisplaySnackBarRed(String szInfoText) {
|
||||
return Get.snackbar('Info', szInfoText,
|
||||
backgroundColor: Colors.red[600],
|
||||
snackPosition: SnackPosition.TOP,
|
||||
colorText: Colors.white,
|
||||
snackStyle: SnackStyle.GROUNDED);
|
||||
}
|
||||
|
||||
SnackbarController kDisplaySnackBarGreen(String szInfoText) {
|
||||
return Get.snackbar('Info', szInfoText,
|
||||
backgroundColor: Colors.green[600],
|
||||
snackPosition: SnackPosition.TOP,
|
||||
colorText: Colors.black,
|
||||
snackStyle: SnackStyle.GROUNDED);
|
||||
}
|
||||
|
||||
//Setting Wait for Delete
|
||||
List<Map<String, dynamic>> kListMapSetting = [
|
||||
{'ContainerID': '', 'Info': ''}
|
||||
];
|
||||
|
||||
//Switching PROD/DEV
|
||||
String kStringEnvironment = '?';
|
||||
|
||||
Future<String?> kShowPopupDialog(
|
||||
String title,
|
||||
String content,
|
||||
String buttonLeftText,
|
||||
String buttonRightText,
|
||||
) async {
|
||||
return await Get.dialog<String>(
|
||||
AlertDialog(
|
||||
title: Text(title),
|
||||
content: Text(content),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(Get.overlayContext!).pop('Abbrechen');
|
||||
},
|
||||
child: Text(buttonLeftText),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(Get.overlayContext!).pop('OK');
|
||||
},
|
||||
child: Text(buttonRightText),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import 'dart:io';
|
||||
|
||||
class MyHttpOverrides extends HttpOverrides {
|
||||
@override
|
||||
HttpClient createHttpClient(SecurityContext? context) {
|
||||
return super.createHttpClient(context)
|
||||
..badCertificateCallback =
|
||||
(X509Certificate cert, String host, int port) => true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import '../controller/home_controller.dart';
|
||||
|
||||
class SampleBindings extends Bindings {
|
||||
@override
|
||||
void dependencies() {
|
||||
Get.lazyPut<HomeController>(() => HomeController());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../pages/home/home_view.dart';
|
||||
import './sample_bindings.dart';
|
||||
|
||||
class SampleRouts {
|
||||
static final sampleBindings = SampleBindings();
|
||||
static final samplePages = [
|
||||
GetPage(
|
||||
name: HomePage.routeName,
|
||||
binding: sampleBindings,
|
||||
page: () => const HomePage(),
|
||||
transition: Transition.leftToRight,
|
||||
),
|
||||
];
|
||||
}
|
||||
+20
-106
@@ -1,6 +1,18 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
void main() {
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
|
||||
import 'helper/http_overrides.dart';
|
||||
import 'helper/sample_routes.dart';
|
||||
import 'pages/home/home_view.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await GetStorage.init();
|
||||
HttpOverrides.global = MyHttpOverrides();
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
@@ -10,113 +22,15 @@ class MyApp extends StatelessWidget {
|
||||
// This widget is the root of your application.
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
return GetMaterialApp(
|
||||
title: 'Flutter Demo',
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: ThemeData(
|
||||
// This is the theme of your application.
|
||||
//
|
||||
// TRY THIS: Try running your application with "flutter run". You'll see
|
||||
// the application has a purple toolbar. Then, without quitting the app,
|
||||
// try changing the seedColor in the colorScheme below to Colors.green
|
||||
// and then invoke "hot reload" (save your changes or press the "hot
|
||||
// reload" button in a Flutter-supported IDE, or press "r" if you used
|
||||
// the command line to start the app).
|
||||
//
|
||||
// Notice that the counter didn't reset back to zero; the application
|
||||
// state is not lost during the reload. To reset the state, use hot
|
||||
// restart instead.
|
||||
//
|
||||
// This works for code too, not just values: Most code changes can be
|
||||
// tested with just a hot reload.
|
||||
colorScheme: .fromSeed(seedColor: Colors.deepPurple),
|
||||
),
|
||||
home: const MyHomePage(title: 'Flutter Demo Home Page'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget {
|
||||
const MyHomePage({super.key, required this.title});
|
||||
|
||||
// This widget is the home page of your application. It is stateful, meaning
|
||||
// that it has a State object (defined below) that contains fields that affect
|
||||
// how it looks.
|
||||
|
||||
// This class is the configuration for the state. It holds the values (in this
|
||||
// case the title) provided by the parent (in this case the App widget) and
|
||||
// used by the build method of the State. Fields in a Widget subclass are
|
||||
// always marked "final".
|
||||
|
||||
final String title;
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
int _counter = 0;
|
||||
|
||||
void _incrementCounter() {
|
||||
setState(() {
|
||||
// This call to setState tells the Flutter framework that something has
|
||||
// changed in this State, which causes it to rerun the build method below
|
||||
// so that the display can reflect the updated values. If we changed
|
||||
// _counter without calling setState(), then the build method would not be
|
||||
// called again, and so nothing would appear to happen.
|
||||
_counter++;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// This method is rerun every time setState is called, for instance as done
|
||||
// by the _incrementCounter method above.
|
||||
//
|
||||
// The Flutter framework has been optimized to make rerunning build methods
|
||||
// fast, so that you can just rebuild anything that needs updating rather
|
||||
// than having to individually change instances of widgets.
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
// TRY THIS: Try changing the color here to a specific color (to
|
||||
// Colors.amber, perhaps?) and trigger a hot reload to see the AppBar
|
||||
// change color while the other colors stay the same.
|
||||
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
|
||||
// Here we take the value from the MyHomePage object that was created by
|
||||
// the App.build method, and use it to set our appbar title.
|
||||
title: Text(widget.title),
|
||||
),
|
||||
body: Center(
|
||||
// Center is a layout widget. It takes a single child and positions it
|
||||
// in the middle of the parent.
|
||||
child: Column(
|
||||
// Column is also a layout widget. It takes a list of children and
|
||||
// arranges them vertically. By default, it sizes itself to fit its
|
||||
// children horizontally, and tries to be as tall as its parent.
|
||||
//
|
||||
// Column has various properties to control how it sizes itself and
|
||||
// how it positions its children. Here we use mainAxisAlignment to
|
||||
// center the children vertically; the main axis here is the vertical
|
||||
// axis because Columns are vertical (the cross axis would be
|
||||
// horizontal).
|
||||
//
|
||||
// TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint"
|
||||
// action in the IDE, or press "p" in the console), to see the
|
||||
// wireframe for each widget.
|
||||
mainAxisAlignment: .center,
|
||||
children: [
|
||||
const Text('You have pushed the button this many times:'),
|
||||
Text(
|
||||
'$_counter',
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: _incrementCounter,
|
||||
tooltip: 'Increment',
|
||||
child: const Icon(Icons.add),
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blueGrey),
|
||||
),
|
||||
|
||||
initialRoute: HomePage.routeName,
|
||||
getPages: SampleRouts.samplePages,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../controller/home_controller.dart';
|
||||
import '../../widgets/drawer_widget.dart';
|
||||
import '../../widgets/views/dashboard.dart';
|
||||
import '../../widgets/views/lannach.dart';
|
||||
import '../../widgets/views/sarleinsbach.dart';
|
||||
import '../../widgets/views/settings.dart';
|
||||
import '../../widgets/views/traun.dart';
|
||||
|
||||
class HomePage extends GetView<HomeController> {
|
||||
static const String routeName = '/home-page';
|
||||
const HomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var hCtrl = controller;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('ASKI Internorm Inside'),
|
||||
backgroundColor: Colors.blueGrey,
|
||||
foregroundColor: Colors.white,
|
||||
toolbarHeight: 80,
|
||||
iconTheme: const IconThemeData(size: 40, color: Colors.white),
|
||||
titleTextStyle: const TextStyle(fontSize: 35, color: Colors.white),
|
||||
),
|
||||
drawer: const Drawer(child: DrawerWidget()),
|
||||
body: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey[300]
|
||||
),
|
||||
child: Obx(() {
|
||||
switch (hCtrl.currentView.value) {
|
||||
case MainView.dashboard:
|
||||
return const DashboardView();
|
||||
case MainView.traun:
|
||||
return const TraunView();
|
||||
case MainView.sarleinsbach:
|
||||
return const SarleinsbachView();
|
||||
case MainView.lannach:
|
||||
return const LannachView();
|
||||
case MainView.settings:
|
||||
return const SettingsView();
|
||||
}
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../controller/home_controller.dart';
|
||||
import '../helper/constants.dart';
|
||||
import './my_elevated_button_style_drawer.dart';
|
||||
|
||||
class DrawerWidget extends StatelessWidget {
|
||||
const DrawerWidget({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 30.0),
|
||||
child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('Drawer Widget', textAlign: TextAlign.center, style: kTextSyleHeaderGrey),
|
||||
SizedBox(height: 50),
|
||||
MyElevatedButtonStyleDrawer(
|
||||
buttonText: 'Dashboard',
|
||||
onPressed: () {
|
||||
Get.find<HomeController>().changeView(MainView.dashboard);
|
||||
Get.close(1);
|
||||
},
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
MyElevatedButtonStyleDrawer(
|
||||
buttonText: 'Traun',
|
||||
onPressed: () {
|
||||
Get.find<HomeController>().changeView(MainView.traun);
|
||||
Get.close(1);
|
||||
},
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
MyElevatedButtonStyleDrawer(
|
||||
buttonText: 'Sarleinsbach',
|
||||
onPressed: () {
|
||||
Get.find<HomeController>().changeView(MainView.sarleinsbach);
|
||||
Get.close(1);
|
||||
},
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
MyElevatedButtonStyleDrawer(
|
||||
buttonText: 'Lannach',
|
||||
onPressed: () {
|
||||
Get.find<HomeController>().changeView(MainView.lannach);
|
||||
Get.close(1);
|
||||
},
|
||||
),
|
||||
SizedBox(height: 60),
|
||||
MyElevatedButtonStyleDrawer(
|
||||
buttonText: 'Settings',
|
||||
onPressed: () {
|
||||
Get.find<HomeController>().changeView(MainView.settings);
|
||||
Get.close(1);
|
||||
},
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
SizedBox(
|
||||
width: 200,
|
||||
height: 40,
|
||||
child: ElevatedButton(
|
||||
style: kElevatetButtonStyleDrawer,
|
||||
onPressed: () {
|
||||
Get.close(1);
|
||||
},
|
||||
child: Text('Close'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../helper/constants.dart';
|
||||
|
||||
class MyElevatedButtonStyleDrawer extends StatelessWidget {
|
||||
const MyElevatedButtonStyleDrawer({super.key, this.onPressed, required this.buttonText});
|
||||
|
||||
final void Function()? onPressed;
|
||||
final String buttonText;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
width: 200,
|
||||
height: 40,
|
||||
child: ElevatedButton(
|
||||
style: kElevatetButtonStyleDrawer,
|
||||
onPressed: onPressed,
|
||||
child: Text(buttonText),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../controller/home_controller.dart';
|
||||
|
||||
class DashboardView extends StatelessWidget {
|
||||
const DashboardView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var hCtrl = Get.find<HomeController>();
|
||||
return Center(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(20),
|
||||
width: 1000,
|
||||
child: Wrap(
|
||||
spacing: 20,
|
||||
runSpacing: 20,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
hCtrl.changeView(MainView.dashboard);
|
||||
},
|
||||
child: Image.asset('assets/images/AskiDashboard.png',width: 450),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
hCtrl.changeView(MainView.traun);
|
||||
},
|
||||
child: Image.asset('assets/images/AskiTraun.png',width: 450),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
hCtrl.changeView(MainView.sarleinsbach);
|
||||
},
|
||||
child: Image.asset('assets/images/AskiSarleinsbach.png',width: 450),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
hCtrl.changeView(MainView.lannach);
|
||||
},
|
||||
child: Image.asset('assets/images/AskiLannach.png',width: 450),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../controller/home_controller.dart';
|
||||
|
||||
class LannachView extends StatelessWidget {
|
||||
const LannachView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var hCtrl = Get.find<HomeController>();
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('PV Lannach'),
|
||||
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);
|
||||
},
|
||||
)
|
||||
),
|
||||
body: const Center(
|
||||
child: Text(
|
||||
"PV Lannach",
|
||||
style: TextStyle(fontSize: 30),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../controller/home_controller.dart';
|
||||
|
||||
class SarleinsbachView extends StatelessWidget {
|
||||
const SarleinsbachView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var hCtrl = Get.find<HomeController>();
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('PV Sarleinsbach'),
|
||||
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);
|
||||
},
|
||||
)
|
||||
),
|
||||
body: const Center(
|
||||
child: Text(
|
||||
"PV Sarleinsbach",
|
||||
style: TextStyle(fontSize: 30),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
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',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../controller/home_controller.dart';
|
||||
|
||||
class TraunView extends StatelessWidget {
|
||||
const TraunView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var hCtrl = Get.find<HomeController>();
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('PV Traun'),
|
||||
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);
|
||||
},
|
||||
)
|
||||
),
|
||||
body: const Center(
|
||||
child: Text(
|
||||
"PV Traun",
|
||||
style: TextStyle(fontSize: 30),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user