v1.0.4gradient_borders
इनपुट और कंटेनर के लिए ग्रेडिएंट बॉर्डर। बॉर्डर पैकेज मूल फ्लटर विजेट्स के साथ एकीकृत है, जैसे कि कंटेनर और इनपुट डिकोरेशन। आसान उपयोग, प्लेटफॉर्म स्वतंत्र।
obiwanzenobi/gradient-borders open-source repository details.
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
Various borders that use gradient instead of boring plain colors.
Change your container borders to use fancy gradients:
Container(
width: 100,
height: 100,
decoration: BoxDecoration(
border: const GradientBoxBorder(
gradient: LinearGradient(colors: [Colors.blue, Colors.red]),
width: 4,
),
borderRadius: BorderRadius.circular(16)
),
),
Works with both: border radius, and with BoxShape.circle
| Parameter | Type | Default | Description |
|---|---|---|---|
gradient |
Gradient |
required | The gradient to use for the border color. |
width |
double |
1.0 |
The width of the border. |
strokeAlign |
double |
BorderSide.strokeAlignInside |
The alignment of the stroke relative to the border edge. Use BorderSide.strokeAlignInside (-1), BorderSide.strokeAlignCenter (0), or BorderSide.strokeAlignOutside (1). |
You can use GradientOutlineInputBorder as a part of your input decoration:
TextField(
decoration: InputDecoration(
border: GradientOutlineInputBorder(
gradient: LinearGradient(colors: [Colors.red, Colors.blue]),
width: 2,
),
focusedBorder: GradientOutlineInputBorder(
gradient: LinearGradient(colors: [Colors.yellow, Colors.green]),
width: 2
),
label: Text("Example"),
),
),
| Parameter | Type | Default | Description |
|---|---|---|---|
gradient |
Gradient |
required | The gradient to use for the border color. |
width |
double |
1.0 |
The width of the border. |
gapPadding |
double |
4.0 |
Horizontal padding around the label cutout in the border. |
borderRadius |
BorderRadius |
BorderRadius.all(Radius.circular(4)) |
The border radius of the rounded corners. |
borderAlignment |
OutlineBorderAlignment |
OutlineBorderAlignment.onEdge |
Controls where the stroke is drawn relative to the widget edge. onEdge draws the border centered on the widget boundary; inside draws it fully inside. |
You can also use GradientUnderlineInputBorder as part of your input decoration:
TextField(
decoration: InputDecoration(
border: GradientOutlineInputBorder(
gradient: LinearGradient(colors: [Colors.red, Colors.blue]),
width: 2,
),
focusedBorder: GradientUnderlineInputBorder(
gradient: LinearGradient(colors: [Colors.yellow, Colors.green]),
width: 2
),
label: Text("Example"),
),
),
निर्भरता सूची 3 आइटम
{"sdk":"flutter"}{"sdk":"flutter"}^3.1.0उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗