Update environment generated file
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../presentation/controllers/home_controller.dart';
|
||||
|
||||
class HomeBinding extends Bindings {
|
||||
@override
|
||||
void dependencies() {
|
||||
Get.lazyPut(() => HomeViewController());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
class HomeViewController extends GetxController {
|
||||
Rx<PackageInfo> packageInfo = PackageInfo(
|
||||
appName: 'Unknown',
|
||||
packageName: 'Unknown',
|
||||
version: 'Unknown',
|
||||
buildNumber: 'Unknown',
|
||||
buildSignature: 'Unknown',
|
||||
installerStore: 'Unknown',
|
||||
).obs;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
_initPackageInfo();
|
||||
super.onInit();
|
||||
//Loading, Success, Error handle with 1 line of code
|
||||
}
|
||||
|
||||
Future<void> _initPackageInfo() async {
|
||||
final info = await PackageInfo.fromPlatform();
|
||||
packageInfo.value = info;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:terepi_seged/pages/home/presentation/controllers/home_controller.dart';
|
||||
import 'package:terepi_seged/pages/home/presentation/widgets/big_button_widget.dart';
|
||||
|
||||
class HomeView extends GetView<HomeViewController> {
|
||||
const HomeView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
child: Scaffold(
|
||||
extendBody: true,
|
||||
backgroundColor: Colors.black.withOpacity(0.05),
|
||||
appBar: AppBar(
|
||||
elevation: 0.0,
|
||||
title: const Text('Kezdőlap'),
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back_ios),
|
||||
color: Colors.white,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
),
|
||||
body: Column(children: [
|
||||
Column(
|
||||
children: const [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 10.0),
|
||||
child: Center(
|
||||
child: Text("Kezdőlap"),
|
||||
),
|
||||
),
|
||||
// TextButton(
|
||||
// onPressed: () async {
|
||||
// Get.toNamed('/map');
|
||||
// },
|
||||
// child: const Text('Map')),
|
||||
// TextButton(
|
||||
// onPressed: () async {
|
||||
// Get.toNamed('/bluetooth_test');
|
||||
// },
|
||||
// child: const Text('Bluetooth test')),
|
||||
// TextButton(
|
||||
// onPressed: () async {
|
||||
// Get.toNamed('/socket_test');
|
||||
// },
|
||||
// child: const Text('Socket teszt')),
|
||||
// TextButton(
|
||||
// onPressed: () async {
|
||||
// Get.toNamed('/rtcm_test');
|
||||
// },
|
||||
// child: const Text('RTCM teszt'))
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
BigButtonWidget(
|
||||
iconData: Icons.flag,
|
||||
label: "Kitűzés",
|
||||
onPressed: () async {
|
||||
Get.toNamed('/map');
|
||||
},
|
||||
),
|
||||
BigButtonWidget(
|
||||
iconData: Icons.monitor_heart,
|
||||
label: "Mérés",
|
||||
onPressed: () async {
|
||||
Get.toNamed("/measured_data");
|
||||
// ScaffoldMessenger.of(context)
|
||||
// .showSnackBar(const SnackBar(
|
||||
// content: Text(
|
||||
// "Fejlesztlés alatt",
|
||||
// style: TextStyle(fontWeight: FontWeight.bold),
|
||||
// ),
|
||||
// backgroundColor: Colors.black54,
|
||||
// ));
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
BigButtonWidget(
|
||||
iconData: Icons.navigation,
|
||||
label: "Navigáció",
|
||||
onPressed: () async {
|
||||
Get.toNamed('/navigation');
|
||||
// ScaffoldMessenger.of(context)
|
||||
// .showSnackBar(const SnackBar(
|
||||
// content: Text(
|
||||
// "Fejlesztlés alatt",
|
||||
// style: TextStyle(fontWeight: FontWeight.bold),
|
||||
// ),
|
||||
// backgroundColor: Colors.black54,
|
||||
// ));
|
||||
},
|
||||
),
|
||||
BigButtonWidget(
|
||||
iconData: Icons.message,
|
||||
label: "Üzenetek",
|
||||
onPressed: () async {
|
||||
// Get.toNamed("/navigation");
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(const SnackBar(
|
||||
content: Text(
|
||||
"Fejlesztlés alatt",
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
backgroundColor: Colors.black54,
|
||||
));
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
BigButtonWidget(
|
||||
iconData: Icons.house,
|
||||
label: "Ingatlanok",
|
||||
onPressed: () async {
|
||||
// Get.toNamed('/map_test');
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(const SnackBar(
|
||||
content: Text(
|
||||
"Fejlesztlés alatt",
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
backgroundColor: Colors.black54,
|
||||
));
|
||||
},
|
||||
),
|
||||
BigButtonWidget(
|
||||
iconData: Icons.edit_road,
|
||||
label: "Track",
|
||||
onPressed: () async {
|
||||
// Get.toNamed("/navigation");
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(const SnackBar(
|
||||
content: Text(
|
||||
"Fejlesztlés alatt",
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
backgroundColor: Colors.black54,
|
||||
));
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Obx(
|
||||
() => Text(
|
||||
"Verzió: ${controller.packageInfo.value.version}+${controller.packageInfo.value.buildNumber}",
|
||||
style: const TextStyle(fontSize: 12)),
|
||||
)
|
||||
],
|
||||
)
|
||||
])));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BigButtonWidget extends StatelessWidget {
|
||||
const BigButtonWidget(
|
||||
{Key? key, required this.iconData, required this.label, this.onPressed})
|
||||
: super(key: key);
|
||||
|
||||
final IconData iconData;
|
||||
final String label;
|
||||
final Function()? onPressed;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return OutlinedButton(
|
||||
onPressed: onPressed,
|
||||
style: ButtonStyle(
|
||||
minimumSize: MaterialStateProperty.all(const Size(130, 140)),
|
||||
maximumSize: MaterialStateProperty.all(const Size(130, 140)),
|
||||
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
||||
const RoundedRectangleBorder(borderRadius: BorderRadius.zero))),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(8.0, 10.0, 8.0, 4.0),
|
||||
child: Icon(
|
||||
iconData,
|
||||
color: Colors.blueGrey,
|
||||
size: 64,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
label,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: Colors.blueGrey, fontWeight: FontWeight.bold),
|
||||
))
|
||||
],
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user