changed the layout to the first wireframes
This commit is contained in:
parent
66439d47be
commit
201444ce30
8 changed files with 134 additions and 52 deletions
|
@ -8,7 +8,7 @@
|
||||||
"title": "Start"
|
"title": "Start"
|
||||||
},
|
},
|
||||||
"database": {
|
"database": {
|
||||||
"title": "Datenbank"
|
"title": "Maßnahmen"
|
||||||
},
|
},
|
||||||
"designer": {
|
"designer": {
|
||||||
"title": "Designer"
|
"title": "Designer"
|
||||||
|
|
|
@ -5,9 +5,11 @@ import 'package:ambito/src/pages/start/start_page.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||||
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
import 'package:get/get_navigation/src/root/get_material_app.dart';
|
import 'package:get/get_navigation/src/root/get_material_app.dart';
|
||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
import 'package:logger/logger.dart';
|
import 'package:logger/logger.dart';
|
||||||
|
import 'package:syncfusion_localizations/syncfusion_localizations.dart';
|
||||||
|
|
||||||
const String ambitoToken = 'TFxO7vzBLVRCu9I3VMoHmTuCvSu8aCDi';
|
const String ambitoToken = 'TFxO7vzBLVRCu9I3VMoHmTuCvSu8aCDi';
|
||||||
|
|
||||||
|
@ -56,8 +58,13 @@ class Ambito extends StatelessWidget {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
GlobalMaterialLocalizations.delegate,
|
||||||
|
GlobalCupertinoLocalizations.delegate,
|
||||||
|
GlobalWidgetsLocalizations.delegate,
|
||||||
|
SfGlobalLocalizations.delegate,
|
||||||
],
|
],
|
||||||
title: 'Flutter Demo',
|
title: 'Flutter Demo',
|
||||||
|
supportedLocales: [Locale('de')],
|
||||||
locale: const Locale('de'),
|
locale: const Locale('de'),
|
||||||
builder: FlutterI18n.rootAppBuilder(),
|
builder: FlutterI18n.rootAppBuilder(),
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
|
|
|
@ -37,15 +37,13 @@ class BaseApi {
|
||||||
case 'baumarten':
|
case 'baumarten':
|
||||||
for (var baumart in json['results']) {
|
for (var baumart in json['results']) {
|
||||||
BaseDB.put(Baumarten.fromJson(baumart));
|
BaseDB.put(Baumarten.fromJson(baumart));
|
||||||
Baumarten art = Baumarten.fromJson(baumart);
|
|
||||||
isar.write((isar) {
|
isar.write((isar) {
|
||||||
isar.baumartens.put(art);
|
isar.baumartens.put(Baumarten.fromJson(baumart));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'massnahmen':
|
case 'massnahmen':
|
||||||
for (var massnahme in json['results']) {
|
for (var massnahme in json['results']) {
|
||||||
logger.d(massnahme);
|
|
||||||
BaseDB.put(Massnahme.fromJson(massnahme));
|
BaseDB.put(Massnahme.fromJson(massnahme));
|
||||||
isar.write((isar) {
|
isar.write((isar) {
|
||||||
isar.massnahmes.put(Massnahme.fromJson(massnahme));
|
isar.massnahmes.put(Massnahme.fromJson(massnahme));
|
||||||
|
|
|
@ -9,6 +9,7 @@ import 'package:ambito/src/widgets/form/form_widget_type.dart';
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:expandable_text/expandable_text.dart';
|
import 'package:expandable_text/expandable_text.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||||
|
|
||||||
import '../../../main.dart';
|
import '../../../main.dart';
|
||||||
|
|
||||||
|
@ -67,12 +68,15 @@ class ActionsPageState extends State<ActionsPage> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (massnahme.timeFrame != null) {
|
if (massnahme.timeFrame != null) {
|
||||||
|
logger.d(massnahme.timeFrame);
|
||||||
for (IdValueColor tfType in massnahme.timeFrame!) {
|
for (IdValueColor tfType in massnahme.timeFrame!) {
|
||||||
updatedMonths.add(tfType.value!);
|
updatedMonths.add(tfType.value!);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.d(updatedMonths);
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
type.addAll(updatedTypes);
|
type.addAll(updatedTypes);
|
||||||
areaType.addAll(updatedAreaTypes);
|
areaType.addAll(updatedAreaTypes);
|
||||||
|
@ -119,15 +123,30 @@ class ActionsPageState extends State<ActionsPage> {
|
||||||
style: Theme.of(context).textTheme.titleLarge,
|
style: Theme.of(context).textTheme.titleLarge,
|
||||||
),
|
),
|
||||||
getSpacer(),
|
getSpacer(),
|
||||||
getFilter(context),
|
|
||||||
getSpacer(),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: SingleChildScrollView(
|
child: Row(
|
||||||
child: Wrap(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: actionCards,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
),
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 300,
|
||||||
|
child: getFilter(context),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 16,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Wrap(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
children: actionCards,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
getSpacer(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -199,8 +218,15 @@ class ActionsPageState extends State<ActionsPage> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
var monthsSorted = months.toList();
|
List<String> monthsSorted = [];
|
||||||
monthsSorted.sort((a, b) => a.toLowerCase().compareTo(b.toLowerCase()));
|
|
||||||
|
for (int i = 1; i <= 12; i++) {
|
||||||
|
monthsSorted
|
||||||
|
.add(FlutterI18n.translate(context, 'general.lists.months.$i'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*var monthsSorted = months.toList();
|
||||||
|
monthsSorted.sort((a, b) => a.toLowerCase().compareTo(b.toLowerCase()));*/
|
||||||
|
|
||||||
/*fields.add(
|
/*fields.add(
|
||||||
FieldDropdown(
|
FieldDropdown(
|
||||||
|
@ -220,6 +246,8 @@ class ActionsPageState extends State<ActionsPage> {
|
||||||
entries: monthsSorted,
|
entries: monthsSorted,
|
||||||
),
|
),
|
||||||
);*/
|
);*/
|
||||||
|
|
||||||
|
logger.d(monthsSorted);
|
||||||
fields.add(
|
fields.add(
|
||||||
FieldMonthsRangepicker(
|
FieldMonthsRangepicker(
|
||||||
name: 'months',
|
name: 'months',
|
||||||
|
@ -227,7 +255,7 @@ class ActionsPageState extends State<ActionsPage> {
|
||||||
filterValue: filterMonths,
|
filterValue: filterMonths,
|
||||||
onClear: () {},
|
onClear: () {},
|
||||||
onSelected: (String? value) {},
|
onSelected: (String? value) {},
|
||||||
entries: months.toList(),
|
entries: monthsSorted,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -12,41 +12,55 @@ class StartPage extends StatefulWidget {
|
||||||
|
|
||||||
class StartPageState extends State<StartPage> {
|
class StartPageState extends State<StartPage> {
|
||||||
String activeLink = '';
|
String activeLink = '';
|
||||||
|
Widget content = const SizedBox();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
activeLink = 'start';
|
setState(() {
|
||||||
|
activeLink = 'database';
|
||||||
|
content = const ActionsPage();
|
||||||
|
});
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Column(
|
appBar: AppBar(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
leading: Row(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 50),
|
const SizedBox(
|
||||||
Row(
|
width: 30,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
),
|
||||||
children: [
|
Image.asset(
|
||||||
_linkButton('start'),
|
'images/logo.png',
|
||||||
_linkButton('database'),
|
scale: .8,
|
||||||
_linkButton('designer'),
|
),
|
||||||
Image.asset(
|
const SizedBox(
|
||||||
'images/logo.png',
|
width: 30,
|
||||||
scale: 1.3,
|
),
|
||||||
),
|
_linkButton('database'),
|
||||||
_linkButton('service'),
|
],
|
||||||
_linkButton('network'),
|
),
|
||||||
_linkButton('contact'),
|
leadingWidth: 400,
|
||||||
|
toolbarHeight: 100,
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
actions: [
|
||||||
|
IconButton(onPressed: () {}, icon: const Icon(Icons.person)),
|
||||||
|
const SizedBox(
|
||||||
|
width: 30,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 50),
|
body: const Column(
|
||||||
Expanded(
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
child: getContent(),
|
children: [
|
||||||
),
|
SizedBox(height: 50),
|
||||||
],
|
Expanded(
|
||||||
));
|
child: ActionsPage(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget getContent() {
|
Widget getContent() {
|
||||||
|
@ -57,7 +71,7 @@ class StartPageState extends State<StartPage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _linkButton(String link) {
|
Widget _linkButton(String link) {
|
||||||
double fontSize = 16;
|
double fontSize = 24;
|
||||||
return TextButton(
|
return TextButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
overlayColor:
|
overlayColor:
|
||||||
|
|
|
@ -8,7 +8,7 @@ import Foundation
|
||||||
import geolocator_apple
|
import geolocator_apple
|
||||||
import isar_flutter_libs
|
import isar_flutter_libs
|
||||||
import path_provider_foundation
|
import path_provider_foundation
|
||||||
import sqflite
|
import sqflite_darwin
|
||||||
|
|
||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
|
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
|
||||||
|
|
58
pubspec.lock
58
pubspec.lock
|
@ -290,10 +290,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: file
|
name: file
|
||||||
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
|
sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.0.0"
|
version: "7.0.1"
|
||||||
fixnum:
|
fixnum:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -348,7 +348,7 @@ packages:
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.0"
|
version: "4.0.0"
|
||||||
flutter_localizations:
|
flutter_localizations:
|
||||||
dependency: transitive
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
@ -718,10 +718,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_android
|
name: path_provider_android
|
||||||
sha256: f7544c346a0742aee1450f9e5c0f5269d7c602b9c95fdbcd9fb8f5b1df13b1cc
|
sha256: c464428172cb986b758c6d1724c603097febb8fb855aa265aeecc9280c294d4a
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.11"
|
version: "2.2.12"
|
||||||
path_provider_foundation:
|
path_provider_foundation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -939,18 +939,42 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: sqflite
|
name: sqflite
|
||||||
sha256: ff5a2436ef8ebdfda748fbfe957f9981524cb5ff11e7bafa8c42771840e8a788
|
sha256: "79a297dc3cc137e758c6a4baf83342b039e5a6d2436fcdf3f96a00adaaf2ad62"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.3+2"
|
version: "2.4.0"
|
||||||
|
sqflite_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sqflite_android
|
||||||
|
sha256: "78f489aab276260cdd26676d2169446c7ecd3484bbd5fead4ca14f3ed4dd9ee3"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.0"
|
||||||
sqflite_common:
|
sqflite_common:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: sqflite_common
|
name: sqflite_common
|
||||||
sha256: "2d8e607db72e9cb7748c9c6e739e2c9618320a5517de693d5a24609c4671b1a4"
|
sha256: "4468b24876d673418a7b7147e5a08a715b4998a7ae69227acafaab762e0e5490"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.5.4+4"
|
version: "2.5.4+5"
|
||||||
|
sqflite_darwin:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sqflite_darwin
|
||||||
|
sha256: "769733dddf94622d5541c73e4ddc6aa7b252d865285914b6fcd54a63c4b4f027"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.1-1"
|
||||||
|
sqflite_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sqflite_platform_interface
|
||||||
|
sha256: "8dd4515c7bdcae0a785b0062859336de775e8c65db81ae33dd5445f35be61920"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.0"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -987,18 +1011,26 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: syncfusion_flutter_core
|
name: syncfusion_flutter_core
|
||||||
sha256: "95a53df168fd4473bbf23c481db656db97434d18d60f59fbeec97a754794f7b5"
|
sha256: "7130fc3259247946b59fe9b76ee89500c775c3f7e5c1d0826f3105e1dd0bebf6"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "27.1.51"
|
version: "27.1.52"
|
||||||
syncfusion_flutter_datepicker:
|
syncfusion_flutter_datepicker:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: syncfusion_flutter_datepicker
|
name: syncfusion_flutter_datepicker
|
||||||
sha256: dcb9da082d2e39c84415a8323287a0714ffd349d5cf3bed93af1ad0b30b7dfd9
|
sha256: "61efc09e962d7b7cc3c7d33a2e44ec027112403af49590d5cc1025a255cc34fa"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "27.1.51"
|
version: "27.1.52"
|
||||||
|
syncfusion_localizations:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: syncfusion_localizations
|
||||||
|
sha256: d04b86990411e1f0c896e273bbdb312b1ed52d8009010ddc2af9cbea5ed90e09
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "27.1.52"
|
||||||
synchronized:
|
synchronized:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -9,6 +9,8 @@ environment:
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
flutter_localizations:
|
||||||
|
sdk: flutter
|
||||||
cupertino_icons: ^1.0.6
|
cupertino_icons: ^1.0.6
|
||||||
intl: ^0.19.0
|
intl: ^0.19.0
|
||||||
flutter_map: ^7.0.2
|
flutter_map: ^7.0.2
|
||||||
|
@ -39,6 +41,7 @@ dependencies:
|
||||||
http: ^1.2.2
|
http: ^1.2.2
|
||||||
flutter_form_builder: ^9.4.1
|
flutter_form_builder: ^9.4.1
|
||||||
syncfusion_flutter_datepicker: ^27.1.50
|
syncfusion_flutter_datepicker: ^27.1.50
|
||||||
|
syncfusion_localizations: ^27.1.52
|
||||||
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|
Loading…
Reference in a new issue