-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from msi-se/dev
Input Tool V1 and other small changes
- Loading branch information
Showing
86 changed files
with
22,910 additions
and
499 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
backend/src/main/java/de/htwg_konstanz/mobilelearning/repositories/MenuStateRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
package de.htwg_konstanz.mobilelearning.repositories; | ||
|
||
|
||
|
||
|
||
import de.htwg_konstanz.mobilelearning.models.external.menu.MenuState; | ||
import io.quarkus.mongodb.panache.PanacheMongoRepository; | ||
import io.quarkus.panache.common.Sort; | ||
import jakarta.enterprise.context.ApplicationScoped; | ||
|
||
@ApplicationScoped | ||
public class MenuStateRepository implements PanacheMongoRepository<MenuState> { | ||
|
||
public MenuState getLatestMenuState() { | ||
return findAll().firstResult(); | ||
// sort on timestamp descending and return first | ||
return this.listAll(Sort.by("timestamp", Sort.Direction.Descending)).stream().findFirst().orElse(null); | ||
} | ||
} |
418 changes: 418 additions & 0 deletions
418
backend/src/main/java/de/htwg_konstanz/mobilelearning/services/MaintService.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
enum ButtonType { primary, secondary, cancel } | ||
|
||
class BasicButton extends StatelessWidget { | ||
final ButtonType type; | ||
final String text; | ||
final VoidCallback onPressed; | ||
|
||
const BasicButton({ | ||
Key? key, | ||
required this.type, | ||
required this.text, | ||
required this.onPressed, | ||
}) : super(key: key); | ||
|
||
Color _getButtonColor(ColorScheme colors) { | ||
switch (type) { | ||
case ButtonType.primary: | ||
return colors.primary; | ||
case ButtonType.secondary: | ||
return colors.surfaceTint; | ||
case ButtonType.cancel: | ||
return const Color(0xFFEDF5F3); | ||
default: | ||
return colors.primary; | ||
} | ||
} | ||
|
||
Color _getTextColor(ColorScheme colors) { | ||
switch (type) { | ||
case ButtonType.primary: | ||
return Colors.white; | ||
case ButtonType.secondary: | ||
return colors.primary; | ||
case ButtonType.cancel: | ||
return Colors.red; | ||
default: | ||
return Colors.white; | ||
} | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) | ||
{ | ||
final colors = Theme.of(context).colorScheme; | ||
return ElevatedButton( | ||
onPressed: onPressed, | ||
style: ElevatedButton.styleFrom( | ||
backgroundColor: _getButtonColor(colors), | ||
), | ||
child: Text( | ||
text, | ||
style: TextStyle(color: _getTextColor(colors)), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.