Skip to content

Commit 7de26e9

Browse files
author
PeterHdd
committed
chore: version update
1 parent 5abf928 commit 7de26e9

File tree

6 files changed

+27
-36
lines changed

6 files changed

+27
-36
lines changed

firebase_database_tutorial/lib/home.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import 'package:firebase_database/firebase_database.dart';
22
import 'package:flutter/material.dart';
33

44
class Home extends StatefulWidget {
5-
Home({Key key, this.title}) : super(key: key);
6-
final String title;
5+
Home({Key? key, this.title}) : super(key: key);
6+
final String? title;
77

88
@override
99
_HomeState createState() => _HomeState();
@@ -17,14 +17,14 @@ class _HomeState extends State<Home> {
1717
Widget build(BuildContext context) {
1818
return Scaffold(
1919
appBar: AppBar(
20-
title: Text(widget.title),
20+
title: Text(widget.title!),
2121
),
2222
body: FutureBuilder(
2323
future: dbRef.once(),
2424
builder: (context, AsyncSnapshot<DataSnapshot> snapshot) {
2525
if (snapshot.hasData) {
2626
lists.clear();
27-
Map<dynamic, dynamic> values = snapshot.data.value;
27+
Map<dynamic, dynamic> values = snapshot.data!.value;
2828
values.forEach((key, values) {
2929
lists.add(values);
3030
});

firebase_database_tutorial/lib/main.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class MyApp extends StatelessWidget {
2525
}
2626

2727
class MyHomePage extends StatefulWidget {
28-
MyHomePage({Key key, this.title}) : super(key: key);
29-
final String title;
28+
MyHomePage({Key? key, this.title}) : super(key: key);
29+
final String? title;
3030

3131
@override
3232
_MyHomePageState createState() => _MyHomePageState();
@@ -37,7 +37,7 @@ class _MyHomePageState extends State<MyHomePage> {
3737
Widget build(BuildContext context) {
3838
return Scaffold(
3939
appBar: AppBar(
40-
title: Text(widget.title),
40+
title: Text(widget.title!),
4141
),
4242
body: Center(
4343
child: SingleChildScrollView(
@@ -58,7 +58,7 @@ class _MyHomePageState extends State<MyHomePage> {
5858
}
5959

6060
class RegisterPet extends StatefulWidget {
61-
RegisterPet({Key key}) : super(key: key);
61+
RegisterPet({Key? key}) : super(key: key);
6262

6363
@override
6464
_RegisterPetState createState() => _RegisterPetState();
@@ -67,7 +67,7 @@ class RegisterPet extends StatefulWidget {
6767
class _RegisterPetState extends State<RegisterPet> {
6868
final _formKey = GlobalKey<FormState>();
6969
final listOfPets = ["Cats", "Dogs", "Rabbits"];
70-
String dropdownValue = 'Cats';
70+
String? dropdownValue = 'Cats';
7171
final nameController = TextEditingController();
7272
final ageController = TextEditingController();
7373
final dbRef = FirebaseDatabase.instance.reference().child("pets");
@@ -90,7 +90,7 @@ class _RegisterPetState extends State<RegisterPet> {
9090
),
9191
// The validator receives the text that the user has entered.
9292
validator: (value) {
93-
if (value.isEmpty) {
93+
if (value!.isEmpty) {
9494
return 'Enter Pet Name';
9595
}
9696
return null;
@@ -114,12 +114,12 @@ class _RegisterPetState extends State<RegisterPet> {
114114
child: new Text(value),
115115
);
116116
}).toList(),
117-
onChanged: (String newValue) {
117+
onChanged: (String? newValue) {
118118
setState(() {
119119
dropdownValue = newValue;
120120
});
121121
},
122-
validator: (value) {
122+
validator: (dynamic value) {
123123
if (value.isEmpty) {
124124
return 'Please Select Pet';
125125
}
@@ -140,7 +140,7 @@ class _RegisterPetState extends State<RegisterPet> {
140140
),
141141
// The validator receives the text that the user has entered.
142142
validator: (value) {
143-
if (value.isEmpty) {
143+
if (value!.isEmpty) {
144144
return 'Please Pet Age';
145145
}
146146
return null;
@@ -154,7 +154,7 @@ class _RegisterPetState extends State<RegisterPet> {
154154
children: <Widget>[
155155
ElevatedButton(
156156
onPressed: () {
157-
if (_formKey.currentState.validate()) {
157+
if (_formKey.currentState!.validate()) {
158158
dbRef.push().set({
159159
"name": nameController.text,
160160
"age": ageController.text,

firebase_database_tutorial/pubspec.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,28 +63,28 @@ packages:
6363
name: firebase_core
6464
url: "https://pub.dartlang.org"
6565
source: hosted
66-
version: "1.0.3"
66+
version: "1.2.1"
6767
firebase_core_platform_interface:
6868
dependency: transitive
6969
description:
7070
name: firebase_core_platform_interface
7171
url: "https://pub.dartlang.org"
7272
source: hosted
73-
version: "4.0.0"
73+
version: "4.0.1"
7474
firebase_core_web:
7575
dependency: transitive
7676
description:
7777
name: firebase_core_web
7878
url: "https://pub.dartlang.org"
7979
source: hosted
80-
version: "1.0.2"
80+
version: "1.1.0"
8181
firebase_database:
8282
dependency: "direct main"
8383
description:
8484
name: firebase_database
8585
url: "https://pub.dartlang.org"
8686
source: hosted
87-
version: "6.1.2"
87+
version: "7.1.0"
8888
flutter:
8989
dependency: "direct main"
9090
description: flutter

firebase_database_tutorial/pubspec.yaml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,45 +18,36 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1818
version: 1.0.0+1
1919

2020
environment:
21-
sdk: ">=2.7.0 <3.0.0"
21+
sdk: '>=2.12.0 <3.0.0'
2222

2323
dependencies:
24-
firebase_core: ^1.0.3
25-
firebase_database: ^6.1.2
2624
flutter:
2725
sdk: flutter
28-
29-
30-
# The following adds the Cupertino Icons font to your application.
31-
# Use with the CupertinoIcons class for iOS style icons.
3226
cupertino_icons: ^0.1.3
27+
firebase_core: ^1.2.1
28+
firebase_database: ^7.1.0
3329

3430
dev_dependencies:
3531
flutter_test:
3632
sdk: flutter
3733

3834
# For information on the generic Dart part of this file, see the
3935
# following page: https://dart.dev/tools/pub/pubspec
40-
4136
# The following section is specific to Flutter.
4237
flutter:
4338

4439
# The following line ensures that the Material Icons font is
4540
# included with your application, so that you can use the icons in
4641
# the material Icons class.
4742
uses-material-design: true
48-
4943
# To add assets to your application, add an assets section, like this:
5044
# assets:
5145
# - images/a_dot_burr.jpeg
5246
# - images/a_dot_ham.jpeg
53-
5447
# An image asset can refer to one or more resolution-specific "variants", see
5548
# https://flutter.dev/assets-and-images/#resolution-aware.
56-
5749
# For details regarding adding assets from package dependencies, see
5850
# https://flutter.dev/assets-and-images/#from-packages
59-
6051
# To add custom fonts to your application, add a fonts section here,
6152
# in this "flutter" section. Each entry in this list should have a
6253
# "family" key with the font family name, and a "fonts" key with a

firebase_start_tutorial/pubspec.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,28 +63,28 @@ packages:
6363
name: firebase_core
6464
url: "https://pub.dartlang.org"
6565
source: hosted
66-
version: "1.0.3"
66+
version: "1.2.1"
6767
firebase_core_platform_interface:
6868
dependency: transitive
6969
description:
7070
name: firebase_core_platform_interface
7171
url: "https://pub.dartlang.org"
7272
source: hosted
73-
version: "4.0.0"
73+
version: "4.0.1"
7474
firebase_core_web:
7575
dependency: transitive
7676
description:
7777
name: firebase_core_web
7878
url: "https://pub.dartlang.org"
7979
source: hosted
80-
version: "1.0.2"
80+
version: "1.1.0"
8181
firebase_database:
8282
dependency: "direct main"
8383
description:
8484
name: firebase_database
8585
url: "https://pub.dartlang.org"
8686
source: hosted
87-
version: "6.1.2"
87+
version: "7.1.0"
8888
flutter:
8989
dependency: "direct main"
9090
description: flutter

firebase_start_tutorial/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ dependencies:
2424
flutter:
2525
sdk: flutter
2626
cupertino_icons: ^1.0.2
27-
firebase_core: ^1.0.3
28-
firebase_database: ^6.1.2
27+
firebase_core: ^1.2.1
28+
firebase_database: ^7.1.0
2929

3030
dev_dependencies:
3131
flutter_test:

0 commit comments

Comments
 (0)