FLUTTER ECOSYSTEM

saquibansari0101/drop_shadow_image

用于为图像创建阴影效果的 Flutter 包,支持多种可应用属性。

drop_shadow_image 项目封面
Stars
3
Forks
0
最近推送(UTC)
2021年7月16日
项目状态
未归档
Saquib Akhtar GitHub avatar
GITHUB User

Saquib Akhtar ↗

语言DartHTMLKotlin

技术话题

此仓库发布的插件

使用的依赖

依赖清单 2 项
  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

drop_shadow_image

Package for creating drop shadow effect of an image, with lots of properties to apply.

Example

Installation

  1. Add this to your package's pubspec.yaml file:
dependencies:
  drop_shadow_image: ^0.9.0
  1. Import the package into your dart file:
import 'package:drop_shadow_image/drop_shadow_image.dart';

Example

import 'dart:ui';

import 'package:drop_shadow_image/drop_shadow_lib.dart';
import 'package:flutter/material.dart';

main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body:
        Center(
          child: DropShadowImage(
            offset: Offset(10,10),
            scale: 1,
            blurRadius: 12,
            borderRadius: 20,
            image: Image.asset('assets/cat.png',
            width: 300,),
          ),
        )
      ),
    );
  }
}

Properties of the lass

1. Key key
 
2. double scale  // Size to parent. 

3. Offset offset  // Position of shadow. (dx) for horizontal displacement (dy) for vertical displacement.

4. double blurRadius // Amount of blur in the shadow. 0 means no blur.

5. double borderRadius //  border radius of image

6. Image image (@required) // The image.