Skip to content

Commit

Permalink
💾 Feat: Optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
Dynesshely committed Apr 11, 2024
1 parent 4b62aed commit be5a91a
Show file tree
Hide file tree
Showing 19 changed files with 417 additions and 375 deletions.
74 changes: 46 additions & 28 deletions KitX Website Flutter/kitx_website/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,47 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
# include: package:flutter_lints/flutter.yaml

analyzer:
errors:
avoid_returning_null_for_future: warning
cancel_subscriptions: warning
dead_code: warning
# override_on_non_overriding_method: warning
unused_element: warning
unused_import: warning
avoid_empty_else: warning
exclude:
- test/**
- lib/models/**
language:
strict-casts: true
linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
avoid_print: false # Uncomment to disable the `avoid_print` rule
prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
rules:
- always_use_package_imports
- camel_case_types
- library_names
- library_prefixes
- file_names
- package_names
- non_constant_identifier_names
- constant_identifier_names
- sort_pub_dependencies
- directives_ordering
- curly_braces_in_flow_control_structures
- slash_for_doc_comments
- package_api_docs
# - public_member_api_docs
- comment_references
- prefer_adjacent_string_concatenation
- prefer_interpolation_to_compose_strings
- unnecessary_brace_in_string_interps
- prefer_collection_literals
- prefer_is_empty
- prefer_is_not_empty
- prefer_for_elements_to_map_fromIterable
- avoid_function_literals_in_foreach_calls
# - prefer_equal_for_default_values
- avoid_init_to_null
- unnecessary_getters_setters
- unnecessary_this
- prefer_initializing_formals
- unnecessary_new
- unnecessary_await_in_return
- avoid_void_async
13 changes: 6 additions & 7 deletions KitX Website Flutter/kitx_website/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'package:kitx_website/pages/navigation_page.dart';

import 'package:kitx_website/themes/light_theme.dart';
import 'package:kitx_website/themes/dark_theme.dart';

import 'package:kitx_website/themes/light_theme.dart';
import 'package:kitx_website/utils/global.dart';
import 'package:kitx_website/utils/translations.dart';
import 'package:kitx_website/utils/translation/translations.dart';

Future<void> main() async {
await Global.init();
WidgetsFlutterBinding.ensureInitialized();

await app.init();

runApp(MainApp());
}
Expand All @@ -22,7 +21,7 @@ class MainApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ValueListenableBuilder<ThemeMode>(
valueListenable: Global.themeNotifier,
valueListenable: app.themeNotifier,
builder: (context, mode, _) => GetMaterialApp(
title: 'KitX Website',
themeMode: mode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var tileRadius = ContinuousRectangleBorder(borderRadius: BorderRadius.circular(10.0));

Widget ListTileItem({
Widget listTileItem({
bool? enabled,
String? title,
String? subTitle,
Expand All @@ -15,21 +15,21 @@ Widget ListTileItem({
enabled: enabled ?? true,
title: Text(title!),
subtitle: Text(subTitle!),
shape: shape,
shape: shape ?? tileRadius,
leading: leading,
trailing: trailing,
onTap: onTap,
);
}

Widget StandardPlatformItem({
Widget standardPlatformItem({
bool? enabled,
String? title,
String? subTitle,
Widget? leading,
void Function()? onTap,
}) {
return ListTileItem(
return listTileItem(
enabled: enabled ?? true,
title: title,
subTitle: subTitle,
Expand All @@ -40,14 +40,14 @@ Widget StandardPlatformItem({
);
}

Widget StandardDownloadItem({
Widget standardDownloadItem({
bool? enabled,
String? title,
String? subTitle,
Widget? trailing,
void Function()? onTap,
}) {
return ListTileItem(
return listTileItem(
enabled: enabled ?? true,
title: title,
subTitle: subTitle,
Expand Down
Loading

0 comments on commit be5a91a

Please sign in to comment.