Fix some new lint warnings

This commit is contained in:
Ming Ming 2024-05-21 23:41:44 +08:00
parent 302cc3938e
commit ba2c69311b
5 changed files with 10 additions and 12 deletions

View file

@ -44,8 +44,8 @@ class _SignInState extends State<SignIn> {
Widget _buildContent(BuildContext context) { Widget _buildContent(BuildContext context) {
if (_isConnecting) { if (_isConnecting) {
return Stack( return const Stack(
children: const [ children: [
Positioned( Positioned(
left: 0, left: 0,
right: 0, right: 0,

View file

@ -107,10 +107,10 @@ class _WrappedExportCollectionDialogState
key: _formKey, key: _formKey,
child: Container( child: Container(
constraints: const BoxConstraints.tightFor(width: 280), constraints: const BoxConstraints.tightFor(width: 280),
child: Column( child: const Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: const [ children: [
_NameTextField(), _NameTextField(),
_ProviderDropdown(), _ProviderDropdown(),
SizedBox(height: 8), SizedBox(height: 8),

View file

@ -191,8 +191,7 @@ class _WrappedHomeCollectionsState extends State<_WrappedHomeCollections>
childBorderRadius: BorderRadius.zero, childBorderRadius: BorderRadius.zero,
indicatorAlignment: const Alignment(-.92, -.92), indicatorAlignment: const Alignment(-.92, -.92),
items: state.transformedItems, items: state.transformedItems,
itemBuilder: (_, __, metadata) { itemBuilder: (_, __, item) {
final item = metadata as _Item;
return _BlocSelector<int?>( return _BlocSelector<int?>(
selector: (state) => selector: (state) =>
state.itemCounts[item.collection.id], state.itemCounts[item.collection.id],
@ -209,8 +208,7 @@ class _WrappedHomeCollectionsState extends State<_WrappedHomeCollections>
onSelectionChange: (_, selected) { onSelectionChange: (_, selected) {
_bloc.add(_SetSelectedItems(items: selected.cast())); _bloc.add(_SetSelectedItems(items: selected.cast()));
}, },
onItemTap: (context, _, metadata) { onItemTap: (context, _, item) {
final item = metadata as _Item;
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
CollectionBrowser.routeName, CollectionBrowser.routeName,
arguments: arguments:

View file

@ -117,10 +117,10 @@ class _WrappedNewCollectionDialogState
key: _formKey, key: _formKey,
child: Container( child: Container(
constraints: const BoxConstraints.tightFor(width: 280), constraints: const BoxConstraints.tightFor(width: 280),
child: Column( child: const Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: const [ children: [
_NameTextField(), _NameTextField(),
_ProviderDropdown(), _ProviderDropdown(),
SizedBox(height: 8), SizedBox(height: 8),

View file

@ -62,8 +62,8 @@ class _SignInState extends State<SignIn> {
Widget _buildContent(BuildContext context) { Widget _buildContent(BuildContext context) {
if (_isConnecting) { if (_isConnecting) {
return Stack( return const Stack(
children: const [ children: [
Positioned( Positioned(
left: 0, left: 0,
right: 0, right: 0,