Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added network indicator #23

Open
wants to merge 3 commits into
base: lesson-27
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions brew_crew/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"cloud_firestore","path":"C:\\\\Users\\\\User1\\\\AppData\\\\Roaming\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\cloud_firestore-0.12.9+4\\\\","dependencies":["firebase_core"]},{"name":"firebase_auth","path":"C:\\\\Users\\\\User1\\\\AppData\\\\Roaming\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_auth-0.14.0+5\\\\","dependencies":["firebase_core"]},{"name":"firebase_core","path":"C:\\\\Users\\\\User1\\\\AppData\\\\Roaming\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_core-0.4.0+9\\\\","dependencies":[]}],"android":[{"name":"cloud_firestore","path":"C:\\\\Users\\\\User1\\\\AppData\\\\Roaming\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\cloud_firestore-0.12.9+4\\\\","dependencies":["firebase_core"]},{"name":"firebase_auth","path":"C:\\\\Users\\\\User1\\\\AppData\\\\Roaming\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_auth-0.14.0+5\\\\","dependencies":["firebase_core"]},{"name":"firebase_core","path":"C:\\\\Users\\\\User1\\\\AppData\\\\Roaming\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_core-0.4.0+9\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"cloud_firestore","dependencies":["firebase_core"]},{"name":"firebase_auth","dependencies":["firebase_core"]},{"name":"firebase_core","dependencies":[]}],"date_created":"2021-01-21 16:47:21.133258","version":"1.22.5"}
15 changes: 15 additions & 0 deletions brew_crew/lib/screens/home/brew_tile.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:brew_crew/models/brew.dart';
import 'package:data_connection_checker/data_connection_checker.dart';
import 'package:flutter/material.dart';

class BrewTile extends StatelessWidget {
Expand All @@ -20,6 +21,20 @@ class BrewTile extends StatelessWidget {
),
title: Text(brew.name),
subtitle: Text('Takes ${brew.sugars} sugar(s)'),
trailing: StreamBuilder(
stream: DataConnectionChecker().onStatusChange,
builder: (context, snapshot) {
if (snapshot.data == DataConnectionStatus.connected){
return Icon(Icons.lens,
color: Colors.green,);
}else if (snapshot.data == DataConnectionStatus.disconnected){
return Icon(Icons.lens,
color: Colors.red,);
}else
return Icon(Icons.lens,
color: Colors.grey,);
}
),
),
),
);
Expand Down
74 changes: 44 additions & 30 deletions brew_crew/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,35 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.0"
version: "2.5.0-nullsafety.1"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "2.1.0-nullsafety.1"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.3"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
version: "1.2.0-nullsafety.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.1"
cloud_firestore:
dependency: "direct main"
description:
Expand All @@ -35,14 +49,28 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.11"
version: "1.15.0-nullsafety.3"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
data_connection_checker:
dependency: "direct main"
description:
name: data_connection_checker
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.4"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.1"
firebase_auth:
dependency: "direct main"
description:
Expand Down Expand Up @@ -80,42 +108,28 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.5"
version: "0.12.10-nullsafety.1"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.7"
version: "1.3.0-nullsafety.3"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.4"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0+1"
version: "1.8.0-nullsafety.1"
provider:
dependency: "direct main"
description:
name: provider
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.0"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -127,56 +141,56 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.5"
version: "1.8.0-nullsafety.2"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.3"
version: "1.10.0-nullsafety.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0-nullsafety.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "1.1.0-nullsafety.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0-nullsafety.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.5"
version: "0.2.19-nullsafety.2"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
version: "1.3.0-nullsafety.3"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.1.0-nullsafety.3"
sdks:
dart: ">=2.2.2 <3.0.0"
dart: ">=2.10.0-110 <2.11.0"
flutter: ">=1.5.0 <2.0.0"
1 change: 1 addition & 0 deletions brew_crew/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies:
cloud_firestore: ^0.12.9+4
provider: ^3.1.0
flutter_spinkit: "^4.0.0"
data_connection_checker: ^0.3.4

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
Expand Down