mirror of https://github.com/AMT-Cheif/drift.git
Stop using deprecated members in example
This commit is contained in:
parent
40bc3a17bb
commit
24f6ec5c01
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
),
|
||||
],
|
||||
|
|
|
@ -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);
|
||||
},
|
||||
|
|
|
@ -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,
|
||||
),
|
||||
],
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue