Enhanced material design 3 implementation
This commit is contained in:
@@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import '../theme/app_typography.dart';
|
||||
import '../theme/app_surfaces.dart';
|
||||
import '../theme/m3_motion.dart';
|
||||
import 'mono_text.dart';
|
||||
|
||||
/// A column configuration for the [TasQAdaptiveList] desktop table view.
|
||||
@@ -205,11 +206,18 @@ class TasQAdaptiveList<T> extends StatelessWidget {
|
||||
}
|
||||
final item = items[index];
|
||||
final actions = rowActions?.call(item) ?? const <Widget>[];
|
||||
return _MobileTile(
|
||||
item: item,
|
||||
actions: actions,
|
||||
mobileTileBuilder: mobileTileBuilder,
|
||||
onRowTap: onRowTap,
|
||||
// M3 Expressive: stagger first 8 items on enter (50 ms per step).
|
||||
final staggerDelay = Duration(
|
||||
milliseconds: math.min(index, 8) * 50,
|
||||
);
|
||||
return M3FadeSlideIn(
|
||||
delay: staggerDelay,
|
||||
child: _MobileTile(
|
||||
item: item,
|
||||
actions: actions,
|
||||
mobileTileBuilder: mobileTileBuilder,
|
||||
onRowTap: onRowTap,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -225,11 +233,17 @@ class TasQAdaptiveList<T> extends StatelessWidget {
|
||||
}
|
||||
final item = items[index];
|
||||
final actions = rowActions?.call(item) ?? const <Widget>[];
|
||||
return _MobileTile(
|
||||
item: item,
|
||||
actions: actions,
|
||||
mobileTileBuilder: mobileTileBuilder,
|
||||
onRowTap: onRowTap,
|
||||
final staggerDelay = Duration(
|
||||
milliseconds: math.min(index, 8) * 50,
|
||||
);
|
||||
return M3FadeSlideIn(
|
||||
delay: staggerDelay,
|
||||
child: _MobileTile(
|
||||
item: item,
|
||||
actions: actions,
|
||||
mobileTileBuilder: mobileTileBuilder,
|
||||
onRowTap: onRowTap,
|
||||
),
|
||||
);
|
||||
},
|
||||
shrinkWrap: true,
|
||||
@@ -294,35 +308,29 @@ class TasQAdaptiveList<T> extends StatelessWidget {
|
||||
Widget _loadingTile(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: SizedBox(
|
||||
height: 72,
|
||||
child: Card(
|
||||
margin: EdgeInsets.zero,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Card(
|
||||
margin: EdgeInsets.zero,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
child: Row(
|
||||
children: [
|
||||
M3ShimmerBox(
|
||||
width: 40,
|
||||
height: 40,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
M3ShimmerBox(height: 12),
|
||||
const SizedBox(height: 8),
|
||||
M3ShimmerBox(width: 150, height: 10),
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(height: 12, color: Colors.white),
|
||||
const SizedBox(height: 8),
|
||||
Container(height: 10, width: 150, color: Colors.white),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user