Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicGBauer committed Jan 9, 2025
1 parent 6ecb6f1 commit ed02337
Show file tree
Hide file tree
Showing 14 changed files with 404 additions and 355 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:ffi';

import 'package:flutter/material.dart';
import 'package:status_alert/status_alert.dart';
import 'package:trelloappclone_flutter/features/carddetails/domain/card_detail_arguments.dart';
Expand Down Expand Up @@ -48,6 +46,7 @@ class _BoardScreenState extends State<BoardScreen> with Service {
trello.setSelectedBoard(args.board);
trello.setSelectedWorkspace(args.workspace);

// ignore: deprecated_member_use
return WillPopScope(
onWillPop: () async {
Navigator.pushNamed(context, "/home");
Expand Down Expand Up @@ -239,7 +238,7 @@ class _BoardScreenState extends State<BoardScreen> with Service {
BoardItem(
onTapItem: (listIndex, itemIndex, state) {
setState(() {
selectedList = listIndex!;
selectedList = listIndex;
selectedCard = index;
showCard = true;
showtheCard[index] = true;
Expand Down Expand Up @@ -423,6 +422,7 @@ class _BoardScreenState extends State<BoardScreen> with Service {
return items;
}

// ignore: non_constant_identifier_names
List<BoardList> loadBoardView(List<Listboard> Listboards) {
List<BoardListObject> data = generateBoardListObject(Listboards);
lists = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class _CardDetailsState extends State<CardDetails> with Service {

trello.setSelectedCard(args.crd);
descriptionController.text = args.crd.description ?? " ";
nameController.text = args.crd.name ?? " ";
nameController.text = args.crd.name;

return Scaffold(
appBar: (showChecklist || addCardDescription || editCardName)
Expand Down Expand Up @@ -109,8 +109,8 @@ class _CardDetailsState extends State<CardDetails> with Service {
itemBuilder: (context) {
return [
PopupMenuItem(
onTap: () => WidgetsBinding?.instance
?.addPostFrameCallback((_) {
onTap: () =>
WidgetsBinding.instance.addPostFrameCallback((_) {
showDialog<String>(
context: context,
builder: (BuildContext context) => AlertDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import '../../../utils/service.dart';
class EditLabels extends StatefulWidget {
final String cardId;

const EditLabels({Key? key, required this.cardId}) : super(key: key);
const EditLabels({super.key, required this.cardId});

@override
State<EditLabels> createState() => _EditLabelsState();
Expand Down
34 changes: 19 additions & 15 deletions demos/supabase-trello/lib/features/emptywidget/index.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: constant_identifier_names, camel_case_extensions

import 'dart:math';
import 'package:flutter/material.dart';

Expand Down Expand Up @@ -25,7 +27,8 @@ import 'package:flutter/material.dart';
/// {@end-tool}
class EmptyWidget extends StatefulWidget {
EmptyWidget({
const EmptyWidget({
super.key,
this.title,
this.subTitle,
this.image,
Expand Down Expand Up @@ -139,7 +142,7 @@ class _EmptyListWidgetState extends State<EmptyWidget>
);
},
child: Padding(
padding: EdgeInsets.all(10),
padding: const EdgeInsets.all(10),
child: Image.asset(
isPackageImage ? _packageImage.encode()! : widget.image!,
fit: BoxFit.contain,
Expand All @@ -156,7 +159,7 @@ class _EmptyListWidgetState extends State<EmptyWidget>
context, EmptyWidgetUtility.fullWidth(context) * .95),
height: EmptyWidgetUtility.getHeightDimention(
context, EmptyWidgetUtility.fullWidth(context) * .95),
decoration: BoxDecoration(boxShadow: <BoxShadow>[
decoration: const BoxDecoration(boxShadow: <BoxShadow>[
BoxShadow(
offset: Offset(0, 0),
color: Color(0xffe2e5ed),
Expand All @@ -174,7 +177,7 @@ class _EmptyListWidgetState extends State<EmptyWidget>
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
if (constraints.maxHeight > constraints.maxWidth) {
return Container(
return SizedBox(
height: constraints.maxWidth,
width: constraints.maxWidth,
child: child,
Expand All @@ -191,13 +194,13 @@ class _EmptyListWidgetState extends State<EmptyWidget>
.typography
.dense
.headlineSmall!
.copyWith(color: Color(0xff9da9c7));
.copyWith(color: const Color(0xff9da9c7));
_subtitleTextStyle = widget.subtitleTextStyle ??
Theme.of(context)
.typography
.dense
.bodyMedium!
.copyWith(color: Color(0xffabb8d6));
.copyWith(color: const Color(0xffabb8d6));
_packageImage = widget.packageImage;

bool anyImageProvided = widget.image == null && _packageImage == null;
Expand All @@ -212,27 +215,27 @@ class _EmptyListWidgetState extends State<EmptyWidget>
children: <Widget>[
if (!widget.hideBackgroundAnimation!)
RotationTransition(
child: _imageBackground(),
turns: _backgroundController,
child: _imageBackground(),
),
LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return Container(
height: constraints.maxWidth,
width: constraints.maxWidth - 30,
alignment: Alignment.center,
padding: EdgeInsets.all(10),
padding: const EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
anyImageProvided
? SizedBox()
? const SizedBox()
: Expanded(
flex: 1,
child: Container(),
),
anyImageProvided ? SizedBox() : _imageWidget(),
anyImageProvided ? const SizedBox() : _imageWidget(),
Column(
children: <Widget>[
CustomText(
Expand All @@ -242,7 +245,7 @@ class _EmptyListWidgetState extends State<EmptyWidget>
overflow: TextOverflow.clip,
textAlign: TextAlign.center,
),
SizedBox(
const SizedBox(
height: 10,
),
CustomText(
Expand All @@ -254,7 +257,7 @@ class _EmptyListWidgetState extends State<EmptyWidget>
],
),
anyImageProvided
? SizedBox()
? const SizedBox()
: Expanded(
flex: 1,
child: Container(),
Expand Down Expand Up @@ -329,14 +332,13 @@ class EmptyWidgetUtility {

class CustomText extends StatefulWidget {
const CustomText(
{Key? key,
{super.key,
this.msg,
this.style,
this.textAlign,
this.overflow,
this.context,
this.softwrap})
: super(key: key);
this.softwrap});

final BuildContext? context;
final String? msg;
Expand All @@ -345,6 +347,8 @@ class CustomText extends StatefulWidget {
final TextStyle? style;
final TextAlign? textAlign;

@override
// ignore: library_private_types_in_public_api
_CustomTextState createState() => _CustomTextState();
}

Expand Down
16 changes: 7 additions & 9 deletions demos/supabase-trello/lib/features/home/presentation/index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_expandable_fab/flutter_expandable_fab.dart';
import 'package:logging/logging.dart';
import 'package:powersync/powersync.dart' as PowerSync;
import 'package:powersync/powersync.dart' as power_sync;
import 'package:trelloappclone_flutter/features/emptywidget/index.dart';
import 'package:trelloappclone_flutter/main.dart';
import 'package:trelloappclone_flutter/models/board.dart';
import 'package:trelloappclone_flutter/models/workspace.dart';
import 'package:trelloappclone_flutter/features/board/domain/board_arguments.dart';
import 'package:trelloappclone_flutter/features/board/presentation/index.dart';
import 'package:trelloappclone_flutter/protocol/data_client.dart';
Expand All @@ -28,8 +26,8 @@ class Home extends StatefulWidget {
}

class _HomeState extends State<Home> with Service {
late PowerSync.SyncStatus _connectionState;
StreamSubscription<PowerSync.SyncStatus>? _syncStatusSubscription;
late power_sync.SyncStatus _connectionState;
StreamSubscription<power_sync.SyncStatus>? _syncStatusSubscription;

@override
void initState() {
Expand Down Expand Up @@ -93,20 +91,20 @@ class _HomeState extends State<Home> with Service {
Column(children: buildWorkspacesAndBoards(children)));
}
}
return Center(
return const Center(
child: Padding(
padding: const EdgeInsets.all(20.0),
padding: EdgeInsets.all(20.0),
child: EmptyWidget(
image: null,
packageImage: PackageImage.Image_1,
title: 'No Boards',
subTitle: 'Create your first Trello board',
titleTextStyle: const TextStyle(
titleTextStyle: TextStyle(
fontSize: 22,
color: Color(0xff9da9c7),
fontWeight: FontWeight.w500,
),
subtitleTextStyle: const TextStyle(
subtitleTextStyle: TextStyle(
fontSize: 14,
color: Color(0xffabb8d6),
),
Expand Down
6 changes: 3 additions & 3 deletions demos/supabase-trello/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:flutter/foundation.dart';
// ignore_for_file: avoid_print

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';
import 'package:trelloappclone_flutter/features/generateworkspace/presentation/index.dart';
import 'package:trelloappclone_flutter/utils/trello_provider.dart';
import 'package:trelloappclone_flutter/models/user.dart';
import 'package:trelloappclone_flutter/protocol/data_client.dart';
import 'package:logging/logging.dart';

Expand Down Expand Up @@ -71,7 +71,7 @@ void main() async {
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});

@override
Widget build(BuildContext context) {
Expand Down
Loading

0 comments on commit ed02337

Please sign in to comment.