feat(firestore): add samples for sum and average
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
- [ ] This PR follows the Google Developer Documentation Style Guidelines
- [ ] This PR uses semantic line breaks
Thanks @Lyokone ! Two comments:
- The current examples in the docs use the
citiesexample, can we use that same collection for consistency? (I have added suggested edits below)- 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 Oh, I hadn't noticed that one was using a different example. Yes, let's use cities there too please. :)
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
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