WIP lk select dialog
This commit is contained in:
@ -0,0 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ResultStep extends Step {
|
||||
const ResultStep() : super(
|
||||
title: const Text("Ergebnis"),
|
||||
content: const SizedBox.shrink(),
|
||||
);
|
||||
}
|
29
lib/view/pages/more/abiturCalculator/steps/selectGkStep.dart
Normal file
29
lib/view/pages/more/abiturCalculator/steps/selectGkStep.dart
Normal file
@ -0,0 +1,29 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:marianum_mobile/view/pages/more/abiturCalculator/abiturCalculatorView.dart';
|
||||
|
||||
import '../models/abiturCalculatorModel.dart';
|
||||
|
||||
class SelectGkStep extends Step {
|
||||
SelectGkStep() : super(
|
||||
title: const Text("Grundkurse"),
|
||||
content: Builder(builder: (context) {
|
||||
var gkSubjects = AbiturCalculatorModel.get(context).getSubjects.collection.where((e) => e.isGk()).toList();
|
||||
return Column(
|
||||
children: [
|
||||
AbiturCalculatorView.listSubjects(gkSubjects),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// barrierDismissible: false,
|
||||
// builder: (context) => const SelectGkDialog(),
|
||||
// );
|
||||
},
|
||||
child: Text(
|
||||
"Grundkurse ${gkSubjects.isEmpty ? "auswählen" : "ändern"}"),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
66
lib/view/pages/more/abiturCalculator/steps/selectLkStep.dart
Normal file
66
lib/view/pages/more/abiturCalculator/steps/selectLkStep.dart
Normal file
@ -0,0 +1,66 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:marianum_mobile/widget/providerBridge.dart';
|
||||
|
||||
import '../../../../../widget/centeredLeading.dart';
|
||||
import '../abiturCalculatorView.dart';
|
||||
import '../models/abiturCalculatorModel.dart';
|
||||
|
||||
class SelectLkStep extends Step {
|
||||
SelectLkStep() : super(
|
||||
title: const Text("Leistungskurse"),
|
||||
content: StatefulBuilder(builder: (context, setState) {
|
||||
var model = AbiturCalculatorModel.get(context);
|
||||
var lkSubjects = model.getSubjects.collection.where((e) => e.isLk()).toList();
|
||||
return Column(
|
||||
children: [
|
||||
AbiturCalculatorView.listSubjects(lkSubjects),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
ProviderBridge.toDialog(context, model, (context, value) {
|
||||
return AlertDialog(
|
||||
title: const Text("Leistungskurse"),
|
||||
content: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: model.getSubjects.collection.map((e) {
|
||||
return ListTile(
|
||||
leading: CenteredLeading(Icon(e.icon)),
|
||||
title: Text(e.displayName),
|
||||
trailing: Checkbox(
|
||||
value: e.isLk(),
|
||||
onChanged: e.isLk() || e.canLk(model.getSubjects.collection) ? (value) {
|
||||
model.updateSubjects((collection) {
|
||||
e.unsafeLkToggle = value!;
|
||||
});
|
||||
} : null,
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: const Text("Fertig"),
|
||||
)
|
||||
],
|
||||
);
|
||||
});
|
||||
},
|
||||
child: Text("Leistungskurse ${lkSubjects.isEmpty ? "auswählen" : "ändern"}"),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
class SelectLkStepTest extends StatelessWidget {
|
||||
const SelectLkStepTest({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Placeholder();
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SelectPfStep extends Step {
|
||||
const SelectPfStep() : super(
|
||||
title: const Text("Prüfungsfächer"),
|
||||
content: const SizedBox.shrink(),
|
||||
);
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class WelcomeStep extends Step {
|
||||
const WelcomeStep() : super(
|
||||
title: const Text("Willkommen"),
|
||||
content: const Text("In den folgenden Schritten werden alle nötigen Informationen zur Ermittlung deiner Abiturzulassung abgefragt.")
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user