Login page content
This commit is contained in:
parent
12ff1e953a
commit
53320d9d0f
6 changed files with 75 additions and 14 deletions
|
|
@ -1,5 +1,10 @@
|
|||
import 'package:flutter/services.dart';
|
||||
import 'package:flu_console/flu_console.dart';
|
||||
import 'package:flutter/material.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 {
|
||||
const SettingsPanel({super.key});
|
||||
|
|
@ -16,21 +21,53 @@ class _SettingsPanelState extends State<SettingsPanel> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
child: IntrinsicHeight(
|
||||
child: _buildBody(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBody() {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Settings',
|
||||
style: Theme.of(context).textTheme.headlineSmall,
|
||||
),
|
||||
const Text("Current user access token:")
|
||||
.textStyle(Get.textTheme.bodySmall!),
|
||||
[
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue