fixed warnings (super.key, etc)

This commit is contained in:
Kima
2023-12-12 22:57:16 +01:00
parent fc3f538e6b
commit 6bac82f7d6
46 changed files with 349 additions and 228 deletions

View File

@@ -14,15 +14,15 @@ import 'package:flutter/services.dart';
import 'login_screen.i18n.dart';
class LoginScreen extends StatefulWidget {
const LoginScreen({Key? key, this.back = false}) : super(key: key);
const LoginScreen({super.key, this.back = false});
final bool back;
@override
_LoginScreenState createState() => _LoginScreenState();
LoginScreenState createState() => LoginScreenState();
}
class _LoginScreenState extends State<LoginScreen> {
class LoginScreenState extends State<LoginScreen> {
final usernameController = TextEditingController();
final passwordController = TextEditingController();
final schoolController = SchoolInputController();
@@ -109,15 +109,19 @@ class _LoginScreenState extends State<LoginScreen> {
child: ClipRect(
child: Container(
// Png shadow *hack*
width: MediaQuery.of(context).size.width / 4,
margin: const EdgeInsets.only(
left: 12.0, right: 12.0, bottom: 12.0),
// Png shadow *hack*
child: Stack(
children: [
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Opacity(
opacity: 0.3,
child: Image.asset(
"assets/icons/ic_splash.png",
color: Colors.black),
opacity: 0.3),
color: Colors.black)),
),
BackdropFilter(
filter:
@@ -126,9 +130,6 @@ class _LoginScreenState extends State<LoginScreen> {
)
],
),
width: MediaQuery.of(context).size.width / 4,
margin: const EdgeInsets.only(
left: 12.0, right: 12.0, bottom: 12.0),
),
),
),
@@ -246,6 +247,14 @@ class _LoginScreenState extends State<LoginScreen> {
Padding(
padding: const EdgeInsets.only(top: 42.0),
child: Visibility(
visible: _loginState != LoginState.inProgress,
replacement: const Padding(
padding: EdgeInsets.symmetric(vertical: 6.0),
child: CircularProgressIndicator(
valueColor:
AlwaysStoppedAnimation<Color>(Colors.white),
),
),
child: LoginButton(
child: Text("login".i18n,
maxLines: 1,
@@ -255,14 +264,6 @@ class _LoginScreenState extends State<LoginScreen> {
)),
onPressed: () => _loginAPI(context: context),
),
visible: _loginState != LoginState.inProgress,
replacement: const Padding(
padding: EdgeInsets.symmetric(vertical: 6.0),
child: CircularProgressIndicator(
valueColor:
AlwaysStoppedAnimation<Color>(Colors.white),
),
),
),
),
if (_loginState == LoginState.missingFields ||
@@ -306,6 +307,7 @@ class _LoginScreenState extends State<LoginScreen> {
return setState(() => _loginState = LoginState.missingFields);
}
// ignore: no_leading_underscores_for_local_identifiers
void _callAPI() {
loginAPI(
username: username,