Aktív projekt kiválasztása, projekt létrehozása
This commit is contained in:
+29
-13
@@ -1,11 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:terepi_seged/services/project_service.dart';
|
||||
|
||||
import '../services/gnss/gnss_connection.dart';
|
||||
import '../services/gnss/gnss_device_service.dart';
|
||||
import '../services/gnss/gnss_service.dart';
|
||||
import 'gnss_device_picker_dialog.dart';
|
||||
import 'project/project_picker_view.dart';
|
||||
|
||||
class AppDrawer extends StatelessWidget {
|
||||
const AppDrawer({super.key});
|
||||
@@ -32,19 +34,25 @@ class AppDrawer extends StatelessWidget {
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
// Projekt
|
||||
ListTile(
|
||||
leading: const Icon(Icons.folder_outlined),
|
||||
title: const Text('Aktív projekt'),
|
||||
subtitle: const Text(
|
||||
'Nincs projekt',
|
||||
style: TextStyle(fontSize: 12),
|
||||
),
|
||||
trailing: const Icon(Icons.arrow_forward_ios, size: 14),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
// Get.to(() => const ProjectPickerView());
|
||||
},
|
||||
),
|
||||
Obx(() {
|
||||
final project = ProjectService.to.activeProject.value;
|
||||
return ListTile(
|
||||
leading: Icon(Icons.folder_outlined,
|
||||
color:
|
||||
project != null ? _hexColor(project.color) : null),
|
||||
title: const Text('Aktív projekt'),
|
||||
subtitle: Text(
|
||||
project?.name ?? 'Nincs projekt',
|
||||
style: TextStyle(fontSize: 12),
|
||||
),
|
||||
trailing: const Icon(Icons.arrow_forward_ios, size: 14),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
Get.to(() => const ProjectPickerView(),
|
||||
transition: Transition.rightToLeft);
|
||||
},
|
||||
);
|
||||
}),
|
||||
|
||||
// GNSS eszköz
|
||||
Obx(() {
|
||||
@@ -283,3 +291,11 @@ class _SectionLabel extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Color _hexColor(String hex) {
|
||||
final h = hex.replaceFirst('#', '');
|
||||
return Color(int.parse(
|
||||
h.length == 6 ? 'FF$h' : h,
|
||||
radix: 16,
|
||||
));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user