mirror of
https://github.com/timokz/flutter-vienna-hackathon-25.git
synced 2025-11-08 21:24:20 +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) {
|
void _upsert(Quote q) {
|
||||||
final i = _quotes.indexWhere((x) => x.id == q.id);
|
final i = _quotes.indexWhere((x) => x.id == q.id);
|
||||||
if (i >= 0)
|
if (i >= 0) {
|
||||||
_quotes[i] = q;
|
_quotes[i] = q;
|
||||||
else
|
} else {
|
||||||
_quotes.add(q);
|
_quotes.add(q);
|
||||||
|
}
|
||||||
_quotes.sort((a, b) => b.createdAt.compareTo(a.createdAt));
|
_quotes.sort((a, b) => b.createdAt.compareTo(a.createdAt));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -103,7 +104,7 @@ class _LatestQuotesScreenState extends State<LatestQuotesScreen> {
|
||||||
builder: (context, constraints) {
|
builder: (context, constraints) {
|
||||||
final unboundedHeight = constraints.maxHeight == double.infinity;
|
final unboundedHeight = constraints.maxHeight == double.infinity;
|
||||||
|
|
||||||
final list = ListView.separated(
|
return ListView.separated(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||||
shrinkWrap: unboundedHeight,
|
shrinkWrap: unboundedHeight,
|
||||||
physics: 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});
|
const NewsInputForm({super.key, required this.onSubmit});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
// ignore: library_private_types_in_public_api
|
||||||
_NewsInputFormState createState() => _NewsInputFormState();
|
_NewsInputFormState createState() => _NewsInputFormState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -45,7 +46,7 @@ class _NewsInputFormState extends State<NewsInputForm> {
|
||||||
try {
|
try {
|
||||||
await widget.onSubmit(newsData);
|
await widget.onSubmit(newsData);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (context.mounted) {
|
if (mounted) {
|
||||||
ErrorSnackbar().show(context, error.toString());
|
ErrorSnackbar().show(context, error.toString());
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue