snippets-flutter icon indicating copy to clipboard operation
snippets-flutter copied to clipboard

feat(firestore): add samples for sum and average

Open Lyokone opened this issue 1 year ago • 2 comments

Description of what this PR is changing or adding:

_Issues fixed by this PR (if any): https://github.com/firebase/flutterfire/issues/13062

Risk Level

  • [x] No risk
  • [ ] Somewhat Risky
  • [ ] High risk

Pre-submit checklist

Lyokone avatar Aug 14 '24 06:08 Lyokone

Thanks @Lyokone ! Two comments:

  1. The current examples in the docs use the cities example, can we use that same collection for consistency? (I have added suggested edits below)
  2. Can you please also add a snippet for multiple aggregations in a query?

Thanks @thatfiredev for the review. In this case, should we also update the count snippets to use cities example?

cynthiajoan avatar Aug 14 '24 22:08 cynthiajoan

@cynthiajoan Oh, I hadn't noticed that one was using a different example. Yes, let's use cities there too please. :)

thatfiredev avatar Aug 14 '24 22:08 thatfiredev

Hmmm, not sure why CI is failing (both here and in #36), but some posts suggest upgrading packages. Can we try that @Lyokone ?

Error log for reference:

../../../../../.pub-cache/hosted/pub.dev/win32-5.0.6/lib/src/guid.dart:32:9: Error: Type 'UnmodifiableUint8ListView' not found.
  final UnmodifiableUint8ListView bytes;
        ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/win32-5.0.6/lib/src/guid.dart:32:9: Error: 'UnmodifiableUint8ListView' isn't a type.
  final UnmodifiableUint8ListView bytes;
        ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/win32-5.0.6/lib/src/guid.dart:52:17: Error: Method not found: 'UnmodifiableUint8ListView'.
    return Guid(UnmodifiableUint8ListView(guid));
                ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/win32-5.0.6/lib/src/guid.dart:56:31: Error: Method not found: 'UnmodifiableUint8ListView'.
  factory Guid.zero() => Guid(UnmodifiableUint8ListView(Uint8List(16)));
                              ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/win32-5.0.6/lib/src/guid.dart:100:17: Error: Method not found: 'UnmodifiableUint8ListView'.
    return Guid(UnmodifiableUint8ListView(Uint8List.fromList(guidAsBytes)));
                ^^^^^^^^^^^^^^^^^^^^^^^^^
Target kernel_snapshot_program failed: Exception


FAILURE: Build failed with an exception.

* Where:
Script '/home/runner/work/snippets-flutter/snippets-flutter/_flutter/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy' line: 1687

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/home/runner/work/snippets-flutter/snippets-flutter/_flutter/bin/flutter'' finished with non-zero exit value 1

thatfiredev avatar Oct 03 '24 15:10 thatfiredev

Hmmm, not sure why CI is failing (both here and in #36), but some posts suggest upgrading packages. Can we try that @Lyokone ?

Error log for reference:

../../../../../.pub-cache/hosted/pub.dev/win32-5.0.6/lib/src/guid.dart:32:9: Error: Type 'UnmodifiableUint8ListView' not found.
  final UnmodifiableUint8ListView bytes;
        ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/win32-5.0.6/lib/src/guid.dart:32:9: Error: 'UnmodifiableUint8ListView' isn't a type.
  final UnmodifiableUint8ListView bytes;
        ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/win32-5.0.6/lib/src/guid.dart:52:17: Error: Method not found: 'UnmodifiableUint8ListView'.
    return Guid(UnmodifiableUint8ListView(guid));
                ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/win32-5.0.6/lib/src/guid.dart:56:31: Error: Method not found: 'UnmodifiableUint8ListView'.
  factory Guid.zero() => Guid(UnmodifiableUint8ListView(Uint8List(16)));
                              ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/win32-5.0.6/lib/src/guid.dart:100:17: Error: Method not found: 'UnmodifiableUint8ListView'.
    return Guid(UnmodifiableUint8ListView(Uint8List.fromList(guidAsBytes)));
                ^^^^^^^^^^^^^^^^^^^^^^^^^
Target kernel_snapshot_program failed: Exception


FAILURE: Build failed with an exception.

* Where:
Script '/home/runner/work/snippets-flutter/snippets-flutter/_flutter/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy' line: 1687

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/home/runner/work/snippets-flutter/snippets-flutter/_flutter/bin/flutter'' finished with non-zero exit value 1

https://github.com/firebase/snippets-flutter/pull/38 to try fixing the CI

cynthiajoan avatar Oct 08 '24 19:10 cynthiajoan