diff --git a/.github/workflows/analysis-ci.yaml b/.github/workflows/analysis-ci.yaml index 26716d3..80f9ba2 100644 --- a/.github/workflows/analysis-ci.yaml +++ b/.github/workflows/analysis-ci.yaml @@ -12,7 +12,7 @@ on: types: [published] env: - FLUTTER_SDK_VERSION: "3.10.3" + FLUTTER_SDK_VERSION: "3.38" permissions: contents: read @@ -28,36 +28,33 @@ jobs: if: github.event.pull_request.draft == false steps: - - uses: actions/checkout@b56e6a3d768b11aef1d4c73977caf6413c0d74c8 # v3 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: Cache dependencies - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 id: cache with: path: /opt/hostedtoolcache/flutter key: ${{ runner.os }}-pubspec-${{ env.FLUTTER_SDK_VERSION }}-${{ hashFiles('**/pubspec.lock') }} - - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # v2.10.0 + - uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e # v2.21.0 with: flutter-version: ${{ env.FLUTTER_SDK_VERSION }} - - name: Verify formatting - run: dart format --output=none --set-exit-if-changed . - - name: Get dependencies run: flutter pub get + - name: Verify formatting + run: dart format --output=none --set-exit-if-changed . + - name: Analyze project source run: flutter analyze --no-pub --fatal-infos - - name: Analyze Dart Code Metrics - run: flutter pub run dart_code_metrics:metrics analyze lib --fatal-style --fatal-performance - - name: Run tests run: flutter test test/main.dart --no-pub --coverage - name: Upload Coveralls - uses: coverallsapp/github-action@67662d24394fd74bffcf7b462d1b432814159afd # 2.0.0 + uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7 continue-on-error: true with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 7b659e3..2872474 100644 --- a/.gitignore +++ b/.gitignore @@ -5,9 +5,11 @@ *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ migrate_working_dir/ # IntelliJ related diff --git a/analysis_options.yaml b/analysis_options.yaml index 396f3cf..cca550f 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -5,83 +5,16 @@ linter: - avoid_classes_with_only_static_members - avoid_types_on_closure_parameters - cancel_subscriptions - # - discarded_futures + # - discarded_futures - unnecessary_null_aware_operator_on_extension_on_nullable -dart_code_metrics: - metrics: - cyclomatic-complexity: 20 - maximum-nesting-level: 5 - number-of-arguments: 4 - metrics-exclude: - - test/** - rules: - - always-remove-listener - - arguments-ordering: - child-last: true - - avoid-border-all - - avoid-cascade-after-if-null - - avoid-collection-methods-with-unrelated-types - - avoid-double-slash-imports - - avoid-duplicate-exports - - avoid-global-state - - avoid-missing-enum-constant-in-map - - avoid-nested-conditional-expressions: - acceptable-level: 2 - - avoid-redundant-async - - avoid-returning-widgets - - avoid-shrink-wrap-in-lists - - avoid-throw-in-catch-block - - avoid-unnecessary-conditionals - - avoid-unnecessary-setstate - - avoid-unnecessary-type-assertions - - avoid-unnecessary-type-casts - - avoid-unrelated-type-assertions - - avoid-expanded-as-spacer - - avoid-wrapping-in-padding - - binary-expression-operand-order - - double-literal-format - # - format-comment: - # ignored-patterns: - # - ^coverage.* - # - member-ordering - - missing-test-assertion - - newline-before-return - - no-boolean-literal-compare - - no-equal-then-else - # - no-magic-number - - prefer-conditional-expressions - - prefer-correct-edge-insets-constructor - - prefer-correct-test-file-name: - exclude: - - lib/** - - bin/** - - "**/main.dart" - - prefer-enums-by-name - # - prefer-extracting-callbacks - - prefer-first - - prefer-immediate-return - - prefer-iterable-of - - prefer-last - - prefer-match-file-name: - exclude: - - test/** - # - prefer-moving-to-variable - - prefer-trailing-comma - - prefer-single-widget-per-file: - ignore-private-widgets: true - - use-setstate-synchronously - anti-patterns: - - long-parameter-list - analyzer: - plugins: - - dart_code_metrics - errors: avoid_equals_and_hash_code_on_mutable_classes: ignore public_member_api_docs: ignore unused_element: ignore # See https://github.com/dart-lang/sdk/issues/49025 + unused_element_parameter: ignore + comment_references: ignore # Style decisions always_put_required_named_parameters_first: ignore diff --git a/lib/model/alphabet.dart b/lib/model/alphabet.dart index 6eb66c0..17c9b49 100644 --- a/lib/model/alphabet.dart +++ b/lib/model/alphabet.dart @@ -6,137 +6,137 @@ class Alphabet { final Map _letterToNumber; const Alphabet({required this.name, required Map letterToNumber}) - : _letterToNumber = letterToNumber; + : _letterToNumber = letterToNumber; const Alphabet.latinNaturalOrder() - : name = 'Latin Natural Order', - _letterToNumber = const { - 'A': 1, - 'B': 2, - 'C': 3, - 'D': 4, - 'E': 5, - 'F': 6, - 'G': 7, - 'H': 8, - 'I': 9, - 'J': 9, - 'K': 10, - 'L': 11, - 'M': 12, - 'N': 13, - 'O': 14, - 'P': 15, - 'Q': 16, - 'R': 17, - 'S': 18, - 'T': 19, - 'U': 20, - 'V': 20, - 'W': 0, - 'X': 21, - 'Y': 22, - 'Z': 23, - }; + : name = 'Latin Natural Order', + _letterToNumber = const { + 'A': 1, + 'B': 2, + 'C': 3, + 'D': 4, + 'E': 5, + 'F': 6, + 'G': 7, + 'H': 8, + 'I': 9, + 'J': 9, + 'K': 10, + 'L': 11, + 'M': 12, + 'N': 13, + 'O': 14, + 'P': 15, + 'Q': 16, + 'R': 17, + 'S': 18, + 'T': 19, + 'U': 20, + 'V': 20, + 'W': 0, + 'X': 21, + 'Y': 22, + 'Z': 23, + }; const Alphabet.latinNaturalOrder1() - : name = 'Latin Natural Order #1', - _letterToNumber = const { - 'A': 1, - 'B': 2, - 'C': 3, - 'D': 4, - 'E': 5, - 'F': 6, - 'G': 7, - 'H': 8, - 'I': 9, - 'J': 9, - 'K': 10, - 'L': 11, - 'M': 12, - 'N': 13, - 'O': 14, - 'P': 15, - 'Q': 16, - 'R': 17, - 'S': 18, - 'T': 19, - 'U': 20, - 'V': 20, - 'W': 21, - 'X': 22, - 'Y': 23, - 'Z': 24, - }; + : name = 'Latin Natural Order #1', + _letterToNumber = const { + 'A': 1, + 'B': 2, + 'C': 3, + 'D': 4, + 'E': 5, + 'F': 6, + 'G': 7, + 'H': 8, + 'I': 9, + 'J': 9, + 'K': 10, + 'L': 11, + 'M': 12, + 'N': 13, + 'O': 14, + 'P': 15, + 'Q': 16, + 'R': 17, + 'S': 18, + 'T': 19, + 'U': 20, + 'V': 20, + 'W': 21, + 'X': 22, + 'Y': 23, + 'Z': 24, + }; const Alphabet.latinNaturalOrder2() - : name = 'Latin Natural Order #2', - _letterToNumber = const { - 'A': 1, - 'B': 2, - 'C': 3, - 'D': 4, - 'E': 5, - 'F': 6, - 'G': 7, - 'H': 8, - 'I': 9, - 'J': 9, - 'K': 10, - 'L': 11, - 'M': 12, - 'N': 13, - 'O': 0, - 'P': 14, - 'Q': 15, - 'R': 16, - 'S': 17, - 'T': 18, - 'U': 19, - 'V': 19, - 'W': 20, - 'X': 21, - 'Y': 22, - 'Z': 23, - }; + : name = 'Latin Natural Order #2', + _letterToNumber = const { + 'A': 1, + 'B': 2, + 'C': 3, + 'D': 4, + 'E': 5, + 'F': 6, + 'G': 7, + 'H': 8, + 'I': 9, + 'J': 9, + 'K': 10, + 'L': 11, + 'M': 12, + 'N': 13, + 'O': 0, + 'P': 14, + 'Q': 15, + 'R': 16, + 'S': 17, + 'T': 18, + 'U': 19, + 'V': 19, + 'W': 20, + 'X': 21, + 'Y': 22, + 'Z': 23, + }; const Alphabet.latinNaturalOrder3() - : name = 'Latin Natural Order #3', - _letterToNumber = const { - 'A': 1, - 'B': 2, - 'C': 3, - 'D': 4, - 'E': 5, - 'F': 6, - 'G': 7, - 'H': 8, - 'I': 9, - 'J': 9, - 'K': 0, - 'L': 10, - 'M': 11, - 'N': 12, - 'O': 13, - 'P': 14, - 'Q': 15, - 'R': 16, - 'S': 17, - 'T': 18, - 'U': 19, - 'V': 19, - 'W': 0, - 'X': 20, - 'Y': 21, - 'Z': 22, - }; + : name = 'Latin Natural Order #3', + _letterToNumber = const { + 'A': 1, + 'B': 2, + 'C': 3, + 'D': 4, + 'E': 5, + 'F': 6, + 'G': 7, + 'H': 8, + 'I': 9, + 'J': 9, + 'K': 0, + 'L': 10, + 'M': 11, + 'N': 12, + 'O': 13, + 'P': 14, + 'Q': 15, + 'R': 16, + 'S': 17, + 'T': 18, + 'U': 19, + 'V': 19, + 'W': 0, + 'X': 20, + 'Y': 21, + 'Z': 22, + }; static const List alphabets = [ - Alphabet.latinNaturalOrder(), - Alphabet.latinNaturalOrder1(), - Alphabet.latinNaturalOrder2(), - Alphabet.latinNaturalOrder3(), + .latinNaturalOrder(), + .latinNaturalOrder1(), + .latinNaturalOrder2(), + .latinNaturalOrder3(), ]; int? numericValueOfLetter(String letter) => @@ -145,10 +145,10 @@ class Alphabet { bool containsLetter(String letter) => numericValueOfLetter(letter) != null; int numericValueOfName(String name) => name.characters.fold( - 0, - (previousValue, letter) => - previousValue + (numericValueOfLetter(letter) ?? 0), - ); + 0, + (previousValue, letter) => + previousValue + (numericValueOfLetter(letter) ?? 0), + ); @override bool operator ==(Object other) => diff --git a/lib/model/cryptogram_scheme.dart b/lib/model/cryptogram_scheme.dart index 10e21c6..729b4cb 100644 --- a/lib/model/cryptogram_scheme.dart +++ b/lib/model/cryptogram_scheme.dart @@ -12,20 +12,20 @@ class CryptogramScheme { /// /// See [Musical cryptogram](https://en.wikipedia.org/wiki/Musical_cryptogram#Syllables_to_solmization_names). const CryptogramScheme.solmization() - : name = 'Solmization', - patterns = const { - 'do|ut': Note.c, - 're': Note.d, - 'mi': Note.e, - 'fa': Note.f, - 'sol?': Note.g, - 'la': Note.a, - '(t|s)i': Note.b, - 'a': Note.f, - 'e': Note.d, - 'i': Note.e, - 'u': Note.c, - }; + : name = 'Solmization', + patterns = const { + 'do|ut': .c, + 're': .d, + 'mi': .e, + 'fa': .f, + 'sol?': .g, + 'la': .a, + '(t|s)i': .b, + 'a': .f, + 'e': .d, + 'i': .e, + 'u': .c, + }; /// Arisen late in the 19th century, it was more akin to normal encipherment. /// The most popular version involved writing out the letters H–N, O–U and @@ -39,35 +39,35 @@ class CryptogramScheme { /// /// See [Musical cryptogram](https://en.wikipedia.org/wiki/Musical_cryptogram#French). const CryptogramScheme.french() - : name = 'French', - patterns = const { - 'A': Note.a, - 'B': Note.b, - 'C': Note.c, - 'D': Note.d, - 'E': Note.e, - 'F': Note.f, - 'G': Note.g, - 'H': Note.a, - 'I': Note.b, - 'J': Note.c, - 'K': Note.d, - 'L': Note.e, - 'M': Note.f, - 'N': Note.g, - 'O': Note.a, - 'P': Note.b, - 'Q': Note.c, - 'R': Note.d, - 'S': Note.e, - 'T': Note.f, - 'U': Note.g, - 'V': Note.a, - 'W': Note.b, - 'X': Note.c, - 'Y': Note.d, - 'Z': Note.e, - }; + : name = 'French', + patterns = const { + 'A': .a, + 'B': .b, + 'C': .c, + 'D': .d, + 'E': .e, + 'F': .f, + 'G': .g, + 'H': .a, + 'I': .b, + 'J': .c, + 'K': .d, + 'L': .e, + 'M': .f, + 'N': .g, + 'O': .a, + 'P': .b, + 'Q': .c, + 'R': .d, + 'S': .e, + 'T': .f, + 'U': .g, + 'V': .a, + 'W': .b, + 'X': .c, + 'Y': .d, + 'Z': .e, + }; /// Derived on the [CryptogramScheme.french] but leaving H = [Note.b] and /// starting the second line with 'I'. @@ -75,35 +75,35 @@ class CryptogramScheme { /// See [Musical cryptogram](https://en.wikipedia.org/wiki/Musical_cryptogram#Summary_of_signature_motifs) /// (Alain). const CryptogramScheme.frenchVariant() - : name = 'French variant', - patterns = const { - 'A': Note.a, - 'B': Note.b, - 'C': Note.c, - 'D': Note.d, - 'E': Note.e, - 'F': Note.f, - 'G': Note.g, - 'H': Note.b, - 'I': Note.a, - 'J': Note.b, - 'K': Note.c, - 'L': Note.d, - 'M': Note.e, - 'N': Note.f, - 'O': Note.g, - 'P': Note.a, - 'Q': Note.b, - 'R': Note.c, - 'S': Note.d, - 'T': Note.e, - 'U': Note.f, - 'V': Note.g, - 'W': Note.a, - 'X': Note.b, - 'Y': Note.c, - 'Z': Note.d, - }; + : name = 'French variant', + patterns = const { + 'A': .a, + 'B': .b, + 'C': .c, + 'D': .d, + 'E': .e, + 'F': .f, + 'G': .g, + 'H': .b, + 'I': .a, + 'J': .b, + 'K': .c, + 'L': .d, + 'M': .e, + 'N': .f, + 'O': .g, + 'P': .a, + 'Q': .b, + 'R': .c, + 'S': .d, + 'T': .e, + 'U': .f, + 'V': .g, + 'W': .a, + 'X': .b, + 'Y': .c, + 'Z': .d, + }; /// Because the development of note names took place within the framework of /// [Mode]s, in the German-speaking world [Note.b.flat] was named 'B' and @@ -114,53 +114,53 @@ class CryptogramScheme { /// /// See [Musical cryptogram](https://en.wikipedia.org/wiki/Musical_cryptogram#German). const CryptogramScheme.german() - : name = 'German', - patterns = const { - 'As': Note(BaseNote.a, Accidental.flat), - 'Ais': Note(BaseNote.a, Accidental.sharp), - 'A': Note.a, - 'B': Note(BaseNote.b, Accidental.flat), - 'Ces': Note(BaseNote.c, Accidental.flat), - 'Cis': Note(BaseNote.c, Accidental.sharp), - 'C': Note.c, - 'Des': Note(BaseNote.d, Accidental.flat), - 'Dis': Note(BaseNote.d, Accidental.sharp), - 'D': Note.d, - 'Es': Note(BaseNote.e, Accidental.flat), - 'Eis': Note(BaseNote.e, Accidental.sharp), - 'Fes': Note(BaseNote.f, Accidental.flat), - 'Fis': Note(BaseNote.f, Accidental.sharp), - 'F': Note.f, - 'Ges': Note(BaseNote.g, Accidental.flat), - 'Gis': Note(BaseNote.g, Accidental.sharp), - 'G': Note.g, - 'E': Note.e, - 'H': Note.b, - 'I': Note.b, - 'J': Note.c, - 'K': Note.d, - 'L': Note.e, - 'M': Note.f, - 'N': Note.g, - 'O': Note.a, - 'P': Note.b, - 'Q': Note.c, - 'R': Note.d, - 'S': Note(BaseNote.e, Accidental.flat), - 'T': Note.f, - 'U': Note.g, - 'V': Note.a, - 'W': Note.b, - 'X': Note.c, - 'Y': Note.d, - 'Z': Note.e, - }; + : name = 'German', + patterns = const { + 'As': Note(.a, .flat), + 'Ais': Note(.a, .sharp), + 'A': .a, + 'B': Note(.b, .flat), + 'Ces': Note(.c, .flat), + 'Cis': Note(.c, .sharp), + 'C': .c, + 'Des': Note(.d, .flat), + 'Dis': Note(.d, .sharp), + 'D': .d, + 'Es': Note(.e, .flat), + 'Eis': Note(.e, .sharp), + 'Fes': Note(.f, .flat), + 'Fis': Note(.f, .sharp), + 'F': .f, + 'Ges': Note(.g, .flat), + 'Gis': Note(.g, .sharp), + 'G': .g, + 'E': .e, + 'H': .b, + 'I': .b, + 'J': .c, + 'K': .d, + 'L': .e, + 'M': .f, + 'N': .g, + 'O': .a, + 'P': .b, + 'Q': .c, + 'R': .d, + 'S': Note(.e, .flat), + 'T': .f, + 'U': .g, + 'V': .a, + 'W': .b, + 'X': .c, + 'Y': .d, + 'Z': .e, + }; static const List schemes = [ - CryptogramScheme.solmization(), - CryptogramScheme.french(), - CryptogramScheme.frenchVariant(), - CryptogramScheme.german(), + .solmization(), + .french(), + .frenchVariant(), + .german(), ]; /// Returns the cryptogrammatic sequence of [Note]s, a sequence which can be diff --git a/lib/model/name.dart b/lib/model/name.dart index 646de68..a9a15cb 100644 --- a/lib/model/name.dart +++ b/lib/model/name.dart @@ -9,8 +9,8 @@ class Name { const Name( this.name, { - this.alphabet = const Alphabet.latinNaturalOrder1(), - this.scheme = const CryptogramScheme.german(), + this.alphabet = const .latinNaturalOrder1(), + this.scheme = const .german(), }); int get numericValue => alphabet.numericValueOfName(name); diff --git a/lib/utils/int_extension.dart b/lib/utils/int_extension.dart index 547b96c..901426c 100644 --- a/lib/utils/int_extension.dart +++ b/lib/utils/int_extension.dart @@ -7,12 +7,14 @@ extension IntExtension on int { if (isEven) return false; final maxDivisor = sqrt(this).floor(); - for (var i = 3; - i <= maxDivisor; - // All prime numbers are 1 or 5 modulo 6. - // Since we start with 3, this will do: - // 3 -> 5 -> 7 -> 11 ... +2 -> +4 -> +2 -> +4 ... - i = i % 6 == 1 ? i + 4 : i + 2) { + for ( + var i = 3; + i <= maxDivisor; + // All prime numbers are 1 or 5 modulo 6. + // Since we start with 3, this will do: + // 3 -> 5 -> 7 -> 11 ... +2 -> +4 -> +2 -> +4 ... + i = i % 6 == 1 ? i + 4 : i + 2 + ) { if (this % i == 0) return false; } diff --git a/lib/widgets/alphabet/alphabet_dropdown.dart b/lib/widgets/alphabet/alphabet_dropdown.dart index 7c0567f..6ca064a 100644 --- a/lib/widgets/alphabet/alphabet_dropdown.dart +++ b/lib/widgets/alphabet/alphabet_dropdown.dart @@ -16,7 +16,7 @@ class AlphabetDropdown extends StatelessWidget { @override Widget build(BuildContext context) { return Padding( - padding: const EdgeInsetsDirectional.only(top: 16), + padding: const .only(top: 16), child: Align( alignment: AlignmentDirectional.topStart, child: DropdownButtonFormField( @@ -31,9 +31,9 @@ class AlphabetDropdown extends StatelessWidget { ), ), ], - value: name.alphabet, + initialValue: name.alphabet, onChanged: onAlphabetChanged, - decoration: const InputDecoration.collapsed(hintText: 'Alphabet'), + decoration: const .collapsed(hintText: 'Alphabet'), ), ), ); @@ -58,7 +58,7 @@ class _AlphabetDropdownMenuItem extends StatelessWidget { value: alphabet, child: Theme( data: theme.copyWith( - colorScheme: ColorScheme.fromSeed( + colorScheme: .fromSeed( seedColor: NameSection.colorFromValue( alphabet.numericValueOfName(name), ), @@ -69,7 +69,7 @@ class _AlphabetDropdownMenuItem extends StatelessWidget { final theme = Theme.of(context); return Row( - mainAxisSize: MainAxisSize.min, + mainAxisSize: .min, children: [ Text( alphabet.name, @@ -82,9 +82,9 @@ class _AlphabetDropdownMenuItem extends StatelessWidget { Text( '${alphabet.numericValueOfName(name)}', style: TextStyle( - color: theme.colorScheme.primary.withOpacity(0.6), + color: theme.colorScheme.primary.withValues(alpha: 0.6), fontSize: 14, - fontWeight: FontWeight.w400, + fontWeight: .w400, ), ), ], diff --git a/lib/widgets/alphabet/letter_card.dart b/lib/widgets/alphabet/letter_card.dart index d9e98df..bbda702 100644 --- a/lib/widgets/alphabet/letter_card.dart +++ b/lib/widgets/alphabet/letter_card.dart @@ -16,43 +16,39 @@ class LetterCard extends StatelessWidget { @override Widget build(BuildContext context) { final theme = Theme.of(context); - final onPrimary = theme.colorScheme.primary.withOpacity(0.8); - final primaryBackground = - theme.colorScheme.primary.withOpacity(isDimmed ? 0.2 : 0.35); + final onPrimary = theme.colorScheme.primary.withValues(alpha: 0.8); + final primaryBackground = theme.colorScheme.primary.withValues( + alpha: isDimmed ? 0.2 : 0.35, + ); return Container( - margin: const EdgeInsets.symmetric(horizontal: 4), + margin: const .symmetric(horizontal: 4), child: Material( elevation: 1.5, color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(12)), + borderRadius: const .all(.circular(12)), child: Container( - padding: const EdgeInsets.symmetric( - vertical: 12, - horizontal: 18, - ), + padding: const .symmetric(vertical: 12, horizontal: 18), decoration: BoxDecoration( color: primaryBackground, - borderRadius: const BorderRadius.all(Radius.circular(12)), + borderRadius: const .all(.circular(12)), ), child: Column( - mainAxisSize: MainAxisSize.min, + mainAxisSize: .min, children: [ Text( letter.toUpperCase(), - style: (isDimmed - ? theme.textTheme.displaySmall - : theme.textTheme.displayLarge) - ?.copyWith( - fontWeight: FontWeight.w300, - color: onPrimary, - ), + style: + (isDimmed + ? theme.textTheme.displaySmall + : theme.textTheme.displayLarge) + ?.copyWith(fontWeight: .w300, color: onPrimary), ), Text( value != null ? '$value' : '', style: TextStyle( color: onPrimary, - fontWeight: value?.isPrime ?? false ? FontWeight.w800 : null, + fontWeight: value?.isPrime ?? false ? .w800 : null, ), ), ], diff --git a/lib/widgets/alphabet/letter_cards.dart b/lib/widgets/alphabet/letter_cards.dart index f84d59c..cfdf7d5 100644 --- a/lib/widgets/alphabet/letter_cards.dart +++ b/lib/widgets/alphabet/letter_cards.dart @@ -11,9 +11,9 @@ class LetterCards extends StatelessWidget { Widget build(BuildContext context) { return Center( child: Wrap( - alignment: WrapAlignment.center, + alignment: .center, runSpacing: 8, - crossAxisAlignment: WrapCrossAlignment.end, + crossAxisAlignment: .end, children: [ for (final character in name.name.characters) if (character == ' ') diff --git a/lib/widgets/musical_cryptogram/cryptogram_scheme_dropdown.dart b/lib/widgets/musical_cryptogram/cryptogram_scheme_dropdown.dart index d0da886..c00e50b 100644 --- a/lib/widgets/musical_cryptogram/cryptogram_scheme_dropdown.dart +++ b/lib/widgets/musical_cryptogram/cryptogram_scheme_dropdown.dart @@ -15,10 +15,10 @@ class CryptogramSchemeDropdown extends StatelessWidget { @override Widget build(BuildContext context) { return Padding( - padding: const EdgeInsetsDirectional.only(top: 16), + padding: const .only(top: 16), child: Align( alignment: AlignmentDirectional.topStart, - child: DropdownButtonFormField( + child: DropdownButtonFormField( items: [ for (final scheme in CryptogramScheme.schemes) DropdownMenuItem( @@ -30,9 +30,9 @@ class CryptogramSchemeDropdown extends StatelessWidget { ), ), ], - value: const CryptogramScheme.german(), + initialValue: const .german(), onChanged: onSchemeChanged, - decoration: const InputDecoration.collapsed(hintText: 'Scheme'), + decoration: const .collapsed(hintText: 'Scheme'), ), ), ); @@ -56,22 +56,19 @@ class _CryptogramSchemeDropdownMenuItem extends StatelessWidget { return DropdownMenuItem( value: scheme, child: Row( - mainAxisSize: MainAxisSize.min, + mainAxisSize: .min, children: [ Text( scheme.name, - style: TextStyle( - color: theme.colorScheme.primary, - fontSize: 14, - ), + style: TextStyle(color: theme.colorScheme.primary, fontSize: 14), ), const SizedBox(width: 14), Text( scheme.cryptogramOf(name.name).join('–'), style: TextStyle( - color: theme.colorScheme.primary.withOpacity(0.6), + color: theme.colorScheme.primary.withValues(alpha: 0.6), fontSize: 14, - fontWeight: FontWeight.w400, + fontWeight: .w400, ), ), ], diff --git a/lib/widgets/musical_cryptogram/cryptogram_section.dart b/lib/widgets/musical_cryptogram/cryptogram_section.dart index d765d41..1e194b3 100644 --- a/lib/widgets/musical_cryptogram/cryptogram_section.dart +++ b/lib/widgets/musical_cryptogram/cryptogram_section.dart @@ -30,9 +30,9 @@ class _CryptogramSectionState extends State { return Container( decoration: BoxDecoration( - color: color.withOpacity(0.1), + color: color.withValues(alpha: 0.1), border: Border( - bottom: BorderSide(color: color.withOpacity(0.4), width: 2), + bottom: BorderSide(color: color.withValues(alpha: 0.4), width: 2), ), ), clipBehavior: Clip.antiAlias, diff --git a/lib/widgets/musical_cryptogram/note_card.dart b/lib/widgets/musical_cryptogram/note_card.dart index fe67f39..309c83f 100644 --- a/lib/widgets/musical_cryptogram/note_card.dart +++ b/lib/widgets/musical_cryptogram/note_card.dart @@ -9,29 +9,24 @@ class NoteCard extends StatelessWidget { @override Widget build(BuildContext context) { final theme = Theme.of(context); - final onPrimary = theme.colorScheme.primary.withOpacity(0.8); + final onPrimary = theme.colorScheme.primary.withValues(alpha: 0.8); return Container( - margin: const EdgeInsets.symmetric(horizontal: 4), + margin: const .symmetric(horizontal: 4), child: Material( elevation: 1.5, color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(12)), + borderRadius: const .all(.circular(12)), child: Container( - padding: const EdgeInsets.symmetric( - vertical: 12, - horizontal: 18, - ), - decoration: const BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(12)), - ), + padding: const .symmetric(vertical: 12, horizontal: 18), + decoration: const BoxDecoration(borderRadius: .all(.circular(12))), child: Column( - mainAxisSize: MainAxisSize.min, + mainAxisSize: .min, children: [ Text( '$note', style: theme.textTheme.displayLarge?.copyWith( - fontWeight: FontWeight.w300, + fontWeight: .w300, color: onPrimary, ), ), diff --git a/lib/widgets/musical_cryptogram/note_cards.dart b/lib/widgets/musical_cryptogram/note_cards.dart index 9559d16..2af1ba5 100644 --- a/lib/widgets/musical_cryptogram/note_cards.dart +++ b/lib/widgets/musical_cryptogram/note_cards.dart @@ -11,9 +11,9 @@ class NoteCards extends StatelessWidget { Widget build(BuildContext context) { return Center( child: Wrap( - alignment: WrapAlignment.center, + alignment: .center, runSpacing: 8, - crossAxisAlignment: WrapCrossAlignment.end, + crossAxisAlignment: .end, children: [ for (final note in name.musicalCryptogram) NoteCard(note: note), ], diff --git a/lib/widgets/name_section.dart b/lib/widgets/name_section.dart index 014d6e5..f0f039c 100644 --- a/lib/widgets/name_section.dart +++ b/lib/widgets/name_section.dart @@ -31,7 +31,7 @@ class _NameSectionState extends State { return Theme( data: Theme.of(context).copyWith( - colorScheme: ColorScheme.fromSeed( + colorScheme: .fromSeed( seedColor: NameSection.colorFromValue(name.numericValue), ), ), @@ -42,9 +42,12 @@ class _NameSectionState extends State { return Container( decoration: BoxDecoration( - color: color.withOpacity(0.1), + color: color.withValues(alpha: 0.1), border: Border( - bottom: BorderSide(color: color.withOpacity(0.4), width: 2), + bottom: BorderSide( + color: color.withValues(alpha: 0.4), + width: 2, + ), ), ), clipBehavior: Clip.antiAlias, diff --git a/lib/widgets/name_section_text_field.dart b/lib/widgets/name_section_text_field.dart index 40cd362..7627df5 100644 --- a/lib/widgets/name_section_text_field.dart +++ b/lib/widgets/name_section_text_field.dart @@ -17,11 +17,10 @@ class NameSectionTextField extends StatefulWidget { } class _NameSectionTextFieldState extends State { - late final TextEditingController _controller = - TextEditingController(text: widget.name); + late final TextEditingController _controller = .new(text: widget.name); - late final FocusNode _focusNode = FocusNode()..addListener(_onFocusChange); - final ValueNotifier _focusNotifier = ValueNotifier(false); + late final FocusNode _focusNode = .new()..addListener(_onFocusChange); + final ValueNotifier _focusNotifier = .new(false); @override void dispose() { @@ -59,13 +58,15 @@ class _NameSectionTextFieldState extends State { hintText: 'Type a name', contentPadding: widget.contentPadding, filled: true, - fillColor: isFocused ? color.withOpacity(0.15) : Colors.transparent, - hoverColor: color.withOpacity(0.05), - border: InputBorder.none, + fillColor: isFocused + ? color.withValues(alpha: 0.15) + : Colors.transparent, + hoverColor: color.withValues(alpha: 0.05), + border: .none, ), style: const TextStyle(color: Colors.transparent), - textAlign: TextAlign.center, - textAlignVertical: TextAlignVertical.center, + textAlign: .center, + textAlignVertical: .center, showCursor: false, autocorrect: false, maxLines: null, diff --git a/lib/widgets/name_section_value.dart b/lib/widgets/name_section_value.dart index ced126d..809d14e 100644 --- a/lib/widgets/name_section_value.dart +++ b/lib/widgets/name_section_value.dart @@ -17,8 +17,8 @@ class NameSectionValue extends StatelessWidget { '$value', style: theme.textTheme.displayLarge?.copyWith( fontSize: 200, - fontWeight: FontWeight.w100, - color: color.withOpacity(0.2), + fontWeight: .w100, + color: color.withValues(alpha: 0.2), letterSpacing: -8, ), ), diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 88f2613..bca4a33 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -182,7 +182,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 33CC10EC2044A3C60003C045 = { @@ -345,7 +345,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -424,7 +424,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -471,7 +471,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 5bf55d4..59e52bf 100644 --- a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ diff --git a/macos/Runner/AppDelegate.swift b/macos/Runner/AppDelegate.swift index d53ef64..b3c1761 100644 --- a/macos/Runner/AppDelegate.swift +++ b/macos/Runner/AppDelegate.swift @@ -1,9 +1,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/pubspec.lock b/pubspec.lock index c601b1f..b37de93 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,166 +1,62 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - sha256: "405666cd3cf0ee0a48d21ec67e65406aad2c726d9fa58840d3375e7bdcd32a07" - url: "https://pub.dev" - source: hosted - version: "60.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - sha256: "1952250bd005bacb895a01bf1b4dc00e3ba1c526cf47dca54dfe24979c65f5b3" - url: "https://pub.dev" - source: hosted - version: "5.12.0" - analyzer_plugin: - dependency: transitive - description: - name: analyzer_plugin - sha256: c1d5f167683de03d5ab6c3b53fc9aeefc5d59476e7810ba7bbddff50c6f4392d - url: "https://pub.dev" - source: hosted - version: "0.11.2" - ansicolor: - dependency: transitive - description: - name: ansicolor - sha256: "607f8fa9786f392043f169898923e6c59b4518242b68b8862eb8a8b7d9c30b4a" - url: "https://pub.dev" - source: hosted - version: "2.0.1" - args: - dependency: transitive - description: - name: args - sha256: c372bb384f273f0c2a8aaaa226dad84dc27c8519a691b888725dec59518ad53a - url: "https://pub.dev" - source: hosted - version: "2.4.1" async: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.13.0" boolean_selector: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" characters: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" clock: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" collection: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" url: "https://pub.dev" source: hosted - version: "1.17.1" - convert: - dependency: transitive - description: - name: convert - sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" - url: "https://pub.dev" - source: hosted - version: "3.1.1" - coverage: - dependency: transitive - description: - name: coverage - sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" - url: "https://pub.dev" - source: hosted - version: "1.6.3" - crypto: - dependency: transitive - description: - name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab - url: "https://pub.dev" - source: hosted - version: "3.0.3" - csslib: - dependency: transitive - description: - name: csslib - sha256: "831883fb353c8bdc1d71979e5b342c7d88acfbc643113c14ae51e2442ea0f20f" - url: "https://pub.dev" - source: hosted - version: "0.17.3" - dart_code_metrics: - dependency: "direct dev" - description: - name: dart_code_metrics - sha256: "8d40e9fa6ba6b5f4f569768e267e9cb3e74350f98b30ac4b8160795792ce5414" - url: "https://pub.dev" - source: hosted - version: "5.7.4" - dart_code_metrics_presets: - dependency: transitive - description: - name: dart_code_metrics_presets - sha256: b71eadf02a3787ebd5c887623f83f6fdc204d45c75a081bd636c4104b3fd8b73 - url: "https://pub.dev" - source: hosted - version: "1.8.0" - dart_style: - dependency: transitive - description: - name: dart_style - sha256: f4f1f73ab3fd2afcbcca165ee601fe980d966af6a21b5970c6c9376955c528ad - url: "https://pub.dev" - source: hosted - version: "2.3.1" + version: "1.19.1" diacritic: dependency: "direct main" description: name: diacritic - sha256: c09a420e737dc036122121fea9f774767e95068f34a17894ee9db30c5bda3075 + sha256: "12981945ec38931748836cd76f2b38773118d0baef3c68404bdfde9566147876" url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "0.1.6" fake_async: dependency: transitive description: name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" - source: hosted - version: "1.3.1" - file: - dependency: transitive - description: - name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "1.3.3" flutter: dependency: "direct main" description: flutter @@ -171,394 +67,147 @@ packages: description: flutter source: sdk version: "0.0.0" - frontend_server_client: - dependency: transitive - description: - name: frontend_server_client - sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" - url: "https://pub.dev" - source: hosted - version: "3.2.0" - glob: - dependency: transitive - description: - name: glob - sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - html: - dependency: transitive - description: - name: html - sha256: "58e3491f7bf0b6a4ea5110c0c688877460d1a6366731155c4a4580e7ded773e8" - url: "https://pub.dev" - source: hosted - version: "0.15.3" - http: - dependency: transitive - description: - name: http - sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" - url: "https://pub.dev" - source: hosted - version: "0.13.6" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" - url: "https://pub.dev" - source: hosted - version: "3.2.1" - http_parser: - dependency: transitive - description: - name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" - source: hosted - version: "4.0.2" - io: + leak_tracker: dependency: transitive description: - name: io - sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "1.0.4" - js: + version: "11.0.2" + leak_tracker_flutter_testing: dependency: transitive description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "0.6.7" - json_annotation: + version: "3.0.10" + leak_tracker_testing: dependency: transitive description: - name: json_annotation - sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "4.8.1" - logging: - dependency: transitive - description: - name: logging - sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" - url: "https://pub.dev" - source: hosted - version: "1.2.0" + version: "3.0.2" matcher: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.17" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" url: "https://pub.dev" source: hosted - version: "1.9.1" - mime: - dependency: transitive - description: - name: mime - sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e - url: "https://pub.dev" - source: hosted - version: "1.0.4" + version: "1.17.0" music_notes: dependency: "direct main" description: name: music_notes - sha256: "83aca929d9e6956e9842084bc6ae2628f95e2ea4a18b7311f61b18e329eff6a2" - url: "https://pub.dev" - source: hosted - version: "0.11.1" - node_preamble: - dependency: transitive - description: - name: node_preamble - sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + sha256: "6deb2bbc6bb6490d3323d8782825bb43f168b147ff26d1795101a6578edfe665" url: "https://pub.dev" source: hosted - version: "2.0.2" - package_config: - dependency: transitive - description: - name: package_config - sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" - url: "https://pub.dev" - source: hosted - version: "2.1.0" + version: "0.24.0" path: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" - source: hosted - version: "1.8.3" - petitparser: - dependency: transitive - description: - name: petitparser - sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 - url: "https://pub.dev" - source: hosted - version: "5.4.0" - platform: - dependency: transitive - description: - name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" - url: "https://pub.dev" - source: hosted - version: "3.1.0" - pool: - dependency: transitive - description: - name: pool - sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" - url: "https://pub.dev" - source: hosted - version: "1.5.1" - process: - dependency: transitive - description: - name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" - url: "https://pub.dev" - source: hosted - version: "4.2.4" - pub_semver: - dependency: transitive - description: - name: pub_semver - sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - pub_updater: - dependency: transitive - description: - name: pub_updater - sha256: "05ae70703e06f7fdeb05f7f02dd680b8aad810e87c756a618f33e1794635115c" - url: "https://pub.dev" - source: hosted - version: "0.3.0" - shelf: - dependency: transitive - description: - name: shelf - sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 - url: "https://pub.dev" - source: hosted - version: "1.4.1" - shelf_packages_handler: - dependency: transitive - description: - name: shelf_packages_handler - sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" url: "https://pub.dev" source: hosted - version: "3.0.2" - shelf_static: - dependency: transitive - description: - name: shelf_static - sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e - url: "https://pub.dev" - source: hosted - version: "1.1.2" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" - url: "https://pub.dev" - source: hosted - version: "1.0.4" + version: "1.9.1" sky_engine: dependency: transitive description: flutter source: sdk - version: "0.0.99" - source_map_stack_trace: - dependency: transitive - description: - name: source_map_stack_trace - sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - source_maps: - dependency: transitive - description: - name: source_maps - sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" - url: "https://pub.dev" - source: hosted - version: "0.10.12" + version: "0.0.0" source_span: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.1" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.12.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.4" string_scanner: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.4.1" term_glyph: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - test: - dependency: transitive - description: - name: test - sha256: "3dac9aecf2c3991d09b9cdde4f98ded7b30804a88a0d7e4e7e1678e78d6b97f4" + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" url: "https://pub.dev" source: hosted - version: "1.24.1" + version: "1.2.2" test_api: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb - url: "https://pub.dev" - source: hosted - version: "0.5.1" - test_core: - dependency: transitive - description: - name: test_core - sha256: "5138dbffb77b2289ecb12b81c11ba46036590b72a64a7a90d6ffb880f1a29e93" - url: "https://pub.dev" - source: hosted - version: "0.5.1" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c - url: "https://pub.dev" - source: hosted - version: "1.3.2" - uuid: - dependency: transitive - description: - name: uuid - sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 url: "https://pub.dev" source: hosted - version: "3.0.7" + version: "0.7.7" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" very_good_analysis: dependency: "direct dev" description: name: very_good_analysis - sha256: "5e4ea72d2a9188630f0dd8f120a541de730090ef8863243fedca8267a84508b8" + sha256: "96245839dbcc45dfab1af5fa551603b5c7a282028a64746c19c547d21a7f1e3a" url: "https://pub.dev" source: hosted - version: "5.0.0+1" + version: "10.0.0" vm_service: dependency: transitive description: name: vm_service - sha256: ada49637c27973c183dad90beb6bd781eea4c9f5f955d35da172de0af7bd3440 - url: "https://pub.dev" - source: hosted - version: "11.8.0" - watcher: - dependency: transitive - description: - name: watcher - sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b - url: "https://pub.dev" - source: hosted - version: "2.4.0" - webkit_inspection_protocol: - dependency: transitive - description: - name: webkit_inspection_protocol - sha256: "67d3a8b6c79e1987d19d848b0892e582dbb0c66c57cc1fef58a177dd2aa2823d" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - xml: - dependency: transitive - description: - name: xml - sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" - url: "https://pub.dev" - source: hosted - version: "6.3.0" - yaml: - dependency: transitive - description: - name: yaml - sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "15.0.2" sdks: - dart: ">=3.0.0 <4.0.0" + dart: ">=3.10.0 <4.0.0" + flutter: ">=3.38.0 <4.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 6eee47e..b9e9ff3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,22 +2,22 @@ name: note_names description: Note Names visualizer. publish_to: "none" -version: 0.1.0 +version: 0.2.0 environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.10.0 <4.0.0" + flutter: ^3.38.0 dependencies: - diacritic: ^0.1.3 + diacritic: ^0.1.6 flutter: sdk: flutter - music_notes: ^0.11.1 + music_notes: ^0.24.0 dev_dependencies: - dart_code_metrics: ^5.7.4 flutter_test: sdk: flutter - very_good_analysis: ^5.0.0+1 + very_good_analysis: ^10.0.0 flutter: uses-material-design: true diff --git a/test/model/alphabet_test.dart b/test/model/alphabet_test.dart index 4a1968b..c8ba591 100644 --- a/test/model/alphabet_test.dart +++ b/test/model/alphabet_test.dart @@ -167,13 +167,13 @@ void main() { group('.hashCode', () { test('should remove duplicates in a Set', () { - final collection = { - // ignore: prefer_const_constructors - Alphabet.latinNaturalOrder(), - // ignore: prefer_const_constructors - Alphabet.latinNaturalOrder1(), - // ignore: prefer_const_constructors - Alphabet.latinNaturalOrder(), + final collection = { + // ignore: prefer_const_constructors for testing + .latinNaturalOrder(), + // ignore: prefer_const_constructors for testing + .latinNaturalOrder1(), + // ignore: prefer_const_constructors for testing + .latinNaturalOrder(), }; expect(collection.length, 2); }); diff --git a/test/model/cryptogram_scheme_test.dart b/test/model/cryptogram_scheme_test.dart index 1055257..a91d3c2 100644 --- a/test/model/cryptogram_scheme_test.dart +++ b/test/model/cryptogram_scheme_test.dart @@ -17,97 +17,92 @@ void main() { test('should return the musical cryptogram of name', () { final herculesDuxFerrarie = const CryptogramScheme.solmization() .cryptogramOf('Hercules Dux Ferrarie'); - expect( - herculesDuxFerrarie, - [Note.d, Note.c, Note.d, Note.c, Note.d, Note.f, Note.e, Note.d], - ); + expect(herculesDuxFerrarie, [.d, .c, .d, .c, .d, .f, .e, .d]); - final arnoldSchonberg = - const CryptogramScheme.german().cryptogramOf('A. SCHBEG'); - expect( - arnoldSchonberg, - [Note.a, Note.e.flat, Note.c, Note.b, Note.b.flat, Note.e, Note.g], + final arnoldSchonberg = const CryptogramScheme.german().cryptogramOf( + 'A. SCHBEG', ); + expect(arnoldSchonberg, [.a, .e.flat, .c, .b, .b.flat, .e, .g]); - final belaBartok = - const CryptogramScheme.french().cryptogramOf('BE BA'); - expect(belaBartok, [Note.b, Note.e, Note.b, Note.a]); - - final carlPhilipEmmanuelBach = - const CryptogramScheme.german().cryptogramOf('CFE BACH'); - expect( - carlPhilipEmmanuelBach, - [Note.c, Note.f, Note.e, Note.b.flat, Note.a, Note.c, Note.b], + final belaBartok = const CryptogramScheme.french().cryptogramOf( + 'BE BA', ); + expect(belaBartok, const [.b, .e, .b, .a]); - final dmitriSchostakowitsch = - const CryptogramScheme.german().cryptogramOf('D. SCH'); - expect(dmitriSchostakowitsch, [Note.d, Note.e.flat, Note.c, Note.b]); + final carlPhilipEmmanuelBach = const CryptogramScheme.german() + .cryptogramOf('CFE BACH'); + expect(carlPhilipEmmanuelBach, [.c, .f, .e, .b.flat, .a, .c, .b]); + final dmitriSchostakowitsch = const CryptogramScheme.german() + .cryptogramOf('D. SCH'); + expect(dmitriSchostakowitsch, [.d, .e.flat, .c, .b]); final edvardGrieg = const CryptogramScheme.french().cryptogramOf('EBG'); - expect(edvardGrieg, [Note.e, Note.b, Note.g]); - - final franzSchubert = - const CryptogramScheme.german().cryptogramOf('F. SCH'); - expect(franzSchubert, [Note.f, Note.e.flat, Note.c, Note.b]); + expect(edvardGrieg, [.e, .b, .g]); - final gustavHolst = - const CryptogramScheme.german().cryptogramOf('GSAH'); - expect(gustavHolst, [Note.g, Note.e.flat, Note.a, Note.b]); + final franzSchubert = const CryptogramScheme.german().cryptogramOf( + 'F. SCH', + ); + expect(franzSchubert, [.f, .e.flat, .c, .b]); - final jehanAlain = - const CryptogramScheme.frenchVariant().cryptogramOf('ALAIN'); - expect(jehanAlain, [Note.a, Note.d, Note.a, Note.a, Note.f]); + final gustavHolst = const CryptogramScheme.german().cryptogramOf( + 'GSAH', + ); + expect(gustavHolst, [.g, .e.flat, .a, .b]); - final johannesBrahms = - const CryptogramScheme.german().cryptogramOf('BAHS'); - expect(johannesBrahms, [Note.b.flat, Note.a, Note.b, Note.e.flat]); + final jehanAlain = const CryptogramScheme.frenchVariant().cryptogramOf( + 'ALAIN', + ); + expect(jehanAlain, [.a, .d, .a, .a, .f]); - final johannSebastianBach = - const CryptogramScheme.german().cryptogramOf('BACH'); - expect(johannSebastianBach, [Note.b.flat, Note.a, Note.c, Note.b]); + final johannesBrahms = const CryptogramScheme.german().cryptogramOf( + 'BAHS', + ); + expect(johannesBrahms, [.b.flat, .a, .b, .e.flat]); + final johannSebastianBach = const CryptogramScheme.german() + .cryptogramOf('BACH'); + expect(johannSebastianBach, [.b.flat, .a, .c, .b]); final johnCage = const CryptogramScheme.german().cryptogramOf('CAGE'); - expect(johnCage, [Note.c, Note.a, Note.g, Note.e]); + expect(johnCage, [.c, .a, .g, .e]); - final josephHaydn = - const CryptogramScheme.german().cryptogramOf('HAYDN'); - expect(josephHaydn, [Note.b, Note.a, Note.d, Note.d, Note.g]); + final josephHaydn = const CryptogramScheme.german().cryptogramOf( + 'HAYDN', + ); + expect(josephHaydn, [.b, .a, .d, .d, .g]); final metaAbegg = const CryptogramScheme.german().cryptogramOf('ABEGG'); - expect(metaAbegg, [Note.a, Note.b.flat, Note.e, Note.g, Note.g]); + expect(metaAbegg, [.a, .b.flat, .e, .g, .g]); final nielsGade = const CryptogramScheme.german().cryptogramOf('GADE'); - expect(nielsGade, [Note.g, Note.a, Note.d, Note.e]); + expect(nielsGade, [.g, .a, .d, .e]); - final paulSacher = - const CryptogramScheme.german().cryptogramOf('SACHER'); - expect( - paulSacher, - [Note.e.flat, Note.a, Note.c, Note.b, Note.e, Note.d], + final paulSacher = const CryptogramScheme.german().cryptogramOf( + 'SACHER', ); + expect(paulSacher, [.e.flat, .a, .c, .b, .e, .d]); - final robertSchumann = - const CryptogramScheme.german().cryptogramOf('SCHA'); - expect(robertSchumann, [Note.e.flat, Note.c, Note.b, Note.a]); + final robertSchumann = const CryptogramScheme.german().cryptogramOf( + 'SCHA', + ); + expect(robertSchumann, [.e.flat, .c, .b, .a]); final asch1 = const CryptogramScheme.german().cryptogramOf('ASCH'); - expect(asch1, [Note.a.flat, Note.c, Note.b]); + expect(asch1, [.a.flat, .c, .b]); final asch2 = const CryptogramScheme.german().cryptogramOf('A SCH'); - expect(asch2, [Note.a, Note.e.flat, Note.c, Note.b]); + expect(asch2, [.a, .e.flat, .c, .b]); }); }); group('.hashCode', () { test('should remove duplicates in a Set', () { - final collection = { - // ignore: prefer_const_constructors - CryptogramScheme.french(), - // ignore: prefer_const_constructors - CryptogramScheme.frenchVariant(), - // ignore: prefer_const_constructors - CryptogramScheme.french(), + final collection = { + // ignore: prefer_const_constructors for testing + .french(), + // ignore: prefer_const_constructors for testing + .frenchVariant(), + // ignore: prefer_const_constructors for testing + .french(), }; expect(collection.length, 2); }); diff --git a/test/model/name_test.dart b/test/model/name_test.dart index f3a1171..ecfe4e7 100644 --- a/test/model/name_test.dart +++ b/test/model/name_test.dart @@ -50,12 +50,17 @@ void main() { test( 'should return a new copy of this Name with overridden properties', () { - const alphabet = - Alphabet(name: 'Alphabet 1', letterToNumber: {'Z': 24}); + const alphabet = Alphabet( + name: 'Alphabet 1', + letterToNumber: {'Z': 24}, + ); const scheme = CryptogramScheme.french(); const name = Name('ABC'); - final copiedName = - name.copyWith(name: 'Z', alphabet: alphabet, scheme: scheme); + final copiedName = name.copyWith( + name: 'Z', + alphabet: alphabet, + scheme: scheme, + ); expect(copiedName.name, 'Z'); expect(copiedName.alphabet, alphabet); expect(copiedName.scheme, scheme); @@ -66,11 +71,11 @@ void main() { group('.hashCode', () { test('should remove duplicates in a Set', () { final collection = { - // ignore: prefer_const_constructors + // ignore: prefer_const_constructors for testing Name('ABC'), - // ignore: prefer_const_constructors + // ignore: prefer_const_constructors for testing Name('XYZ'), - // ignore: prefer_const_constructors + // ignore: prefer_const_constructors for testing Name('ABC'), }; expect(collection.length, 2);