Commit Graph

2238 Commits

Author SHA1 Message Date
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
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
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
Leptopoda 339af39579
Externalize GamePageToolBar widget 2021-10-10 11:54:38 +02:00
Leptopoda 53ddb55b04
restructure drawer
cleanup the drawer code.

- fixes the drawer design

Home drawer performance improvements

As the child doesn't depend on the transformation we shouldn't repaint it => better performance
2021-10-10 11:48:16 +02:00
Leptopoda 961aa6241b
fix some stuff
- remove unnecessary containers
- bump linting version in pubspec.yml
- make `isLargeScreen` and `isSmallScreen` a geter
- add decimal points to double values
- remove unused SizedBox
- use const constructor where possible
- remove residual code
- fix help_screen AppBar
- Fix historyNavToolbar padding

fix styling of drawer
- fix the padding of the drawer elements.


cleanup settings
- removes unused properties
- fixes ListItemDivider height
2021-10-10 11:17:11 +02:00
Leptopoda 418d1cfb44
cleanup boilerplate code 2021-10-10 11:09:29 +02:00
Leptopoda ab97c71188
restructure files and renable theming
- change file structure
- fixes the personalication/theme to not be static anymore
2021-10-10 11:08:57 +02:00
Leptopoda ef6c7a2176
cleanup widget tree
removes some redundant widgets that aren't displayed or diplicated
2021-10-10 11:08:06 +02:00
Leptopoda 26b7f49a8e
cleanup code
Also makes some Widgets stateless (resulting in performance improvements)
2021-10-10 11:07:56 +02:00
Leptopoda 6c0dd46f05
fix a ton of linting
Most notably:
- require_trailing_commas
- prefer_const_constructors
- type_annotate_public_apis
-  always_declare_return_types
- prefer_foreach
- use_string_buffers
- join_return_with_assignment

For now disabled rules:
- avoid_positional_boolean_parameters
- constant_identifier_names
- avoid_escaping_inner_quotes
- use_build_context_synchronously
Those lint rules are going to be disabled for now as they require massive restructure and logic change of the current codebase
Already fixed:
- avoid_print (previous commit)
2021-10-10 11:06:16 +02:00
Calcitem 146ac77462
Indonesian: Change app name from Pabrik to Mill 2021-10-10 07:47:27 +08:00
Calcitem 3e388136e4 Update intl_id.arb (POEditor.com) 2021-10-10 07:42:43 +08:00
Leptopoda 33966c9bb2
replace print() with debugPrint()
fixes this int rule
- avoid_print (previous commit)

format files
2021-10-08 19:54:01 +02:00
Leptopoda 5397d4ff14
auto format on save for vsCode
this enables vscode to auto format files in the flutter project.
Also fixes a formatting error

enable formatting only for dart files


format settings.json
2021-10-08 19:53:01 +02:00
Leptopoda bb31257cc3
add linting and fix pubspec.yml 2021-10-08 15:42:27 +02:00
Calcitem a5dfe514f2
Sanmill v1.1.38 (2196)
Official release version of Sanmill v1.1.38

Signed-off-by: Calcitem <calcitem@outlook.com>
2021-10-05 00:33:27 +08:00
Calcitem 351b79b7bf
i10n: Improve translations 2021-10-04 23:47:31 +08:00
Calcitem c6ab8791da
settings: Allow to set Point style and Point width
Point style only supports None and Solid, not supports Hollow yet.
2021-10-04 21:36:13 +08:00
Calcitem fb639a1e4c
Draw point on the game board 2021-10-04 20:21:07 +08:00
Calcitem ac98b7e12b
Add tips of continueToMakeMove 2021-10-04 19:22:56 +08:00
Calcitem bab7380963
rule: Support Threefold repetition setting 2021-10-04 17:57:24 +08:00
Calcitem 04abced830
Support import GoldToken move list
See: https://www.goldtoken.com
2021-10-04 17:57:24 +08:00
Calcitem e4ba8f3df9
i10n: improve Farsi translation of removeUnplacedPiece 2021-10-04 17:57:23 +08:00
Calcitem 6c78b9fbff
rule: Modify the judgment condition of N-move rule from 'greater than' to 'greater than or equal to' 2021-10-04 17:57:23 +08:00