Commit Graph

2310 Commits

Author SHA1 Message Date
Calcitem 615047f872
Merge remote-tracking branch 'origin/dev' 2021-10-30 13:07:19 +08:00
Calcitem bd2d123225
l10n: Fix exception when switching to Norsk
Exception:

exception = {FlutterError} No MaterialLocalizations found.
  AlertDialog widgets require MaterialLocalizations to be provided by a Localizations widget ances
context = {StatelessElement} AlertDialog(dirty, dependencies:
  [MediaQuery, _LocalizationsScope-[GlobalKey#5646e], Directionality, _InheritedTheme])

Reference:
https://blog.csdn.net/wangyajuncsd/article/details/106930365
https://github.com/flutter/flutter/blob/master/packages/flutter_localizations/lib/src/l10n/generated_material_localizations.dart Line 18605
2021-10-30 12:57:59 +08:00
Calcitem 2a3afa625a
ci: Create dart-analyze.yml
See: https://github.com/ValentinVignal/action-dart-analyze
2021-10-30 09:03:05 +08:00
Leptopoda 2e48f98f2a
fix some localizations fixes #352 also fixes #342
fix betterFeedback localization
2021-10-28 12:42:01 +02:00
Leptopoda 61d980add2 cleanup constants 2021-10-26 10:33:34 +02:00
Leptopoda ed85908834 better null safety 2021-10-26 10:33:34 +02:00
Leptopoda bc915c7d53 unify logging tags
- make tags constant
- make tags private
2021-10-26 10:33:34 +02:00
Leptopoda 4525953b33 rewrite drawer fixes #316
rewrites the drawer from scratch

add drawer shaddow
2021-10-26 07:31:08 +08:00
Calcitem 9e6e6a6ac7
flutter: windows: Fix build error because of disabling warning 4996 2021-10-25 01:45:28 +08:00
Calcitem 77254675e1
qt: Change saved filename' format
Change from currentDateTime.toTime_t to currentDateTime
2021-10-24 19:43:39 +08:00
Calcitem d5d3758dce
qt: Fix GCC build error about QAction and QActionGroup
error: invalid use of incomplete type 'class QAction'
error: invalid use of incomplete type 'class QActionGroup'
2021-10-24 19:43:39 +08:00
Calcitem 0f77c59319
qt: Replace QSound with QSoundEffect 2021-10-24 19:43:38 +08:00
Calcitem 281f2b832b
qt: Replace QApplication::desktop() with QGuiApplication::primaryScreen()->geometry() 2021-10-24 19:43:38 +08:00
Calcitem f1f3514fae
qt: Disable NET_FIGHT_SUPPORT
Because QNetworkConfigurationManager, QNetworkConfiguration and QNetworkSession
are deprecated, to be removed in Qt 6.
2021-10-24 19:43:18 +08:00
Calcitem 472b184566
qt: Fix build warning 'QFlags<Qt::MouseButton>::QFlags'
Use default constructor instead.
2021-10-24 19:42:43 +08:00
Calcitem 240dca3c5b
qt: Replace QMatrix with QTransform
To Fix Warning	C4996	'QGraphicsView::setMatrix': Use setTransform()
2021-10-24 19:40:26 +08:00
Calcitem ae5e403be1
qt: Replace Qt::endl to "\n"
To fix Qt 5.12 MinGW build error.
2021-10-24 19:40:26 +08:00
Calcitem 5504f9120d
qt: Relpace endl by Qt::endl 2021-10-24 19:40:25 +08:00
Calcitem 57d1aff863
win32: Remove disabling warning 4996 2021-10-24 19:40:25 +08:00
Calcitem 8ff8d5808b
windows: Enable windows desktop in flutter-windows-init.sh 2021-10-23 14:16:00 +08:00
Calcitem d382d84817
msvc: Upgrade to Qt 5.15.2 2021-10-23 11:29:28 +08:00
Nikolas Rimikis b19c6354e3
Merge pull request #336 from calcitem/enviornment_config
add compile time enviornment options
2021-10-22 14:51:56 +02:00
Leptopoda a0f234bf47
add compile time enviornment options
## Why?
- in the future we could enable the developer options in dev builds only. This would result in better performance and smaller downloadsize.
- Ability to disable catcher. Catcher limits the ability of debuging as it catches everything thrown. Also catcher won't even display the crash when the system is in dark mode (white text on white background. Probably a bug on theier side)

## How to use this?
just add a `--dart-define` followed by your config after the flutter command. Further info can be found in [Readme.md](/Readme.md)
2021-10-22 14:47:17 +02:00
Leptopoda bffda2b816
check initialisation of audio fixes #326
Although not a problem in production there was an error when hot reloading  or using hot restart.

we now ckeck the initialisation of the autio service
2021-10-19 12:24:20 +02:00
Leptopoda 4d53769dca
fix code style fixes #335
- renames snackbar.dart
- fixes a wrong log
2021-10-19 10:44:38 +02:00
Nikolas Rimikis 965e66e43b
Merge pull request #333 from calcitem/license_page
use showLicensePage fixes #324
2021-10-18 15:22:33 +02:00
Leptopoda 8459d36ff1
use showLicensePage fixes #324
- migrate the `open source license page`to `showLicensePage()`
- deactivate unused buildrunner

## Why?
this method is flutter internal. This means less code to maintain and less issues to make (see the one this fixes).

## What changes?
- a bit of UI (the new page will have a master detail view on large screens helping accessibility)
- we don't need to pre generate the licenses manually
2021-10-18 15:10:53 +02:00
Leptopoda b00e982480
Merge branch 'l10n' into dev 2021-10-18 13:35:23 +02:00
Leptopoda 399250df9d
migrate l10n
Restyled by shellharden

Restyled by shfmt

Restyled by whitespace

fix ci
2021-10-18 13:33:11 +02:00
Leptopoda 150fd7215a
Merge branch 'config_rework' into dev 2021-10-18 11:34:23 +02:00
Leptopoda dc19874ee7
remove unused code 2021-10-18 11:28:22 +02:00
Leptopoda e93f62b455
reactive storage and db migration
- make new storage reactive
- add Database Migrator

change how the developerMode reacts
2021-10-18 11:28:11 +02:00
Leptopoda 21702f568f
fix file naming convention (fixes #325) 2021-10-17 18:27:28 +02:00
Calcitem 529ac8b493
.gitignore: Ignore all jks files 2021-10-17 10:23:39 +08:00
Calcitem 98244e0a04
lint: Fix invariant booleans
info: Conditions should not unconditionally evaluate to `true` or
to `false`. verify: pieceToRemoveCount <= 0.
(invariant_booleans at [sanmill] lib/mill/position.dart:675)
2021-10-16 13:35:02 +08:00
Calcitem 8d2afa2a5d
lint: Fix invalid assignment
Fix error: A value of type 'dynamic' can't be assigned to a variable
of type 'int'.
(invalid_assignment at [sanmill] lib/shared/picker.dart:76)
2021-10-16 13:32:41 +08:00
Calcitem 4df5dcd96d
build: Support Flutter 2.5.3 2021-10-16 12:06:04 +08:00
Calcitem f3a77965cb
build: Support Flutter 2.5.2 2021-10-16 11:26:20 +08:00
Leptopoda ef2b888410
initial database migration
- removed `shared/common/`
- implemented new data models for the settings
- implemented a new `LocalDatabaseService`

Why:
The new code will allow use to better utilize flutter's ractivenes. `HiveDB` (our new database backend) will give us `ValueListenable`, `Streams` and real time storage access. The sriliazation for the models is  generated by `build_runner` and even the old seriliazation for the storage migration is generated (json_serializable).

TODO:
- implement reactivenes. We currently don't utilize this functionality to it's full potential (`Consumer`) :)
- implement migration. The migration service for the old database service isn't there yet.
2021-10-15 18:40:50 +02:00
Leptopoda 16a4e3dc44
make constants constant :) 2021-10-14 16:29:39 +02:00
Leptopoda ca2d26a70f
Merge branch 'build_runner/flutter_gen' into dev 2021-10-14 16:03:34 +02:00
Leptopoda 1c52232ff9
use flutter_gen_runner
We will pre generate the asset paths.
This should lead to less errors in there.
update flutter-init.sh
2021-10-14 16:03:02 +02:00
Leptopoda 2562ed6078
Merge branch 'ci' into dev 2021-10-13 09:46:12 +02:00
Nikolas Rimikis 0f16608d49
enable ci on all branches 2021-10-13 09:44:36 +02:00
Calcitem 163d9b1e90
authors: Add Nikolas Rimikis to the authors list 2021-10-11 02:16:04 +08:00
Calcitem e7f7b6cf6f
Merge remote-tracking branch 'Leptopoda/linting' 2021-10-11 02:08:16 +08:00
Leptopoda 755e75231d
fix sound on game navigation
Effectively rewriting the entire audio stack

- propperly await futures
- only play sound once on take play back
 
Further testing is needed but as we await the autio play we should be able to remove the stopPlay now. 

fix late init problem
2021-10-10 20:02:59 +02:00
Calcitem b04a0bb40f
Merge remote-tracking branch 'Leptopoda/linting'
* Enabled strict linting.
* Fix all the linting errors and disabled the rules that needed to much
  restructure.
* Restructured the files.

Known Issues:

* Tap drawer menu item will get an exception when AI is thinking
Change difficulty level to 30, thinking time to 60, select AI Vs. AI and
tap Start Game, and tap on the settings in the drawer menu get the
exception:
This widget has been unmounted, so the State no longer has a context
(and should be considered defunct).

* Sound problem
when this option is enabled, it does not take effect:
  Preferences -> Sound effects -> Keep mute when taking back
The sound issue is related to some async not being
appropriately handled. This leads to the game_page setting Audios.
isTemporaryMute to false before Audios evaluated the value.
This leads to the sound being played. Some out-of-order execution.
It seems to be a thing with the code in general that Futures aren't
really awaited. This will be quite some stuff to do and check later.

* Performance
Performance testing has not yet been conducted.
2021-10-11 01:44:41 +08:00
Leptopoda c029bf39d0
game board cleanup
removes some unneded code and better utilizes null safety
2021-10-10 12:05:15 +02:00
Leptopoda 8727dc2a87
restructure
- move list_item_divider into lib/shared
- move lib/engine into lib/services/engine

unify Import style

- I've unified the way files are imported. We now use absolute imports everywhere.

This is not a must but I find it more usefull.

cleanup imports

- prefer using part files where needed
2021-10-10 11:54:46 +02:00