You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.8KB

  1. import 'package:flutter/material.dart';
  2. import 'package:shimmer/shimmer.dart';
  3. class LoadingListPage extends StatefulWidget {
  4. @override
  5. _LoadingListPageState createState() => _LoadingListPageState();
  6. }
  7. class _LoadingListPageState extends State<LoadingListPage> {
  8. bool _enabled = true;
  9. @override
  10. Widget build(BuildContext context) {
  11. return Scaffold(
  12. body: Container(
  13. width: double.infinity,
  14. padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
  15. child: Column(
  16. mainAxisSize: MainAxisSize.max,
  17. children: <Widget>[
  18. Expanded(
  19. child: Shimmer.fromColors(
  20. baseColor: Colors.grey[300],
  21. highlightColor: Colors.grey[100],
  22. enabled: _enabled,
  23. child: ListView.builder(
  24. itemBuilder: (_, __) => Padding(
  25. padding: const EdgeInsets.only(bottom: 8.0),
  26. child: Row(
  27. crossAxisAlignment: CrossAxisAlignment.start,
  28. children: [
  29. Container(
  30. width: 48.0,
  31. height: 48.0,
  32. color: Colors.white,
  33. ),
  34. const Padding(
  35. padding: EdgeInsets.symmetric(horizontal: 8.0),
  36. ),
  37. Expanded(
  38. child: Column(
  39. crossAxisAlignment: CrossAxisAlignment.start,
  40. children: <Widget>[
  41. Container(
  42. width: double.infinity,
  43. height: 8.0,
  44. color: Colors.white,
  45. ),
  46. const Padding(
  47. padding: EdgeInsets.symmetric(vertical: 2.0),
  48. ),
  49. Container(
  50. width: double.infinity,
  51. height: 8.0,
  52. color: Colors.white,
  53. ),
  54. const Padding(
  55. padding: EdgeInsets.symmetric(vertical: 2.0),
  56. ),
  57. Container(
  58. width: 40.0,
  59. height: 8.0,
  60. color: Colors.white,
  61. ),
  62. ],
  63. ),
  64. )
  65. ],
  66. ),
  67. ),
  68. itemCount: 20,
  69. ),
  70. ),
  71. ),
  72. ],
  73. ),
  74. ),
  75. );
  76. }
  77. }