Major Change Inputs & Co

This commit is contained in:
mr
2025-02-04 17:02:49 +01:00
parent 2c86e90b76
commit 05854c84d8
43 changed files with 2837 additions and 1809 deletions

View File

@@ -4,6 +4,7 @@ import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:go_router/go_router.dart';
import 'package:oc_front/core/services/auth.service.dart';
import 'package:oc_front/main.dart';
import 'package:oc_front/pages/workflow.dart';
class LoginWidget extends StatefulWidget {
LoginWidget ({ Key? key }): super(key: key);
@@ -30,26 +31,32 @@ class LoginWidgetState extends State<LoginWidget> {
loading = false;
error = "Invalid username or password";
});
}).then( (e) {
if (error == null) {
// ignore: use_build_context_synchronously
setState(() {
loading = false;
});
loginIsSet = false;
dash.inDialog = false;
context.pop();
mainKey?.currentState?.setState(() {});
}
});
if (error == null) {
// ignore: use_build_context_synchronously
setState(() {
loading = false;
});
context.pop();
}
}
},
child: Padding(
padding: const EdgeInsets.all(50), child: Column(mainAxisSize: MainAxisSize.min, children: [
const Center(child: Icon(Icons.person_search, size: 150, color: Colors.grey,)),
child: Container( padding: const EdgeInsets.all(50), child: Column(children: [
getMainHeight(context) < 600 ? Container() : SizedBox( width: getMainWidth(context) / 4, height: getMainHeight(context) / 4,
child: FittedBox(
child:const Center(child: Icon(Icons.person_search, size: 150, color: Colors.grey,)))),
Center(child: Padding( padding: const EdgeInsets.only(top: 5, bottom: 20),
child: Text("WELCOME ON OPENCLOUD", style: TextStyle(fontSize: 25, fontWeight: FontWeight.w600,
color: lightColor ) ))),
Container( margin: const EdgeInsets.only(bottom: 10), child: Center(child: Row( mainAxisAlignment: MainAxisAlignment.center,
color: lightColor ), overflow: TextOverflow.ellipsis, ))),
Container( margin: const EdgeInsets.only(bottom: 10),
child: Center(child: Row( mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: getMainWidth(context) / 3,
width: MediaQuery.of(context).size.width / 3,
alignment : Alignment.center,
child: TextField(
controller: usernameCtrl,
@@ -69,7 +76,7 @@ class LoginWidgetState extends State<LoginWidget> {
Center(child: Row( mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: getMainWidth(context) / 3,
width: MediaQuery.of(context).size.width / 3,
alignment : Alignment.center,
child: TextField(
controller: passwordCtrl,
@@ -105,20 +112,22 @@ class LoginWidgetState extends State<LoginWidget> {
loading = false;
error = "Invalid username or password";
});
}).then( (e) {
if (error == null) {
// ignore: use_build_context_synchronously
setState(() {
loading = false;
});
loginIsSet = false;
dash.inDialog = false;
context.pop();
mainKey?.currentState?.setState(() {});
}
});
if (error == null) {
// ignore: use_build_context_synchronously
setState(() {
loading = true;
});
context.pop();
//mainKey?.currentState!.setState(() {});
}
},
mouseCursor: SystemMouseCursors.click,
child: Container(
width: getMainWidth(context) / 3,
width: MediaQuery.of(context).size.width / 3,
padding: const EdgeInsets.symmetric(vertical: 20),
color: usernameCtrl.text == "" || passwordCtrl.text == "" ? Colors.grey : lightColor,
child: Center( child: loading ? SpinKitWave(color: Colors.white, size: 20) : Text("LOGIN", style: TextStyle(

View File

@@ -3,9 +3,11 @@ import 'package:oc_front/main.dart';
import 'package:oc_front/models/response.dart';
import 'package:oc_front/core/services/router.dart';
import 'package:oc_front/pages/shared.dart';
import 'package:oc_front/pages/workflow.dart';
import 'package:oc_front/widgets/inputs/shallow_dropdown_input.dart';
import 'package:oc_front/widgets/inputs/shallow_text_input.dart';
// ignore: must_be_immutable
class ShallowCreationDialogWidget extends StatefulWidget {
GlobalKey<ShallowTextInputWidgetState>? formKey;
BuildContext context;
@@ -43,6 +45,7 @@ class ShallowCreationDialogState extends State<ShallowCreationDialogWidget> {
Tooltip( message: "back", child: InkWell(
mouseCursor: SystemMouseCursors.click,
onTap: () {
dash.inDialog = false;
AppRouter.catalog.go(context, {});
},
child: const Icon(Icons.arrow_back, color: Colors.black))),
@@ -50,7 +53,10 @@ class ShallowCreationDialogState extends State<ShallowCreationDialogWidget> {
widget.canClose != null && !widget.canClose!() ? Container() : Row ( mainAxisAlignment: MainAxisAlignment.end, children: [
Tooltip( message: "close", child: InkWell(
mouseCursor: SystemMouseCursors.click,
onTap: () { Navigator.pop(context); },
onTap: () {
dash.inDialog = false;
Navigator.pop(context);
},
child: const Icon(Icons.close, color: Colors.black))),
]),
],),
@@ -62,6 +68,7 @@ class ShallowCreationDialogState extends State<ShallowCreationDialogWidget> {
width: getMainWidth(context) <= 540 ? getMainWidth(context) - 140 : 400,
load: (e) async {
await widget.load!(e);
dash.inDialog = false;
Navigator.pop(widget.context);
},
iconLoad: Icons.open_in_browser_outlined,
@@ -83,6 +90,7 @@ class ShallowCreationDialogState extends State<ShallowCreationDialogWidget> {
width: getMainWidth(context) <= 540 ? getMainWidth(context) - 140 : 400,
load: (e) async {
await widget.create!(e);
dash.inDialog = false;
Navigator.pop(widget.context);
},
forms: widget.form,