Skip to content

Commit

Permalink
Modernize project
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Apr 23, 2024
1 parent c589061 commit c91fabd
Show file tree
Hide file tree
Showing 17 changed files with 7,377 additions and 6,002 deletions.
212 changes: 157 additions & 55 deletions .github/workflows/build.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
flutter analyze --fatal-infos
- name: Run build_runner
if: matrix.projects != 'tools'
run: flutter pub run build_runner build --delete-conflicting-outputs
run: dart run build_runner build --delete-conflicting-outputs
- name: Test for git changes
run: git diff --exit-code
# Your project will need to have tests in test/ and a dependency on
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/documentation.yml

This file was deleted.

2 changes: 1 addition & 1 deletion FLUTTER_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.19.3
3.19.6
10 changes: 5 additions & 5 deletions api/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ environment:
sdk: '>=2.17.0 <3.0.0'

dependencies:
meta: ^1.9.1
meta: ^1.11.0
equatable: ^2.0.5
sqflite_common: ^2.5.0+2
sqflite_common: ^2.5.4
freezed_annotation: ^2.4.1
json_annotation: ^4.8.1
collection: ^1.17.2
Expand All @@ -20,8 +20,8 @@ dependencies:
ref: 992f8062618ef1e78ee92efc7a709eb0d476e1d0
path: packages/dart_leap
dev_dependencies:
build_runner: ^2.4.8
freezed: ^2.4.7
build_runner: ^2.4.9
freezed: ^2.5.2
json_serializable: ^6.7.0
lints: ^3.0.0
test: ^1.25.0
test: ^1.25.4
4 changes: 2 additions & 2 deletions app/lib/api/storage/sources.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class SourcesService {
if (mode == SyncMode.always) {
return true;
}
return await Connectivity().checkConnectivity() !=
ConnectivityResult.mobile;
return !(await Connectivity().checkConnectivity())
.contains(ConnectivityResult.mobile);
}

Future<void> setup() async {
Expand Down
3 changes: 2 additions & 1 deletion app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -292,5 +292,6 @@
"compact": "Compact",
"comfortable": "Comfortable",
"standard": "Standard",
"highContrast": "High contrast"
"highContrast": "High contrast",
"systemLocale": "System locale"
}
18 changes: 9 additions & 9 deletions app/lib/pages/settings/contents/personalization.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import 'package:window_manager/window_manager.dart';
class PersonalizationSettingsView extends StatelessWidget {
const PersonalizationSettingsView({super.key});

String _getLocalizedName(BuildContext context, String name) {
return LocaleNames.of(context)?.nameOf(name) ??
AppLocalizations.of(context).systemDefault;
}
String _getLocaleName(BuildContext context, String locale) => locale
.isNotEmpty
? LocaleNames.of(context)?.nameOf(locale.replaceAll('-', '_')) ?? locale
: AppLocalizations.of(context).systemLocale;

String _getDensityName(BuildContext context, ThemeDensity density) =>
switch (density) {
Expand Down Expand Up @@ -57,8 +57,8 @@ class PersonalizationSettingsView extends StatelessWidget {
title: AppLocalizations.of(context).design,
childrenBuilder: (context) => [
ListTile(
title:
Text(AppLocalizations.of(context).classic),
title: Text(
AppLocalizations.of(context).systemDefault),
leading:
_ThemeBox(theme: getThemeData('', false)),
onTap: () => Navigator.pop(context, ''),
Expand Down Expand Up @@ -108,7 +108,7 @@ class PersonalizationSettingsView extends StatelessWidget {
ListTile(
title: Text(AppLocalizations.of(context).language),
leading: const PhosphorIcon(PhosphorIconsLight.translate),
subtitle: Text(_getLocalizedName(context, state.locale)),
subtitle: Text(_getLocaleName(context, state.locale)),
onTap: () async {
final cubit = context.read<SettingsCubit>();

Expand All @@ -117,7 +117,7 @@ class PersonalizationSettingsView extends StatelessWidget {
title: AppLocalizations.of(context).language,
childrenBuilder: (context) => [
ListTile(
title: Text(_getLocalizedName(context, '')),
title: Text(_getLocaleName(context, '')),
selected: state.locale.isEmpty,
onTap: () {
Navigator.of(context).pop('');
Expand All @@ -126,7 +126,7 @@ class PersonalizationSettingsView extends StatelessWidget {
...AppLocalizations.supportedLocales
.map((e) => e.toString())
.map((e) => ListTile(
title: Text(_getLocalizedName(context, e)),
title: Text(_getLocaleName(context, e)),
selected: state.locale == e,
onTap: () {
Navigator.of(context).pop(e);
Expand Down
2 changes: 1 addition & 1 deletion app/lib/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ FlexSchemeColor getFlexThemeColor(String name, bool dark) {
}

List<String> getThemes() {
return FlexColor.schemesList.map((e) => e.name).toList();
return ['classic', ...FlexColor.schemesList.map((e) => e.name)];
}
2 changes: 1 addition & 1 deletion app/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import url_launcher_macos
import window_manager

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin"))
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
Expand Down
Loading

0 comments on commit c91fabd

Please sign in to comment.