पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

flutter_inset_shadow कवर
पैकेज विवरणv2.0.3

flutter_inset_shadow

इस पैकेज ने BoxShadow और BoxDecoration को inset गुण को समर्थन देने के लिए विस्तारित किया है।

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
22.3 हज़ार
लाइक
38
Pub अंक
150

पैकेज इंस्टॉल करें

flutter pub add flutter_inset_shadow

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

flutter_inset_shadow पैकेज बॉक्सशैडो और बॉक्सडिज़ाइन क्लासेस को inset संपत्ति के समर्थन के साथ बढ़ाता है, जिससे विकासकर्ता एक विजेट की सीमा के भीतर की छाया बनाने में सक्षम होते हैं। यह आंतरिक चमक या गहराई वाले डिज़ाइन बनाने के लिए विशेष रूप से उपयोगी है। पैकेज मौजूदा फ्लटर UI घटकों के साथ बिना किसी दिक्कत के एकीकृत होता है और सभी प्रमुख प्लेटफॉर्म जैसे Android, iOS, Web, macOS, Windows और Linux का समर्थन करता है। यह कस्टम पेंटिंग या जटिल उपायों के बिना हल्के और आधुनिक UI तत्वों के कार्यान्वयन को सरल बनाता है।

उपयोग

  • कार्ड और कंटेनर के लिए आंतरिक छाया बनाना
  • गोल या सूर्यास्त उपयोगकर्ता इंटरफेस तत्वों को डिज़ाइन करना
  • आधुनिक इंटरफेस में सूक्ष्म गहराई प्रभाव जोड़ना
  • चमकदार या इनसेट बॉर्डर प्रभाव को लागू करना
  • आ inter छाया के साथ दृश्य प्राथमिकता में सुधार

मुख्य विशेषताएँ

  • BoxShadow विस्तार के माध्यम से इनसेट छाया का समर्थन करता है
  • आंतरिक छाया रेंडरिंग के लिए BoxDecoration का विस्तार करता है
  • क्रॉस-प्लेटफॉर्म संगतता
  • मौजूदा विजेट्स के साथ सरल एकीकरण
  • आवश्यक बॉलरप्लेट कम से कम

इनके लिए उपयुक्त

  • उन्नत छाया प्रभावों की तलाश कर रहे UI डिजाइनर
  • आधुनिक, फ्लैट-डिज़ाइन एप्स बनाने वाले डेवलपर्स
  • बाहरी लाइब्रेरी के बिना सूक्ष्म गहराई की आवश्यकता वाले प्रोजेक्ट
  • बहु-प्लेटफॉर्म एप्लिकेशन के लिए फ्लटर का उपयोग करने वाली टीमें

विचार योग्य बातें

  • जटिल लेआउट में प्रदर्शन पर प्रभाव पड़ सकता है
  • मूल छाया स्टाइलिंग तक सीमित
  • अत्यधिक गतिशील या एनिमेटेड छायाओं के लिए उपयुक्त नहीं
  • विभिन्न स्क्रीन घनत्व पर सावधानीपूर्वक परीक्षण की आवश्यकता होती है

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

Flutter Inset Shadow

Flutter currently does not support the inset property for shadows. This type of shadow is for example used in Neumorphism.

This package extends BoxShadow and BoxDecoration to support the inset property.

[!IMPORTANT]

What happened to flutter_inset_box_shadow?

Previously, this package was called flutter_inset_box_shadow.

Unfortunately, I've lost access to the verified publisher, allowing me to publish updates to the package.

So I decided to publish the package under a new name.

For more information, you can read https://github.com/chitochi/flutter_inset_shadow/issues/7. 😄

Features

  • All properties of BoxShadow are supported.
  • If the property of a BoxShadow changes during a transition, we first make the old shadow disappear before making the new one appear.

Example

A simple neumorphic container

import 'package:flutter/material.dart' hide BoxDecoration, BoxShadow;
import 'package:flutter_inset_shadow/flutter_inset_shadow.dart';

void main() {
  runApp(const ExampleApp());
}

const primaryColor = Color(0xFFE0E0E0);

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Example',
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        backgroundColor: primaryColor,
        body: Center(
          child: Container(
            width: 150,
            height: 150,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(50),
              color: primaryColor,
              boxShadow: const [
                BoxShadow(
                  offset: Offset(-20, -20),
                  blurRadius: 60,
                  color: Colors.white,
                  inset: true,
                ),
                BoxShadow(
                  offset: Offset(20, 20),
                  blurRadius: 60,
                  color: Color(0xFFBEBEBE),
                  inset: true,
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

Usage

First, add the package:

flutter pub add flutter_inset_shadow

Then, import it as follows:

import 'package:flutter/material.dart' hide BoxDecoration, BoxShadow;
import 'package:flutter_inset_shadow/flutter_inset_shadow.dart';

It is necessary to hide BoxDecoration and BoxShadow because this library replaces them.

BoxShadow now has a boolean inset property, which is set to false by default.

return Container(
  decoration: BoxDecoration(
    boxShadow: [
      BoxShadow(
        blurRadius: 5,
        color: Colors.red,
      ),
      BoxShadow(
        offset: Offset(1, 2),
        blurRadius: 5,
        spreadRadius: 2,
        color: Colors.green,
        inset: true,
      ),
    ],
  ),
);

How does it work?

The algorithm used is the same as that of Blink, the Chromium rendering engine.

The idea is that we draw a rectangle hollowed out by another rounded rectangle inside, then we blur this hollowed rectangle.

श्रेणियाँ

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट