preVersionfinish
This commit is contained in:
@@ -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