Add Google calendar API and workspace sync
This commit is contained in:
@@ -1005,6 +1005,7 @@ class JarvisSettingsDialog extends StatefulWidget {
|
||||
class _JarvisSettingsDialogState extends State<JarvisSettingsDialog> {
|
||||
late final TextEditingController apiUrl;
|
||||
late final TextEditingController apiToken;
|
||||
late final TextEditingController workspaceToken;
|
||||
late final TextEditingController deviceName;
|
||||
late JarvisSettings currentSettings;
|
||||
bool registering = false;
|
||||
@@ -1017,6 +1018,9 @@ class _JarvisSettingsDialogState extends State<JarvisSettingsDialog> {
|
||||
currentSettings = widget.settings;
|
||||
apiUrl = TextEditingController(text: currentSettings.apiUrl);
|
||||
apiToken = TextEditingController(text: currentSettings.apiToken);
|
||||
workspaceToken = TextEditingController(
|
||||
text: currentSettings.workspaceToken ?? '',
|
||||
);
|
||||
deviceName = TextEditingController(
|
||||
text: currentSettings.deviceName ?? 'Family tablet',
|
||||
);
|
||||
@@ -1026,6 +1030,7 @@ class _JarvisSettingsDialogState extends State<JarvisSettingsDialog> {
|
||||
void dispose() {
|
||||
apiUrl.dispose();
|
||||
apiToken.dispose();
|
||||
workspaceToken.dispose();
|
||||
deviceName.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
@@ -1033,6 +1038,9 @@ class _JarvisSettingsDialogState extends State<JarvisSettingsDialog> {
|
||||
JarvisSettings get draft => currentSettings.copyWith(
|
||||
apiUrl: normalizeJarvisUrl(apiUrl.text),
|
||||
apiToken: apiToken.text.trim(),
|
||||
workspaceToken: workspaceToken.text.trim().isEmpty
|
||||
? null
|
||||
: workspaceToken.text.trim(),
|
||||
);
|
||||
|
||||
@override
|
||||
@@ -1074,6 +1082,18 @@ class _JarvisSettingsDialogState extends State<JarvisSettingsDialog> {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
TextField(
|
||||
controller: workspaceToken,
|
||||
obscureText: true,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'K\u00f6z\u00f6s munkat\u00e9r token',
|
||||
hintText:
|
||||
'Ugyanez ker\u00fclj\u00f6n minden csal\u00e1di eszk\u00f6zre',
|
||||
helperText:
|
||||
'Ezzel l\u00e1tja t\u00f6bb app ugyanazt a csal\u00e1dot, k\u00e9szletet \u00e9s bev\u00e1s\u00e1rl\u00f3list\u00e1t.',
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
TextField(
|
||||
controller: deviceName,
|
||||
decoration: const InputDecoration(
|
||||
|
||||
Reference in New Issue
Block a user