Comments (1)
You can achieve that by using Shimmer
constructor with the gradient
field. The width might be controlled by stops
and the angle by setting the correct alignment
(begin
and end
). Here is a tilted narrow example:
import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: Column(
children: [
const SizedBox(
width: 200.0,
height: 100.0,
child: Shimmer(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: <Color>[
Colors.red,
Colors.red,
Colors.yellow,
Colors.red,
Colors.red,
],
stops: <double>[
0.0,
0.48,
0.5,
0.52,
1.0
]),
child: Text(
'Shimmer',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 40.0,
fontWeight: FontWeight.bold,
),
),
),
),
SizedBox(
width: 200.0,
height: 100.0,
child: Shimmer.fromColors(
baseColor: Colors.red,
highlightColor: Colors.yellow,
child: const Text(
'Shimmer',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 40.0,
fontWeight: FontWeight.bold,
),
),
),
),
],
))));
}
}
from flutter_shimmer.
Related Issues (20)
- shimmer changes color of child button
- Shimmer on flutter web throwing UnimplementedError
- Animation is taking whole element not individual widgets HOT 1
- Shimmer
- error shimmer on ios browser
- Please merge to Flutter 3.0 HOT 2
- WARNING: Too many active WebGL contexts. Oldest context will be lost. HOT 2
- [BUG] Shimmer is being cut after resize window WEB HOT 3
- Shimmer makes Text disappear in buttons and containers HOT 1
- Add `onFinished` callback
- Extremely high CPU usage causing phone to overheat HOT 14
- [BUG] period changed not apply when setState HOT 2
- It's not a bug, ask a question! HOT 1
- Shimmer issue HOT 3
- ShimmerDirection.ttb cuts off with Shimmer.fromColors HOT 1
- Shimmer on flutter web throwing NoSuchMethodError HOT 3
- Insert a pause between effects
- GoldenTests not matching local machine
- Shimmer on flutter web causing spam network request
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_shimmer.