-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QuestionRepository: + refactor funzioni; + update data, file con cache; + isValid() & parse(); ViewMenu: + controllo nuove domande; ViewSettings: + ripristino impostazione singola con doppio tap; + controllo nuove domande; + caricamento file domande personalizzato;
- Loading branch information
Showing
12 changed files
with
952 additions
and
119 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
app-mobile/flutter_application/lib/model/PlatformType.dart
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,18 @@ | ||
import 'dart:io'; | ||
|
||
enum PlatformType { UNKNOWN, MOBILE, DESKTOP, WEB } | ||
|
||
PlatformType getPlatformType() { | ||
try { | ||
if (Platform.isAndroid || Platform.isIOS) { | ||
return PlatformType.MOBILE; | ||
} else if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) { | ||
return PlatformType.DESKTOP; | ||
} | ||
} catch (e) { | ||
if (e.toString().contains("Unsupported operation")) { | ||
return PlatformType.WEB; | ||
} | ||
} | ||
return PlatformType.UNKNOWN; | ||
} |
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,11 @@ | ||
import 'package:roquiz/persistence/QuestionRepository.dart'; | ||
|
||
class Utils { | ||
static String getParsedDateTime(DateTime date) { | ||
if (date == QuestionRepository.CUSTOM_DATE) { | ||
return "personalizzato"; | ||
} else { | ||
return "${date.day < 10 ? "0" : ""}${date.day}/${date.month < 10 ? "0" : ""}${date.month}/${date.year}, ${date.hour < 10 ? "0" : ""}${date.hour}:${date.minute < 10 ? "0" : ""}${date.minute}"; | ||
} | ||
} | ||
} |
Oops, something went wrong.