attempt to add loco search indicator
All checks were successful
All checks were successful
This commit is contained in:
@@ -628,8 +628,7 @@ class _TimelineModel {
|
|||||||
for (int i = 0; i < boundaries.length - 1; i++) {
|
for (int i = 0; i < boundaries.length - 1; i++) {
|
||||||
final start = boundaries[i];
|
final start = boundaries[i];
|
||||||
final end = boundaries[i + 1];
|
final end = boundaries[i + 1];
|
||||||
final days = end.difference(start).inDays;
|
final width = yearWidth;
|
||||||
final width = days >= 365 ? yearWidth : yearWidth / 2;
|
|
||||||
final double offset = axisSegments.isEmpty
|
final double offset = axisSegments.isEmpty
|
||||||
? 0.0
|
? 0.0
|
||||||
: axisSegments.last.offset + axisSegments.last.width;
|
: axisSegments.last.offset + axisSegments.last.width;
|
||||||
|
|||||||
@@ -423,57 +423,68 @@ class _TractionPageState extends State<TractionPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
if (data.isTractionLoading && traction.isEmpty)
|
Stack(
|
||||||
const Center(
|
children: [
|
||||||
child: Padding(
|
if (data.isTractionLoading && traction.isEmpty)
|
||||||
padding: EdgeInsets.symmetric(vertical: 24.0),
|
const Padding(
|
||||||
child: CircularProgressIndicator(),
|
padding: EdgeInsets.symmetric(vertical: 32.0),
|
||||||
),
|
child: Center(child: CircularProgressIndicator()),
|
||||||
)
|
)
|
||||||
else if (traction.isEmpty)
|
else if (traction.isEmpty)
|
||||||
Card(
|
Card(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'No traction found',
|
'No traction found',
|
||||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
const Text('Try relaxing the filters or sync again.'),
|
const Text('Try relaxing the filters or sync again.'),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
else
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
...traction.map((loco) => _buildTractionCard(context, loco)),
|
|
||||||
if (data.tractionHasMore || data.isTractionLoading)
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 8.0),
|
|
||||||
child: OutlinedButton.icon(
|
|
||||||
onPressed: data.isTractionLoading
|
|
||||||
? null
|
|
||||||
: () => _refreshTraction(append: true),
|
|
||||||
icon: data.isTractionLoading
|
|
||||||
? const SizedBox(
|
|
||||||
height: 14,
|
|
||||||
width: 14,
|
|
||||||
child: CircularProgressIndicator(strokeWidth: 2),
|
|
||||||
)
|
|
||||||
: const Icon(Icons.expand_more),
|
|
||||||
label: Text(
|
|
||||||
data.isTractionLoading ? 'Loading...' : 'Load more',
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
)
|
||||||
),
|
else
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
...traction.map((loco) => _buildTractionCard(context, loco)),
|
||||||
|
if (data.tractionHasMore || data.isTractionLoading)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 8.0),
|
||||||
|
child: OutlinedButton.icon(
|
||||||
|
onPressed: data.isTractionLoading
|
||||||
|
? null
|
||||||
|
: () => _refreshTraction(append: true),
|
||||||
|
icon: data.isTractionLoading
|
||||||
|
? const SizedBox(
|
||||||
|
height: 14,
|
||||||
|
width: 14,
|
||||||
|
child: CircularProgressIndicator(strokeWidth: 2),
|
||||||
|
)
|
||||||
|
: const Icon(Icons.expand_more),
|
||||||
|
label: Text(
|
||||||
|
data.isTractionLoading ? 'Loading...' : 'Load more',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
if (data.isTractionLoading)
|
||||||
|
Positioned.fill(
|
||||||
|
child: IgnorePointer(
|
||||||
|
child: Container(
|
||||||
|
color: Theme.of(context).colorScheme.surface.withOpacity(0.6),
|
||||||
|
child: const Center(child: CircularProgressIndicator()),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user