Skip to content

Commit

Permalink
datagrid & sexes refact
Browse files Browse the repository at this point in the history
  • Loading branch information
miakh committed Dec 5, 2023
1 parent 2c28899 commit f26295e
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/dataGrids/AdministrationHeader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:avapp/dataGrids/SingleTableDataGrid.dart';
import 'package:flutter/material.dart';
import 'package:pluto_grid/pluto_grid.dart';

import '../models/PlutoAbstract.dart';
import 'PlutoAbstract.dart';
import '../services/DialogHelper.dart';
import '../services/ToastHelper.dart';

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/dataGrids/SingleTableDataGrid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:pluto_grid/pluto_grid.dart';

import '../models/PlutoAbstract.dart';
import 'PlutoAbstract.dart';
import 'AdministrationHeader.dart';

enum DataGridFirstColumn{
Expand Down
4 changes: 2 additions & 2 deletions lib/models/EventModel.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:avapp/models/PlaceModel.dart';
import 'package:avapp/services/DataGridHelper.dart';
import 'package:avapp/dataGrids/DataGridHelper.dart';
import 'package:intl/intl.dart';
import 'package:pluto_grid/pluto_grid.dart';

import '../models/PlutoAbstract.dart';
import '../dataGrids/PlutoAbstract.dart';
import '../services/DataService.dart';

class EventModel extends IPlutoRowModel {
Expand Down
2 changes: 1 addition & 1 deletion lib/models/ExclusiveGroupModel.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:pluto_grid/pluto_grid.dart';

import '../models/PlutoAbstract.dart';
import '../dataGrids/PlutoAbstract.dart';
import '../services/DataService.dart';

class ExclusiveGroupModel extends IPlutoRowModel {
Expand Down
2 changes: 1 addition & 1 deletion lib/models/InformationModel.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:avapp/services/DataService.dart';
import 'package:pluto_grid/pluto_grid.dart';

import 'PlutoAbstract.dart';
import '../dataGrids/PlutoAbstract.dart';


class InformationModel extends IPlutoRowModel {
Expand Down
2 changes: 1 addition & 1 deletion lib/models/PlaceModel.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:avapp/services/DataService.dart';
import 'package:pluto_grid/pluto_grid.dart';

import 'PlutoAbstract.dart';
import '../dataGrids/PlutoAbstract.dart';

class PlaceModel extends IPlutoRowModel {
dynamic latLng;
Expand Down
2 changes: 1 addition & 1 deletion lib/models/UserGroupInfoModel.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:pluto_grid/pluto_grid.dart';

import '../models/PlutoAbstract.dart';
import '../dataGrids/PlutoAbstract.dart';
import '../services/DataService.dart';
import 'PlaceModel.dart';
import 'UserInfoModel.dart';
Expand Down
3 changes: 2 additions & 1 deletion lib/models/UserInfoModel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:intl/intl.dart';
import 'package:pluto_grid/pluto_grid.dart';

import '../services/DataService.dart';
import 'PlutoAbstract.dart';
import '../dataGrids/PlutoAbstract.dart';

class UserInfoModel extends IPlutoRowModel {
String? id;
Expand Down Expand Up @@ -39,6 +39,7 @@ class UserInfoModel extends IPlutoRowModel {

PlaceModel? place;

static const sexes = ["male", "female"];

static const migrateColumns =
{
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/AdministrationPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:avapp/models/PlaceModel.dart';
import 'package:avapp/models/UserGroupInfoModel.dart';
import 'package:avapp/models/UserInfoModel.dart';
import 'package:avapp/pages/MapPage.dart';
import 'package:avapp/services/DataGridHelper.dart';
import 'package:avapp/dataGrids/DataGridHelper.dart';
import 'package:avapp/services/DataService.dart';
import 'package:avapp/services/MailerSendHelper.dart';
import 'package:avapp/services/MapIconService.dart';
Expand Down Expand Up @@ -127,8 +127,8 @@ class _AdministrationPageState extends State<AdministrationPage> {
PlutoColumn(
title: "Pohlaví",
field: UserInfoModel.sexColumn,
type: PlutoColumnType.select(["male", "female"]),
formatter: (value) => DataGridHelper.returnQuestionMarkOnInvalid(value, ["male", "female"]),
type: PlutoColumnType.select(UserInfoModel.sexes),
formatter: (value) => DataGridHelper.returnQuestionMarkOnInvalid(value, UserInfoModel.sexes),
applyFormatterInEditing: true,
width: 100,
),
Expand Down

0 comments on commit f26295e

Please sign in to comment.