forked from hnvn/flutter_shimmer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1246dd4
commit b9cc4b4
Showing
5 changed files
with
160 additions
and
166 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class BannerPlaceholder extends StatelessWidget { | ||
const BannerPlaceholder({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
width: double.infinity, | ||
height: 200.0, | ||
margin: const EdgeInsets.all(16.0), | ||
decoration: BoxDecoration( | ||
borderRadius: BorderRadius.circular(12.0), | ||
color: Colors.white, | ||
), | ||
); | ||
} | ||
} | ||
|
||
class TitlePlaceholder extends StatelessWidget { | ||
final double width; | ||
|
||
const TitlePlaceholder({ | ||
Key? key, | ||
required this.width, | ||
}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 16.0), | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Container( | ||
width: width, | ||
height: 12.0, | ||
color: Colors.white, | ||
), | ||
SizedBox(height: 8.0), | ||
Container( | ||
width: width, | ||
height: 12.0, | ||
color: Colors.white, | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} | ||
|
||
enum ContentLineType { | ||
twoLines, | ||
thressLines, | ||
} | ||
|
||
class ContentPlaceholder extends StatelessWidget { | ||
final ContentLineType lineType; | ||
|
||
const ContentPlaceholder({ | ||
Key? key, | ||
required this.lineType, | ||
}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 16.0), | ||
child: Row( | ||
mainAxisSize: MainAxisSize.max, | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
Container( | ||
width: 96.0, | ||
height: 72.0, | ||
decoration: BoxDecoration( | ||
borderRadius: BorderRadius.circular(12.0), | ||
color: Colors.white, | ||
), | ||
), | ||
const SizedBox(width: 12.0), | ||
Expanded( | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Container( | ||
width: double.infinity, | ||
height: 10.0, | ||
color: Colors.white, | ||
margin: const EdgeInsets.only(bottom: 8.0), | ||
), | ||
if (lineType == ContentLineType.thressLines) | ||
Container( | ||
width: double.infinity, | ||
height: 10.0, | ||
color: Colors.white, | ||
margin: const EdgeInsets.only(bottom: 8.0), | ||
), | ||
Container( | ||
width: 100.0, | ||
height: 10.0, | ||
color: Colors.white, | ||
) | ||
], | ||
), | ||
) | ||
], | ||
), | ||
); | ||
} | ||
} |