Skip to content

Commit

Permalink
full ui rework, configurable path, archive old code
Browse files Browse the repository at this point in the history
  • Loading branch information
Pebkac03 committed Aug 7, 2024
1 parent d893db4 commit cc9965c
Show file tree
Hide file tree
Showing 45 changed files with 991 additions and 235 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
"*.dart": "${capture}.mobile.dart, ${capture}.tablet.dart, ${capture}.desktop.dart, ${capture}.form.dart, ${capture}.g.dart, ${capture}.freezed.dart, ${capture}.logger.dart, ${capture}.locator.dart, ${capture}.router.dart, ${capture}.dialogs.dart, ${capture}.bottomsheets.dart"
}
},
"cmake.configureOnOpen": false
}

12 changes: 7 additions & 5 deletions lib/app/app.dart
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import 'package:espanso_gui_v2/services/espanso_matches_service.dart';
import 'package:espanso_gui_v2/services/file_service.dart';
import 'package:espanso_gui_v2/services/theme_service.dart';
import 'package:espanso_gui_v2/services/theme_service_service.dart';
import 'package:espanso_gui_v2/ui/archive/espanso/espanso_view.dart';
import 'package:espanso_gui_v2/ui/bottom_sheets/notice/notice_sheet.dart';
import 'package:espanso_gui_v2/ui/dialogs/info_alert/info_alert_dialog.dart';
import 'package:espanso_gui_v2/ui/views/espanso_new/espanso_new_view.dart';
import 'package:espanso_gui_v2/ui/views/home/home_view.dart';
import 'package:espanso_gui_v2/ui/views/startup/startup_view.dart';
import 'package:stacked/stacked_annotations.dart';
import 'package:stacked_services/stacked_services.dart';
import 'package:espanso_gui_v2/ui/views/espanso/espanso_view.dart';
import 'package:espanso_gui_v2/services/espanso_matches_service.dart';
import 'package:espanso_gui_v2/services/file_service.dart';
import 'package:espanso_gui_v2/services/theme_service_service.dart';
import 'package:espanso_gui_v2/services/theme_service.dart';
// @stacked-import

@StackedApp(
routes: [
MaterialRoute(page: HomeView),
MaterialRoute(page: StartupView),
MaterialRoute(page: EspansoView),
MaterialRoute(page: EspansoNewView),
// @stacked-route
],
dependencies: [
Expand Down
94 changes: 54 additions & 40 deletions lib/app/app.router.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:espanso_gui_v2/app/app.bottomsheets.dart';
import 'package:espanso_gui_v2/app/app.dialogs.dart';
import 'package:espanso_gui_v2/app/app.locator.dart';
import 'package:espanso_gui_v2/app/app.router.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:stacked_services/stacked_services.dart';

Expand All @@ -25,7 +25,7 @@ class MainApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
initialRoute: Routes.espansoView,
initialRoute: Routes.espansoNewView,
onGenerateRoute: StackedRouter().onGenerateRoute,
navigatorKey: StackedService.navigatorKey,
navigatorObservers: [
Expand Down
36 changes: 25 additions & 11 deletions lib/models/espanso_match_model.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ mixin _$EspansoMatch {
/// list of variables
set variables(List<dynamic> value) => throw _privateConstructorUsedError;

@JsonKey(ignore: true)
/// Create a copy of EspansoMatch
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$EspansoMatchCopyWith<EspansoMatch> get copyWith =>
throw _privateConstructorUsedError;
}
Expand Down Expand Up @@ -96,6 +98,8 @@ class _$EspansoMatchCopyWithImpl<$Res, $Val extends EspansoMatch>
// ignore: unused_field
final $Res Function($Val) _then;

/// Create a copy of EspansoMatch
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Expand Down Expand Up @@ -139,6 +143,8 @@ class _$EspansoMatchCopyWithImpl<$Res, $Val extends EspansoMatch>
) as $Val);
}

/// Create a copy of EspansoMatch
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$EspansoTriggerFieldCopyWith<$Res> get trigger {
Expand All @@ -147,6 +153,8 @@ class _$EspansoMatchCopyWithImpl<$Res, $Val extends EspansoMatch>
});
}

/// Create a copy of EspansoMatch
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$EspansoReplaceFieldCopyWith<$Res> get replace {
Expand Down Expand Up @@ -187,6 +195,8 @@ class __$$EspansoMatchImplCopyWithImpl<$Res>
_$EspansoMatchImpl _value, $Res Function(_$EspansoMatchImpl) _then)
: super(_value, _then);

/// Create a copy of EspansoMatch
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Expand Down Expand Up @@ -279,7 +289,9 @@ class _$EspansoMatchImpl extends _EspansoMatch {
return 'EspansoMatch(trigger: $trigger, replace: $replace, label: $label, propagateCase: $propagateCase, titleCase: $titleCase, onlyOnWord: $onlyOnWord, variables: $variables)';
}

@JsonKey(ignore: true)
/// Create a copy of EspansoMatch
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$EspansoMatchImplCopyWith<_$EspansoMatchImpl> get copyWith =>
Expand All @@ -297,61 +309,63 @@ abstract class _EspansoMatch extends EspansoMatch {
required List<dynamic> variables}) = _$EspansoMatchImpl;
_EspansoMatch._() : super._();

@override

/// string to trigger expansion
@override
EspansoTriggerField get trigger;

/// string to trigger expansion
set trigger(EspansoTriggerField value);
@override

/// what the trigger expands to
@override
EspansoReplaceField get replace;

/// what the trigger expands to
set replace(EspansoReplaceField value);
@override

/// The label to display as the match's identifier in UI elements.
///
/// If empty, defaults to first trigger.
@override
String get label;

/// The label to display as the match's identifier in UI elements.
///
/// If empty, defaults to first trigger.
set label(String value);
@override

/// ex. alh - although, Alh - Although, ALH - ALTHOUGH
@override
bool get propagateCase;

/// ex. alh - although, Alh - Although, ALH - ALTHOUGH
set propagateCase(bool value);
@override

/// if propagateCase should capitalize each word. `false` by default
@override
bool get titleCase;

/// if propagateCase should capitalize each word. `false` by default
set titleCase(bool value);
@override

/// only trigger on matching word
@override
bool get onlyOnWord;

/// only trigger on matching word
set onlyOnWord(bool value);
@override

/// list of variables
@override
List<dynamic> get variables;

/// list of variables
set variables(List<dynamic> value);

/// Create a copy of EspansoMatch
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$EspansoMatchImplCopyWith<_$EspansoMatchImpl> get copyWith =>
throw _privateConstructorUsedError;
}
Loading

0 comments on commit cc9965c

Please sign in to comment.