Skip to content

Commit 35811b5

Browse files
Bug fixes. Updated README. Added LICENSE and CHANGELOG
1 parent 5b9f667 commit 35811b5

File tree

6 files changed

+71
-79
lines changed

6 files changed

+71
-79
lines changed

CHANGELOG.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
## [0.0.1] - TODO: Add release date.
1+
## [0.0.1] - 5/11/19
22

3-
* TODO: Describe initial release.
3+
* Initial Release.
4+
5+
## [0.0.2] - 5/12/19
6+
7+
* Bug fixes. Updated README. Added LICENSE and CHANGELOG

LICENSE

+9-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
TODO: Add your license here.
1+
Copyright 2019 Jonathan White <[email protected]>
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
7+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
9+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
# flutter_firestore_visual_query
22

3-
A visual way to query your firestore database for testing
3+
A visual way to query your firestore database for testing.
4+
This package provides a simple UI for querying Firebase that
5+
you can just plug into your existing code. This is useful
6+
for testing queries without having to manually create functions and run the code.
7+
It can be plugged in anyway, but a Drawer EndDrawer, or full page widget is the best option.
8+
I'm looking for suggestings, bug reports, feature requests and new UIs, pull requests and more, so feel free to contribute!
49

5-
## Getting Started
10+
## Roadmap
611

7-
This project is a starting point for a Dart
8-
[package](https://flutter.dev/developing-packages/),
9-
a library module containing code that can be shared easily across
10-
multiple Flutter or Dart projects.
12+
[ ] Support writing map objects to firebase.
13+
14+
[ ] Multiple ways of rendering widgets. Ie. Pagination for maps.
15+
16+
[ ] Support for all datatypes in widgets that make sense.
17+
18+
[ ] New UI.
1119

12-
For help getting started with Flutter, view our
13-
[online documentation](https://flutter.dev/docs), which offers tutorials,
14-
samples, guidance on mobile development, and a full API reference.

lib/src/bloc/query_event.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class NewQueryEvent extends QueryEvent {
3434
this.isGreaterThanOrEqualTo,
3535
this.arrayContains,
3636
this.isNull
37-
].where((element) => element != null).length ==
37+
].where((element) => element != null).length <=
3838
1,
3939
"only one of these can be selected for any given query."
4040
"isEqualTo: $isEqualTo,"

lib/src/firestore_query_widget.dart

+39-30
Original file line numberDiff line numberDiff line change
@@ -371,24 +371,7 @@ class DataTile extends StatelessWidget {
371371
if (data is MapEntry) {
372372
var value = data.value;
373373
if (value is Map) {
374-
return Padding(
375-
padding: EdgeInsets.only(left: 4.0 * level),
376-
child: ExpansionTile(
377-
title: Text("${data.key}"),
378-
children: <Widget>[
379-
for (var entry in value.entries)
380-
Container(
381-
decoration: BoxDecoration(
382-
border: Border(
383-
left: BorderSide(color: Colors.red, width: 2))),
384-
child: DataTile(
385-
data: entry,
386-
level: this.level + 1,
387-
),
388-
)
389-
],
390-
),
391-
);
374+
return mapWidget(key: data.key, value: data.value);
392375
} else if (value is String ||
393376
value is int ||
394377
value == null ||
@@ -417,20 +400,46 @@ class DataTile extends StatelessWidget {
417400
data is bool ||
418401
data == null ||
419402
data is DocumentReference) {
420-
return Row(
421-
children: <Widget>[
422-
if (index != null)
423-
Container(
424-
margin: EdgeInsets.symmetric(horizontal: 10),
425-
color: Colors.grey,
426-
padding: EdgeInsets.all(8),
427-
child: Text(index.toString())),
428-
Text(
429-
data is DocumentReference ? data.path : data,
430-
),
431-
],
403+
return Container(
404+
height: 15,
405+
child: Row(
406+
children: <Widget>[
407+
if (index != null)
408+
Container(
409+
margin: EdgeInsets.symmetric(horizontal: 10),
410+
color: Colors.grey,
411+
padding: EdgeInsets.all(8),
412+
child: Text(index.toString())),
413+
Text(
414+
data is DocumentReference ? data.path : data,
415+
),
416+
],
417+
),
432418
);
419+
} else if (data is Map) {
420+
return mapWidget(value: data);
433421
}
434422
return errorText(data);
435423
}
424+
425+
Widget mapWidget({String key = "", @required Map value}) {
426+
return Padding(
427+
padding: EdgeInsets.only(left: 4.0 * level),
428+
child: ExpansionTile(
429+
title: Text(key),
430+
children: <Widget>[
431+
for (var entry in value.entries)
432+
Container(
433+
decoration: BoxDecoration(
434+
border:
435+
Border(left: BorderSide(color: Colors.red, width: 2))),
436+
child: DataTile(
437+
data: entry,
438+
level: this.level + 1,
439+
),
440+
)
441+
],
442+
),
443+
);
444+
}
436445
}

pubspec.yaml

+2-36
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: flutter_firestore_visual_query
22
description: A visual way to query your firestore database for testing using Flutter
3-
version: 0.0.1
3+
version: 0.0.2
44
author: Jonathan White <[email protected]>
5-
homepage:
5+
homepage: https://github.com/ThinkDigitalRepair/flutter_firestore_visual_query
66

77
environment:
88
sdk: ">=2.2.2 <3.0.0"
@@ -20,39 +20,5 @@ dev_dependencies:
2020
flutter_test:
2121
sdk: flutter
2222

23-
# For information on the generic Dart part of this file, see the
24-
# following page: https://www.dartlang.org/tools/pub/pubspec
25-
26-
# The following section is specific to Flutter.
2723
flutter:
2824

29-
# To add assets to your package, add an assets section, like this:
30-
# assets:
31-
# - images/a_dot_burr.jpeg
32-
# - images/a_dot_ham.jpeg
33-
#
34-
# For details regarding assets in packages, see
35-
# https://flutter.dev/assets-and-images/#from-packages
36-
#
37-
# An image asset can refer to one or more resolution-specific "variants", see
38-
# https://flutter.dev/assets-and-images/#resolution-aware.
39-
40-
# To add custom fonts to your package, add a fonts section here,
41-
# in this "flutter" section. Each entry in this list should have a
42-
# "family" key with the font family name, and a "fonts" key with a
43-
# list giving the asset and other descriptors for the font. For
44-
# example:
45-
# fonts:
46-
# - family: Schyler
47-
# fonts:
48-
# - asset: fonts/Schyler-Regular.ttf
49-
# - asset: fonts/Schyler-Italic.ttf
50-
# style: italic
51-
# - family: Trajan Pro
52-
# fonts:
53-
# - asset: fonts/TrajanPro.ttf
54-
# - asset: fonts/TrajanPro_Bold.ttf
55-
# weight: 700
56-
#
57-
# For details regarding fonts in packages, see
58-
# https://flutter.dev/custom-fonts/#from-packages

0 commit comments

Comments
 (0)