mirror of
https://github.com/timokz/flutter-vienna-hackathon-25.git
synced 2025-11-08 17:14:21 +01:00
address linter warnigns
This commit is contained in:
parent
47cfb949ac
commit
37fbaf4f72
2 changed files with 6 additions and 8 deletions
|
|
@ -45,10 +45,11 @@ class _LatestQuotesScreenState extends State<LatestQuotesScreen> {
|
|||
|
||||
void _upsert(Quote q) {
|
||||
final i = _quotes.indexWhere((x) => x.id == q.id);
|
||||
if (i >= 0)
|
||||
if (i >= 0) {
|
||||
_quotes[i] = q;
|
||||
else
|
||||
} else {
|
||||
_quotes.add(q);
|
||||
}
|
||||
_quotes.sort((a, b) => b.createdAt.compareTo(a.createdAt));
|
||||
}
|
||||
|
||||
|
|
@ -103,7 +104,7 @@ class _LatestQuotesScreenState extends State<LatestQuotesScreen> {
|
|||
builder: (context, constraints) {
|
||||
final unboundedHeight = constraints.maxHeight == double.infinity;
|
||||
|
||||
final list = ListView.separated(
|
||||
return ListView.separated(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
shrinkWrap: unboundedHeight,
|
||||
physics: unboundedHeight
|
||||
|
|
@ -127,10 +128,6 @@ class _LatestQuotesScreenState extends State<LatestQuotesScreen> {
|
|||
);
|
||||
},
|
||||
);
|
||||
|
||||
return unboundedHeight
|
||||
? list
|
||||
: RefreshIndicator(onRefresh: () async {}, child: list);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ class NewsInputForm extends StatefulWidget {
|
|||
const NewsInputForm({super.key, required this.onSubmit});
|
||||
|
||||
@override
|
||||
// ignore: library_private_types_in_public_api
|
||||
_NewsInputFormState createState() => _NewsInputFormState();
|
||||
}
|
||||
|
||||
|
|
@ -45,7 +46,7 @@ class _NewsInputFormState extends State<NewsInputForm> {
|
|||
try {
|
||||
await widget.onSubmit(newsData);
|
||||
} catch (error) {
|
||||
if (context.mounted) {
|
||||
if (mounted) {
|
||||
ErrorSnackbar().show(context, error.toString());
|
||||
}
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue