mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-12 02:05:29 +00:00
More linting work
This commit is contained in:
@ -1,22 +1,22 @@
|
||||
import 'package:inventree/api.dart';
|
||||
import 'package:inventree/app_colors.dart';
|
||||
import 'package:inventree/settings/release.dart';
|
||||
import "package:inventree/api.dart";
|
||||
import "package:inventree/app_colors.dart";
|
||||
import "package:inventree/settings/release.dart";
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import "package:flutter/cupertino.dart";
|
||||
import "package:flutter/material.dart";
|
||||
import "package:flutter/services.dart";
|
||||
import "package:font_awesome_flutter/font_awesome_flutter.dart";
|
||||
import "package:package_info_plus/package_info_plus.dart";
|
||||
|
||||
import 'package:inventree/l10.dart';
|
||||
import "package:inventree/l10.dart";
|
||||
|
||||
class InvenTreeAboutWidget extends StatelessWidget {
|
||||
|
||||
final PackageInfo info;
|
||||
|
||||
InvenTreeAboutWidget(this.info) : super();
|
||||
const InvenTreeAboutWidget(this.info) : super();
|
||||
|
||||
void _releaseNotes(BuildContext context) async {
|
||||
Future <void> _releaseNotes(BuildContext context) async {
|
||||
|
||||
// Load release notes from external file
|
||||
String notes = await rootBundle.loadString("assets/release_notes.md");
|
||||
@ -27,7 +27,7 @@ class InvenTreeAboutWidget extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
void _credits(BuildContext context) async {
|
||||
Future <void> _credits(BuildContext context) async {
|
||||
|
||||
String notes = await rootBundle.loadString("assets/credits.md");
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import "package:flutter/material.dart";
|
||||
import "package:flutter/cupertino.dart";
|
||||
|
||||
import 'package:inventree/l10.dart';
|
||||
import "package:inventree/l10.dart";
|
||||
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import "package:font_awesome_flutter/font_awesome_flutter.dart";
|
||||
|
||||
import 'package:inventree/app_settings.dart';
|
||||
import "package:inventree/app_settings.dart";
|
||||
|
||||
class InvenTreeAppSettingsWidget extends StatefulWidget {
|
||||
@override
|
||||
@ -31,7 +31,7 @@ class _InvenTreeAppSettingsState extends State<InvenTreeAppSettingsWidget> {
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
void loadSettings() async {
|
||||
Future <void> loadSettings() async {
|
||||
barcodeSounds = await InvenTreeSettingsManager().getValue("barcodeSounds", true) as bool;
|
||||
serverSounds = await InvenTreeSettingsManager().getValue("serverSounds", true) as bool;
|
||||
|
||||
@ -42,7 +42,7 @@ class _InvenTreeAppSettingsState extends State<InvenTreeAppSettingsWidget> {
|
||||
});
|
||||
}
|
||||
|
||||
void setBarcodeSounds(bool en) async {
|
||||
Future <void> setBarcodeSounds(bool en) async {
|
||||
|
||||
await InvenTreeSettingsManager().setValue("barcodeSounds", en);
|
||||
barcodeSounds = await InvenTreeSettingsManager().getBool("barcodeSounds", true);
|
||||
@ -51,7 +51,7 @@ class _InvenTreeAppSettingsState extends State<InvenTreeAppSettingsWidget> {
|
||||
});
|
||||
}
|
||||
|
||||
void setServerSounds(bool en) async {
|
||||
Future <void> setServerSounds(bool en) async {
|
||||
|
||||
await InvenTreeSettingsManager().setValue("serverSounds", en);
|
||||
serverSounds = await InvenTreeSettingsManager().getBool("serverSounds", true);
|
||||
@ -60,7 +60,7 @@ class _InvenTreeAppSettingsState extends State<InvenTreeAppSettingsWidget> {
|
||||
});
|
||||
}
|
||||
|
||||
void setPartSubcategory(bool en) async {
|
||||
Future <void> setPartSubcategory(bool en) async {
|
||||
await InvenTreeSettingsManager().setValue("partSubcategory", en);
|
||||
partSubcategory = await InvenTreeSettingsManager().getBool("partSubcategory", true);
|
||||
|
||||
@ -68,7 +68,7 @@ class _InvenTreeAppSettingsState extends State<InvenTreeAppSettingsWidget> {
|
||||
});
|
||||
}
|
||||
|
||||
void setStockSublocation(bool en) async {
|
||||
Future <void> setStockSublocation(bool en) async {
|
||||
await InvenTreeSettingsManager().setValue("stockSublocation", en);
|
||||
stockSublocation = await InvenTreeSettingsManager().getBool("stockSublocation", true);
|
||||
|
||||
|
@ -1,15 +1,12 @@
|
||||
import 'package:inventree/app_colors.dart';
|
||||
import 'package:inventree/widget/dialogs.dart';
|
||||
import 'package:inventree/widget/fields.dart';
|
||||
import 'package:inventree/widget/spinner.dart';
|
||||
import "package:flutter/material.dart";
|
||||
import "package:font_awesome_flutter/font_awesome_flutter.dart";
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
import 'package:inventree/l10.dart';
|
||||
|
||||
import '../api.dart';
|
||||
import '../user_profile.dart';
|
||||
import "package:inventree/app_colors.dart";
|
||||
import "package:inventree/widget/dialogs.dart";
|
||||
import "package:inventree/widget/spinner.dart";
|
||||
import "package:inventree/l10.dart";
|
||||
import "package:inventree/api.dart";
|
||||
import "package:inventree/user_profile.dart";
|
||||
|
||||
class InvenTreeLoginSettingsWidget extends StatefulWidget {
|
||||
|
||||
@ -22,15 +19,13 @@ class _InvenTreeLoginSettingsState extends State<InvenTreeLoginSettingsWidget> {
|
||||
|
||||
final GlobalKey<_InvenTreeLoginSettingsState> _loginKey = GlobalKey<_InvenTreeLoginSettingsState>();
|
||||
|
||||
final GlobalKey<FormState> _addProfileKey = new GlobalKey<FormState>();
|
||||
|
||||
List<UserProfile> profiles = [];
|
||||
|
||||
_InvenTreeLoginSettingsState() {
|
||||
_reload();
|
||||
}
|
||||
|
||||
void _reload() async {
|
||||
Future <void> _reload() async {
|
||||
|
||||
profiles = await UserProfileDBManager().getAllProfiles();
|
||||
|
||||
@ -50,7 +45,7 @@ class _InvenTreeLoginSettingsState extends State<InvenTreeLoginSettingsWidget> {
|
||||
});
|
||||
}
|
||||
|
||||
void _selectProfile(BuildContext context, UserProfile profile) async {
|
||||
Future <void> _selectProfile(BuildContext context, UserProfile profile) async {
|
||||
|
||||
// Disconnect InvenTree
|
||||
InvenTreeAPI().disconnectFromServer();
|
||||
@ -73,18 +68,18 @@ class _InvenTreeLoginSettingsState extends State<InvenTreeLoginSettingsWidget> {
|
||||
_reload();
|
||||
}
|
||||
|
||||
void _deleteProfile(UserProfile profile) async {
|
||||
Future <void> _deleteProfile(UserProfile profile) async {
|
||||
|
||||
await UserProfileDBManager().deleteProfile(profile);
|
||||
|
||||
_reload();
|
||||
|
||||
if (InvenTreeAPI().isConnected() && profile.key == (InvenTreeAPI().profile?.key ?? '')) {
|
||||
if (InvenTreeAPI().isConnected() && profile.key == (InvenTreeAPI().profile?.key ?? "")) {
|
||||
InvenTreeAPI().disconnectFromServer();
|
||||
}
|
||||
}
|
||||
|
||||
void _updateProfile(UserProfile? profile) async {
|
||||
Future <void> _updateProfile(UserProfile? profile) async {
|
||||
|
||||
if (profile == null) {
|
||||
return;
|
||||
@ -92,7 +87,7 @@ class _InvenTreeLoginSettingsState extends State<InvenTreeLoginSettingsWidget> {
|
||||
|
||||
_reload();
|
||||
|
||||
if (InvenTreeAPI().isConnected() && InvenTreeAPI().profile != null && profile.key == (InvenTreeAPI().profile?.key ?? '')) {
|
||||
if (InvenTreeAPI().isConnected() && InvenTreeAPI().profile != null && profile.key == (InvenTreeAPI().profile?.key ?? "")) {
|
||||
// Attempt server login (this will load the newly selected profile
|
||||
|
||||
InvenTreeAPI().connectToServer().then((result) {
|
||||
@ -108,7 +103,7 @@ class _InvenTreeLoginSettingsState extends State<InvenTreeLoginSettingsWidget> {
|
||||
if (!profile.selected) return null;
|
||||
|
||||
// Selected, but (for some reason) not the same as the API...
|
||||
if ((InvenTreeAPI().profile?.key ?? '') != profile.key) {
|
||||
if ((InvenTreeAPI().profile?.key ?? "") != profile.key) {
|
||||
return FaIcon(
|
||||
FontAwesomeIcons.questionCircle,
|
||||
color: COLOR_WARNING
|
||||
|
@ -1,14 +1,14 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
import 'package:inventree/l10.dart';
|
||||
import "package:flutter/cupertino.dart";
|
||||
import "package:flutter/material.dart";
|
||||
import "package:flutter_markdown/flutter_markdown.dart";
|
||||
import "package:inventree/l10.dart";
|
||||
|
||||
|
||||
class ReleaseNotesWidget extends StatelessWidget {
|
||||
|
||||
final String releaseNotes;
|
||||
|
||||
ReleaseNotesWidget(this.releaseNotes);
|
||||
const ReleaseNotesWidget(this.releaseNotes);
|
||||
|
||||
@override
|
||||
Widget build (BuildContext context) {
|
||||
@ -29,7 +29,7 @@ class CreditsWidget extends StatelessWidget {
|
||||
|
||||
final String credits;
|
||||
|
||||
CreditsWidget(this.credits);
|
||||
const CreditsWidget(this.credits);
|
||||
|
||||
@override
|
||||
Widget build (BuildContext context) {
|
||||
|
@ -1,18 +1,16 @@
|
||||
import 'package:inventree/app_colors.dart';
|
||||
import 'package:inventree/settings/about.dart';
|
||||
import 'package:inventree/settings/app_settings.dart';
|
||||
import 'package:inventree/settings/login.dart';
|
||||
import "package:inventree/app_colors.dart";
|
||||
import "package:inventree/settings/about.dart";
|
||||
import "package:inventree/settings/app_settings.dart";
|
||||
import "package:inventree/settings/login.dart";
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:inventree/l10.dart';
|
||||
import 'package:inventree/widget/submit_feedback.dart';
|
||||
import "package:flutter/material.dart";
|
||||
import "package:font_awesome_flutter/font_awesome_flutter.dart";
|
||||
import "package:inventree/l10.dart";
|
||||
import "package:inventree/widget/submit_feedback.dart";
|
||||
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import "package:url_launcher/url_launcher.dart";
|
||||
|
||||
import 'login.dart';
|
||||
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import "package:package_info_plus/package_info_plus.dart";
|
||||
|
||||
class InvenTreeSettingsWidget extends StatefulWidget {
|
||||
// InvenTree settings view
|
||||
@ -95,30 +93,30 @@ class _InvenTreeSettingsState extends State<InvenTreeSettingsWidget> {
|
||||
}
|
||||
|
||||
|
||||
void _openDocs() async {
|
||||
Future <void> _openDocs() async {
|
||||
if (await canLaunch(docsUrl)) {
|
||||
await launch(docsUrl);
|
||||
}
|
||||
}
|
||||
|
||||
void _translate() async {
|
||||
final String url = "https://crowdin.com/project/inventree";
|
||||
Future <void> _translate() async {
|
||||
const String url = "https://crowdin.com/project/inventree";
|
||||
|
||||
if (await canLaunch(url)) {
|
||||
await launch(url);
|
||||
}
|
||||
}
|
||||
|
||||
void _editServerSettings() async {
|
||||
Future <void> _editServerSettings() async {
|
||||
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) => InvenTreeLoginSettingsWidget()));
|
||||
}
|
||||
|
||||
void _editAppSettings() async {
|
||||
Future <void> _editAppSettings() async {
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) => InvenTreeAppSettingsWidget()));
|
||||
}
|
||||
|
||||
void _about() async {
|
||||
Future <void> _about() async {
|
||||
|
||||
PackageInfo.fromPlatform().then((PackageInfo info) {
|
||||
Navigator.push(context,
|
||||
@ -126,7 +124,7 @@ class _InvenTreeSettingsState extends State<InvenTreeSettingsWidget> {
|
||||
});
|
||||
}
|
||||
|
||||
void _submitFeedback(BuildContext context) async {
|
||||
Future <void> _submitFeedback(BuildContext context) async {
|
||||
|
||||
Navigator.push(
|
||||
context,
|
||||
|
Reference in New Issue
Block a user