Login page content
This commit is contained in:
parent
12ff1e953a
commit
53320d9d0f
6 changed files with 75 additions and 14 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'package:flu_console/flu_console.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:get_storage/get_storage.dart';
|
import 'package:get_storage/get_storage.dart';
|
||||||
|
|
@ -26,7 +27,9 @@ void main() async {
|
||||||
fenix: true,
|
fenix: true,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
FluConsole.run(() {
|
||||||
runApp(const MainApp());
|
runApp(const MainApp());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
class MainApp extends StatelessWidget {
|
class MainApp extends StatelessWidget {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flu_console/flu_console.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
|
import 'package:tuuli_app/api_controller.dart';
|
||||||
|
import 'package:tuuli_app/pages/home_page.dart';
|
||||||
|
|
||||||
class SettingsPanel extends StatefulWidget {
|
class SettingsPanel extends StatefulWidget {
|
||||||
const SettingsPanel({super.key});
|
const SettingsPanel({super.key});
|
||||||
|
|
@ -16,21 +21,53 @@ class _SettingsPanelState extends State<SettingsPanel> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return SingleChildScrollView(
|
|
||||||
child: IntrinsicHeight(
|
|
||||||
child: _buildBody(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildBody() {
|
|
||||||
return Column(
|
return Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
const Text("Current user access token:")
|
||||||
'Settings',
|
.textStyle(Get.textTheme.bodySmall!),
|
||||||
style: Theme.of(context).textTheme.headlineSmall,
|
[
|
||||||
),
|
Text(ApiController.to.token)
|
||||||
],
|
.textStyle(Get.textTheme.titleSmall!)
|
||||||
|
.expanded(),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () async {
|
||||||
|
await Clipboard.setData(
|
||||||
|
ClipboardData(text: ApiController.to.token),
|
||||||
);
|
);
|
||||||
|
Get.snackbar(
|
||||||
|
"Copied",
|
||||||
|
"Token copied to clipboard",
|
||||||
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.copy),
|
||||||
|
),
|
||||||
|
].toRow(),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
[
|
||||||
|
TextFormField(
|
||||||
|
enabled: false,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
labelText: 'Endpoint',
|
||||||
|
hintText: 'Enter Tuuli Endpoint',
|
||||||
|
),
|
||||||
|
initialValue: ApiController.to.endPoint,
|
||||||
|
).expanded(),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () => Get.find<HomePageController>().logout(),
|
||||||
|
child: const Text("Logout to change"),
|
||||||
|
)
|
||||||
|
].toRow(),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
[
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () => Get.bottomSheet(const LogPrintPanel()),
|
||||||
|
child: const Text("Show app logs"),
|
||||||
|
).expanded(),
|
||||||
|
].toRow(),
|
||||||
|
],
|
||||||
|
).paddingAll(8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
16
pubspec.lock
16
pubspec.lock
|
|
@ -305,6 +305,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.1.0"
|
||||||
|
flu_console:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flu_console
|
||||||
|
sha256: a6d9c70366fffd69c69f486677f86ec290dd72ca7cb1110271d6ddeda51ca769
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.0.1"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|
@ -472,6 +480,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "2.0.1"
|
||||||
|
logger:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: logger
|
||||||
|
sha256: db2ff852ed77090ba9f62d3611e4208a3d11dfa35991a81ae724c113fcb3e3f7
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.3.0"
|
||||||
logging:
|
logging:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ dependencies:
|
||||||
data_table_2: ^2.4.2
|
data_table_2: ^2.4.2
|
||||||
dio: ^5.1.1
|
dio: ^5.1.1
|
||||||
file_icon: ^1.0.0
|
file_icon: ^1.0.0
|
||||||
|
flu_console: ^0.0.1
|
||||||
flutter_chips_input: ^2.0.0
|
flutter_chips_input: ^2.0.0
|
||||||
flutter_fast_forms: ^10.0.0
|
flutter_fast_forms: ^10.0.0
|
||||||
get: ^4.6.5
|
get: ^4.6.5
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,15 @@
|
||||||
#include "generated_plugin_registrant.h"
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
#include <audioplayers_windows/audioplayers_windows_plugin.h>
|
#include <audioplayers_windows/audioplayers_windows_plugin.h>
|
||||||
|
#include <flu_console/flu_console_plugin_c_api.h>
|
||||||
#include <irondash_engine_context/irondash_engine_context_plugin_c_api.h>
|
#include <irondash_engine_context/irondash_engine_context_plugin_c_api.h>
|
||||||
#include <super_native_extensions/super_native_extensions_plugin_c_api.h>
|
#include <super_native_extensions/super_native_extensions_plugin_c_api.h>
|
||||||
|
|
||||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
AudioplayersWindowsPluginRegisterWithRegistrar(
|
AudioplayersWindowsPluginRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("AudioplayersWindowsPlugin"));
|
registry->GetRegistrarForPlugin("AudioplayersWindowsPlugin"));
|
||||||
|
FluConsolePluginCApiRegisterWithRegistrar(
|
||||||
|
registry->GetRegistrarForPlugin("FluConsolePluginCApi"));
|
||||||
IrondashEngineContextPluginCApiRegisterWithRegistrar(
|
IrondashEngineContextPluginCApiRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("IrondashEngineContextPluginCApi"));
|
registry->GetRegistrarForPlugin("IrondashEngineContextPluginCApi"));
|
||||||
SuperNativeExtensionsPluginCApiRegisterWithRegistrar(
|
SuperNativeExtensionsPluginCApiRegisterWithRegistrar(
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
audioplayers_windows
|
audioplayers_windows
|
||||||
|
flu_console
|
||||||
irondash_engine_context
|
irondash_engine_context
|
||||||
super_native_extensions
|
super_native_extensions
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue