Fix analysis warnings in `drift_sqflite` example

This commit is contained in:
Simon Binder 2022-03-14 21:39:16 +01:00
parent fb64c7404f
commit ece91869f6
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
5 changed files with 8 additions and 4 deletions

View File

@ -1,5 +1,4 @@
import 'package:example/database/database.dart';
import 'package:drift_sqflite/drift_sqflite.dart';
import 'package:drift/drift.dart';
import 'package:rxdart/rxdart.dart';

View File

@ -19,7 +19,7 @@ class MyApp extends StatelessWidget {
primarySwatch: Colors.orange,
typography: Typography.material2018(),
),
home: HomeScreen(),
home: const HomeScreen(),
),
);
}

View File

@ -3,6 +3,8 @@ import 'package:example/bloc.dart';
import 'package:provider/provider.dart';
class AddCategoryDialog extends StatefulWidget {
const AddCategoryDialog({Key? key}) : super(key: key);
@override
_AddCategoryDialogState createState() => _AddCategoryDialogState();
}

View File

@ -49,7 +49,8 @@ class CategoriesDrawer extends StatelessWidget {
),
onPressed: () {
showDialog(
context: context, builder: (_) => AddCategoryDialog());
context: context,
builder: (_) => const AddCategoryDialog());
},
),
],

View File

@ -9,6 +9,8 @@ import 'package:provider/provider.dart';
// ignore_for_file: prefer_const_constructors
class HomeScreen extends StatefulWidget {
const HomeScreen({Key? key}) : super(key: key);
@override
HomeScreenState createState() {
return HomeScreenState();
@ -33,7 +35,7 @@ class HomeScreenState extends State<HomeScreen> {
body: StreamBuilder<List<EntryWithCategory>>(
stream: bloc.homeScreenEntries,
builder: (context, snapshot) {
print(snapshot);
debugPrint(snapshot.toString());
if (!snapshot.hasData) {
return const Align(