Stop using deprecated members in example

This commit is contained in:
Simon Binder 2021-09-10 11:51:04 +02:00
parent 40bc3a17bb
commit 24f6ec5c01
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
7 changed files with 30 additions and 14 deletions

View File

@ -58,7 +58,6 @@ abstract class Table extends HasResultSet {
/// See also:
/// - https://www.sqlite.org/syntax/table-constraint.html, which defines what
/// table constraints are supported.
@visibleForOverriding
List<String> get customConstraints => [];
/// Use this as the body of a getter to declare a column that holds integers.

View File

@ -8,6 +8,7 @@ class Transaction extends DatabaseConnectionUser {
final DatabaseConnectionUser _parent;
@override
// ignore: invalid_use_of_visible_for_overriding_member
GeneratedDatabase get attachedDatabase => _parent.attachedDatabase;
/// Constructs a transaction executor from the [_parent] engine and the
@ -92,6 +93,7 @@ class BeforeOpenRunner extends DatabaseConnectionUser {
final DatabaseConnectionUser _parent;
@override
// ignore: invalid_use_of_visible_for_overriding_member
GeneratedDatabase get attachedDatabase => _parent.attachedDatabase;
/// Creates a [BeforeOpenRunner] from a [DatabaseConnectionUser] and the

View File

@ -35,9 +35,13 @@ class _AddCategoryDialogState extends State<AddCategoryDialog> {
),
ButtonBar(
children: [
FlatButton(
TextButton(
child: const Text('Add'),
textColor: Theme.of(context).accentColor,
style: ButtonStyle(
foregroundColor: MaterialStateProperty.all(
Theme.of(context).colorScheme.secondary,
),
),
onPressed: _addEntry,
),
],

View File

@ -38,9 +38,13 @@ class CategoriesDrawer extends StatelessWidget {
const Spacer(),
Row(
children: <Widget>[
FlatButton(
TextButton(
child: const Text('Add category'),
textColor: Theme.of(context).accentColor,
style: ButtonStyle(
foregroundColor: MaterialStateProperty.all(
Theme.of(context).colorScheme.secondary,
),
),
onPressed: () {
showDialog(
context: context, builder: (_) => AddCategoryDialog());
@ -77,7 +81,8 @@ class _CategoryDrawerEntry extends StatelessWidget {
title,
style: TextStyle(
fontWeight: FontWeight.bold,
color: isActive ? Theme.of(context).accentColor : Colors.black,
color:
isActive ? Theme.of(context).colorScheme.secondary : Colors.black,
),
),
Padding(
@ -107,9 +112,11 @@ class _CategoryDrawerEntry extends StatelessWidget {
Navigator.pop(context, false);
},
),
FlatButton(
TextButton(
child: const Text('Delete'),
textColor: Colors.red,
style: ButtonStyle(
foregroundColor: MaterialStateProperty.all(Colors.red),
),
onPressed: () {
Navigator.pop(context, true);
},

View File

@ -72,7 +72,7 @@ class HomeScreenState extends State<HomeScreen> {
),
IconButton(
icon: Icon(Icons.send),
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
onPressed: _createTodoEntry,
),
],

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:moor_example/bloc.dart';
import 'package:moor_example/database/database.dart';
import 'package:intl/intl.dart';
import 'package:moor_example/widgets/todo_edit_dialog.dart';
import 'package:provider/provider.dart';

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:moor_example/bloc.dart';
import 'package:moor_example/database/database.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
final _dateFormat = DateFormat.yMMMd();
@ -80,14 +80,18 @@ class _TodoEditDialogState extends State<TodoEditDialog> {
],
),
actions: [
FlatButton(
TextButton(
child: const Text('Cancel'),
textColor: Colors.black,
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
const TextStyle(color: Colors.black),
),
),
onPressed: () {
Navigator.pop(context);
},
),
FlatButton(
TextButton(
child: const Text('Save'),
onPressed: () {
final updatedContent = textController.text;