Thomas Lamprecht [Wed, 17 Apr 2024 18:13:26 +0000 (20:13 +0200)]
widgets: use colored safe-area to keep status bar color intact
Decided to check all SafeArea's here after the previous commit and
found that most of them cause some breakage w.r.t. system status bar
coloring, so replace the problematic ones with the new
ColoredSafeArea widget.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Wed, 17 Apr 2024 13:32:46 +0000 (15:32 +0200)]
node: power options: rework prompt title and text
Avoid some rather odd "to do action '...'" wording and try to better
follow the examples of material design style guide, as mentioned in
the previous commit, and convey the implications of the action.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
node overview: power menu: reorder/reword confirm buttons
Move the confirmation button to the right as mentioned in the
material spec [0], and reword the buttons to spell out the action,
i.e., 'cancel' and 'shutdown' or 'reboot', respectively.
For that to work properly, slightly rename the confirmation message.
by using 'SystemNavigator.pop()' on the top level page when pressing the
back button. On Android this minimizes/closes the app an presents
whatever was shown before.
This fixes an issue where we would show a blank screen when pressing the
back button on the dashboard.
instead of flutter webview. This new dependency does not have the
limitations of the "official" flutter webview. We now can ignore
https errors and even get some info on the certificate.
We use that to now show a 'do you want to trust this cert' dialog with
the fingerprint of the server, which the user can then either trust or
abort.
When pressing yes, we save that fingerprint in the shared preferences so
that we don't have to ask the next time.
Thomas Lamprecht [Tue, 16 Apr 2024 14:11:25 +0000 (16:11 +0200)]
node overview: relay if updates could not be queried due to permissions
While this is an edge case (most users connect via root or a user
holding powerful admin rights over all) it still better to avoid
suggesting that there are no updates available if the user cannot
query them due to lacking the Sys.Modify permissions on the node.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
by making it rounded (which appears as 'less dangerous').
Sadly the 'error' icon is not really usable for us, since it looks
almost the same as the 'info' icon (just 180 degree rotated).
We could use an 'outline' variant for either, but making the 'less
dangerous' one rounded feels alright.
since cards now have a very rounded corner, one can see the non clipped
shape of the contained ExpansionTile.
To fix that, make the shape a RoundedRectangleBorder (which also removes
the added top/bottom border on expansion) and set the clipBehavior of
the surrounding card to antiAlias.
it's recommended to use fromSeed with what was the primary color
beforehand. With this, all colors are correctly deduced from it (e.g.
outline colors etc.).
But since we then set primaryContainer, we also have to set
onPrimaryContainer, otherwise it's deduced from the original primaryContainer
color that would have been generated.
this fixes the issue of the overly stark contrast of the divider color (which
uses the outline color).
node overview: don't throw permission errors on every update
getting the apt update status requires Sys.Modify, but the user does not
necessarily has that. So instead of showing a pop up every 10 seconds,
simply ignore permission errors and only show other exceptions here.
since material 3, the colors are different, and there is no 'muted'
color for the unselected labels anymore. instead use secondary for the
selected, and onPrimary for the unselected ones.
it has proper material 3 styling. For the animations to work correctly,
we have to put the bar outside of the part that we replace when we
navigate though
Thomas Lamprecht [Thu, 11 Apr 2024 09:52:26 +0000 (11:52 +0200)]
url launch: rework launching URL
Switch deprecated launch with launchUrl and move over the try-launch
helper to a new module with a better name.
Add our static links there too for easier access where needed.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Thu, 11 Apr 2024 09:43:13 +0000 (11:43 +0200)]
main layout: replace depreacated WillPopScope with PopScope
We use this to handle back navigation for our bottom navigation
drawer manually, something which we might want to revisit in the
future in general, but for now just replace this with a
non-depreacted variant.
There set canPop to false to disable the auto-pop of the framework
and handle popping then manually.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Thu, 11 Apr 2024 09:18:23 +0000 (11:18 +0200)]
theme: drop checkbox/radiogroup related overrides
they got added automatically by dart fix but actually make it worse
as with that one cannot see the inner check-mark or dot if a
box/radio toggle is checked/on, so just drop that whole thing again.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
- tfa: use number input-type keyboard for TOTP.
- tfa form: avoid glitches where submit button was sometimes
partially off-screen.
- avoid error when trying to submit empty origin via the keyboard's
enter button.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
- build with flutter 3.10
- fix #4749: correctly show lxc rrd data
- saved login: don't give outdated ticket to login form
- tfa: allow closing tfa form without glitchy error
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Thu, 27 Apr 2023 13:07:08 +0000 (15:07 +0200)]
android build: support getting signing key PW from env or a command
One can now specify a command that will be executed to read the
password via it's (whitespace trimmed) stdout output, e.g. for using
the pass[0] toll one would write something like:
```
keyPasswordCommand=pass show work/release/flutter/proxmox-mobile-keystore
```
[0]: https://www.passwordstore.org/
Note, we don't support separate keystore and key passwords anymore
(never used that), but could easily add that again.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
the api changed considerably, so we have to rework how we initialize it:
most is now down in the WebViewController instead of the WebView widget
(which now is WebViewWidget). Cookies can only be set globally in the
WebViewCookieManager. Since this is now async, we have to use a
FutureBuilder to wait for it before returning the WebViewWidget
for this to work, we have to update the kotlin_version, gradle and the
android gradle plugin
(flutter 3.7 supports up to agp 7.4[0], which requires at least gradle 7.5[1]
and IIUC for kotlin 1.7.20 we need at least gradle 7.6[2])
memused/cpu/loadavg don't have to be there if the rrd data does not
go all the way into the past, so instead of using ! to ignore the null
chekc, use a sensible default
if we use '??' to default to a value, there is no need
to access the last property with '.?' since if it's null it falls back
anyway. (this was only a warning from linting)
also if a value cannot be null (because of its type) we don't have
to do an explicit null check (also a warning from linting)
required named parameters cannot have a default, also the @required
has changed to required, so fix that by making 'online' non nullable
and remove the default value (since we give a value everywhere anyway)
Thomas Lamprecht [Wed, 28 Sep 2022 11:05:13 +0000 (13:05 +0200)]
bump version to 1.5.2
for rebuild with current flutter master (basically 3.4 pre-rc) to fix
at least one regression[0] of 3.3 which resulted in crashes with a
stack trace like:
> Exception java.lang.AssertionError: Unexpected metaState 0 for key 0x200000102 during an ACTION_down event.
> at io.flutter.embedding.android.KeyEmbedderResponder.synchronizePressingKey (KeyEmbedderResponder.java)
> at io.flutter.embedding.android.KeyEmbedderResponder.handleEventImpl (KeyEmbedderResponder.java)
> at io.flutter.embedding.android.KeyEmbedderResponder.handleEvent (KeyEmbedderResponder.java)
> at io.flutter.embedding.android.KeyboardManager.handleEvent (KeyboardManager.java)
> at io.flutter.plugin.editing.InputConnectionAdaptor.sendKeyEvent (InputConnectionAdaptor.java)
> at com.android.internal.view.IInputConnectionWrapper.executeMessage (IInputConnectionWrapper.java:704)
> at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage (IInputConnectionWrapper.java:118)
> at android.os.Handler.dispatchMessage (Handler.java:106)
> at android.os.Looper.loopOnce (Looper.java:226)
> at android.os.Looper.loop (Looper.java:313)
> at android.app.ActivityThread.main (ActivityThread.java:8751)
> at java.lang.reflect.Method.invoke (Method.java)
> at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:571)
> at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1135
by default, flutter derives the text selection theme from the global
MaterialApp defined themes primary color, which is problematic in our
case, since we often have the same primary color as background for text
fields. This resulted in the cursorColor/selectionHandleColor to be the
same as the background, making them invisible.
Fix it by creating a manual textSelectionTheme with colors that properly
contrast the background. (The color works well for both light and dark mode)
The selectionHandleColor is modifed with an opacity of 0.4 like flutter
does by default.