Stammdaten

This commit is contained in:
reinjens 2024-12-17 13:19:09 +01:00
parent 8b1ec3818c
commit 16f1442564
31 changed files with 82 additions and 93 deletions

View file

@ -52,8 +52,8 @@ void main() async {
for (final cart in carts) {
CartRepository().put(Cart.fromJson(cart));
}
var cart_elements = await BaseApi().getContent('cart_element', false);
for (final element in cart_elements) {
var cartElements = await BaseApi().getContent('cart_element', false);
for (final element in cartElements) {
CartRepository().putElement(CartElement.fromJson(element));
}
/*for (final cart in carts) {

View file

@ -53,7 +53,7 @@ extension AreaExtension on Area {
id.toString(),
),
strokeColor: const Color(0xFF60845E),
fillColor: const Color(0xff87A34E).withOpacity(.7),
fillColor: const Color(0xff87A34E).withValues(alpha: .7),
strokeWidth: 2,
points: points,
);

View file

@ -57,21 +57,19 @@ class CartDataSource extends DataGridSource {
final AmbitoTheme theme = getTheme(context);
double completePrice = double.tryParse(row
.getCells()
.where((cell) => cell.columnName == 'Richtpreis')
.first
.value
.toString() ??
'0.0') ??
.getCells()
.where((cell) => cell.columnName == 'Richtpreis')
.first
.value
.toString()) ??
0;
int amount = int.tryParse(row
.getCells()
.where((cell) => cell.columnName == 'Menge')
.first
.value
.toString() ??
'0') ??
.getCells()
.where((cell) => cell.columnName == 'Menge')
.first
.value
.toString()) ??
0;
if (amount > 1) {

View file

@ -1,5 +1,3 @@
library ambito_entities;
export '_general/file/file_part.dart';
export '_general/file/thumbnail.dart';
export '_general/file/thumbnails.dart';

View file

@ -283,7 +283,7 @@ class MeasureRepository extends BaseDB {
.getTypeDetailsForType(measureType?.measureType ?? '');
// Save preferences and populate combined map
prefs.setBool('extended_json', true).then((_) {
_mergeToCombinedMap(combined, measureGeneral?.toJson());
_mergeToCombinedMap(combined, measureGeneral.toJson());
_mergeToCombinedMap(combined, measureDetails?.toJson());
_mergeToCombinedMap(combined, measureType?.toJson());
_mergeToCombinedMap(combined, measureTypesDetails?.toJson());

View file

@ -1,5 +1,3 @@
library ambito_extensions;
import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart';

View file

@ -1,5 +1,3 @@
library vyc_api;
import 'dart:async';
import 'dart:convert';

View file

@ -37,10 +37,10 @@ final actionGroupColors = {
};
final actionAreaColors = {
'Landschaft': const Color(0xffeebb4b).withOpacity(.1),
'Weinberg': const Color(0xff88a44e).withOpacity(.1),
'Betriebsfläche': const Color(0xff96172f).withOpacity(.1),
'Betriebsstätte': const Color(0xffCCCDCC).withOpacity(.1),
'Landschaft': const Color(0xffeebb4b)..withValues(alpha: .1),
'Weinberg': const Color(0xff88a44e)..withValues(alpha: .1),
'Betriebsfläche': const Color(0xff96172f)..withValues(alpha: .1),
'Betriebsstätte': const Color(0xffCCCDCC)..withValues(alpha: .1),
};
final actionAreaFGColors = {

View file

@ -186,7 +186,7 @@ class CalendarPageYearState extends State<CalendarPageYear> {
),
horizontalInside: BorderSide(
width: 1,
color: Colors.black.withOpacity(.6),
color: Colors.black..withValues(alpha: .6),
),
verticalInside: const BorderSide(
width: 0,
@ -216,7 +216,7 @@ class CalendarPageYearState extends State<CalendarPageYear> {
),
horizontalInside: BorderSide(
width: 1,
color: Colors.black.withOpacity(.6),
color: Colors.black..withValues(alpha: .6),
),
verticalInside: const BorderSide(
width: 0,

View file

@ -162,7 +162,7 @@ class CartPageState extends State<CartPage> {
],
),
theme.verticalSpacerSmall,
gridWidget(elements ?? [], key),
gridWidget(elements, key),
theme.verticalSpacer,
Row(
children: [

View file

@ -164,11 +164,11 @@ class DashboardAreasPageState extends State<DashboardAreasPage> {
color: theme.currentColorScheme.secondary),
),
onPressed: () async {
final TextEditingController _controllerName =
final TextEditingController controllerName =
TextEditingController();
final TextEditingController _controllerSize =
final TextEditingController controllerSize =
TextEditingController();
final TextEditingController _controllerDescription =
final TextEditingController controllerDescription =
TextEditingController();
await showDialog<String>(
context: context,
@ -245,8 +245,8 @@ class DashboardAreasPageState extends State<DashboardAreasPage> {
backgroundColor: theme
.currentColorScheme
.surface
.withOpacity(
.1),
..withValues(
alpha: .1),
foregroundColor: theme
.currentColorScheme
.primary,
@ -309,7 +309,7 @@ class DashboardAreasPageState extends State<DashboardAreasPage> {
..id = isar.areas
.autoIncrement()
..description =
_controllerDescription
controllerDescription
.value
.text
..business = [
@ -321,11 +321,11 @@ class DashboardAreasPageState extends State<DashboardAreasPage> {
.name!
]
..name =
_controllerName
controllerName
.value
.text
..size =
_controllerSize
controllerSize
.value
.text;
await BaseApi()
@ -382,7 +382,7 @@ class DashboardAreasPageState extends State<DashboardAreasPage> {
child:
TextField(
controller:
_controllerName,
controllerName,
maxLines: 1,
decoration:
InputDecoration(
@ -424,7 +424,7 @@ class DashboardAreasPageState extends State<DashboardAreasPage> {
child:
TextField(
controller:
_controllerSize,
controllerSize,
maxLines: 1,
decoration:
InputDecoration(
@ -467,7 +467,7 @@ class DashboardAreasPageState extends State<DashboardAreasPage> {
theme.verticalSpacer,
TextField(
controller:
_controllerDescription,
controllerDescription,
maxLines: 5,
decoration:
InputDecoration(

View file

@ -38,7 +38,7 @@ extension NormalLayoutDashboardPage on DashboardPageState {
height: 250,
child: Card(
elevation: 0,
color: const Color(0xff666666).withOpacity(.1),
color: const Color(0xff666666).withValues(alpha: .1),
child: Column(
children: [
ClipRRect(

View file

@ -43,7 +43,8 @@ extension SmallLayoutDashboardPage on DashboardPageState {
Container(
height: 80,
decoration: BoxDecoration(
color: theme.currentColorScheme.outline.withOpacity(.6),
color: theme.currentColorScheme.outline
..withValues(alpha: .6),
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(10),
bottomRight: Radius.circular(10)),

View file

@ -146,7 +146,7 @@ class MasterDataPageState extends State<MasterDataPage> {
..value = business!.name
];
final ret = await BaseApi().patchContent(
await BaseApi().patchContent(
'login',
login!.id,
changedlogin.toJson(),

View file

@ -17,7 +17,7 @@ extension PartsDashboardPage on DashboardPageState {
width: double.infinity,
child: Card(
elevation: 0,
color: orangeColors['primary']?.withOpacity(0.1),
color: orangeColors['primary']?..withValues(alpha: 0.1),
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
@ -85,7 +85,7 @@ extension PartsDashboardPage on DashboardPageState {
width: double.infinity,
child: Card(
elevation: 0,
color: greenColors['primary']?.withOpacity(0.3),
color: greenColors['primary']?..withValues(alpha: 0.3),
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
@ -222,7 +222,7 @@ extension PartsDashboardPage on DashboardPageState {
width: 532,
child: Card(
elevation: 0,
color: Theme.of(context).colorScheme.outline.withOpacity(.1),
color: Theme.of(context).colorScheme.outline..withValues(alpha: .1),
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(

View file

@ -29,7 +29,7 @@ class ErrorPage extends StatelessWidget {
width: 1152,
child: Card(
elevation: 0,
color: theme.currentColorScheme.outline.withOpacity(.1),
color: theme.currentColorScheme.outline..withValues(alpha: .1),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -49,7 +49,7 @@ class ErrorPage extends StatelessWidget {
Widget _smallCard(AmbitoTheme theme) {
return Card(
elevation: 0,
color: theme.currentColorScheme.outline.withOpacity(.1),
color: theme.currentColorScheme.outline..withValues(alpha: .1),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [

View file

@ -97,8 +97,8 @@ class MeasureCategoriesPageState extends State<MeasureCategoriesPage> {
decoration: BoxDecoration(
borderRadius:
const BorderRadius.all(Radius.circular(8)),
color:
theme.currentColorScheme.onSurface.withOpacity(.1),
color: theme.currentColorScheme.onSurface
..withValues(alpha: .1),
),
width: Breakpoint.fromContext(context).width,
child: Padding(

View file

@ -29,8 +29,8 @@ class MainCard extends StatelessWidget {
contentPadding: const EdgeInsets.only(left: 16),
elevation: 0,
expandedTextColor: theme.currentColorScheme.outline,
baseColor: theme.currentColorScheme.outline.withOpacity(.1),
expandedColor: theme.currentColorScheme.outline.withOpacity(.1),
baseColor: theme.currentColorScheme.outline..withValues(alpha: .1),
expandedColor: theme.currentColorScheme.outline..withValues(alpha: .1),
title: Text(
context.translate(title),
style: theme.currentThemeData.textTheme.labelMedium

View file

@ -26,7 +26,7 @@ class SideBarCard extends StatelessWidget {
borderRadius: BorderRadius.circular(8),
),
elevation: 0,
color: greenColors['primary']!.withOpacity(.1),
color: greenColors['primary']!..withValues(alpha: .1),
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(

View file

@ -30,8 +30,8 @@ class CombinedCard extends StatelessWidget {
contentPadding: const EdgeInsets.only(left: 16),
elevation: 0,
expandedTextColor: theme.currentColorScheme.outline,
baseColor: theme.currentColorScheme.outline.withOpacity(.1),
expandedColor: theme.currentColorScheme.outline.withOpacity(.1),
baseColor: theme.currentColorScheme.outline..withValues(alpha: .1),
expandedColor: theme.currentColorScheme.outline..withValues(alpha: .1),
title: Text(
title,
style: theme.currentThemeData.textTheme.labelMedium

View file

@ -31,8 +31,8 @@ class GalleryCard extends StatelessWidget {
contentPadding: const EdgeInsets.only(left: 16),
elevation: 0,
expandedTextColor: theme.currentColorScheme.outline,
baseColor: theme.currentColorScheme.outline.withOpacity(.1),
expandedColor: theme.currentColorScheme.outline.withOpacity(.1),
baseColor: theme.currentColorScheme.outline..withValues(alpha: .1),
expandedColor: theme.currentColorScheme.outline..withValues(alpha: .1),
title: Text(
title,
style: theme.currentThemeData.textTheme.labelMedium

View file

@ -30,8 +30,8 @@ class SimpleTextCard extends StatelessWidget {
contentPadding: const EdgeInsets.only(left: 16),
elevation: 0,
expandedTextColor: theme.currentColorScheme.outline,
baseColor: theme.currentColorScheme.outline.withOpacity(.1),
expandedColor: theme.currentColorScheme.outline.withOpacity(.1),
baseColor: theme.currentColorScheme.outline..withValues(alpha: .1),
expandedColor: theme.currentColorScheme.outline..withValues(alpha: .1),
title: Text(
title,
style: theme.currentThemeData.textTheme.labelMedium

View file

@ -26,7 +26,8 @@ class SublevelMonthsCard extends StatelessWidget {
labelPadding: EdgeInsets.zero,
backgroundColor: active
? theme.currentColorScheme.secondary
: theme.currentColorScheme.outline.withOpacity(.1),
: theme.currentColorScheme.outline
..withValues(alpha: .1),
label: Text(
label,
style: theme.currentThemeData.textTheme.bodyLarge?.copyWith(

View file

@ -36,28 +36,26 @@ class SublevelUnorderedListCard extends StatelessWidget {
title,
style: theme.currentThemeData.textTheme.labelMedium,
),
...text!
.map(
(item) => Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Align(
alignment: Alignment.center,
child: Icon(Icons.circle, size: 4),
),
theme.horizontalSpacerSmall,
Expanded(
child: Text(
item,
softWrap: true,
maxLines: 2,
style: theme.bodyMedium,
),
),
],
...text!.map(
(item) => Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Align(
alignment: Alignment.center,
child: Icon(Icons.circle, size: 4),
),
)
.toList(),
theme.horizontalSpacerSmall,
Expanded(
child: Text(
item,
softWrap: true,
maxLines: 2,
style: theme.bodyMedium,
),
),
],
),
),
],
),
),

View file

@ -30,8 +30,8 @@ class UnorderedListCard extends StatelessWidget {
contentPadding: const EdgeInsets.only(left: 16),
elevation: 0,
expandedTextColor: theme.currentColorScheme.outline,
baseColor: theme.currentColorScheme.outline.withOpacity(.1),
expandedColor: theme.currentColorScheme.outline.withOpacity(.1),
baseColor: theme.currentColorScheme.outline..withValues(alpha: .1),
expandedColor: theme.currentColorScheme.outline..withValues(alpha: .1),
title: Text(
title,
style: theme.currentThemeData.textTheme.labelMedium

View file

@ -34,10 +34,7 @@ class MaterialCard extends StatelessWidget {
theme.verticalSpacer,
if (massnahme.costs != null)
Text(
context.translate(
'page.actionDetailPage.material.suggested_price') +
massnahme.costs +
'',
'${context.translate('page.actionDetailPage.material.suggested_price')} ${massnahme.costs}',
style: theme.bodyMedium.copyWith(fontWeight: FontWeight.bold),
),
theme.verticalSpacer,

View file

@ -103,7 +103,7 @@ class MeasureGroupsPageState extends State<MeasureGroupsPage> {
borderRadius:
const BorderRadius.all(Radius.circular(8)),
color:
theme.currentColorScheme.onSurface.withOpacity(.1),
theme.currentColorScheme.onSurface..withValues(alpha:.1),
),
width: Breakpoint.fromContext(context).width,
child: Padding(

View file

@ -273,7 +273,7 @@ class MeasuresPageState extends State<MeasuresPage> {
width: double.infinity,
child: Card(
elevation: 0,
color: theme.currentColorScheme.outline.withOpacity(.1),
color: theme.currentColorScheme.outline..withValues(alpha: .1),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,

View file

@ -43,7 +43,7 @@ class CardMeasure extends StatelessWidget {
context,
title: group!.name!,
image: group!.image,
color: actionGroupColors[group!.name!]!.withOpacity(0.1),
color: actionGroupColors[group!.name!]!..withValues(alpha: 0.1),
titleColor: actionGroupColors[group!.name!]!,
description: group!.description! +
ListRepository()

View file

@ -73,8 +73,8 @@ class EditAreaNoticeDialog extends StatelessWidget {
Navigator.pop(context);
},
title: 'Abbrechen',
backgroundColor:
theme.currentColorScheme.surface.withOpacity(.1),
backgroundColor: theme.currentColorScheme.surface
..withValues(alpha: .1),
foregroundColor: theme.currentColorScheme.primary,
borderColor: theme.currentColorScheme.primary,
),

View file

@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
class MarkerGenerator {
final _markerSize;
final double _markerSize;
double _circleStrokeWidth = 0;
double _circleOffset = 0;
double _outlineCircleWidth = 0;