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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" | |
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> | |
<title>Amaze UI 在线调试</title> | |
<link rel="stylesheet" href="http://cdn.amazeui.org/amazeui/2.5.0/css/amazeui.min.css"/> | |
</head> |
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
Please add below in ‘pubspec.yaml’: | |
webview_flutter: ^0.3.5+2 | |
oktoast: ^2.0.0 | |
import 'dart:async'; | |
import 'package:flutter/material.dart'; | |
import 'package:webview_flutter/webview_flutter.dart'; | |
import 'package:oktoast/oktoast.dart'; |
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
fun BaseQuickAdapter<*, BaseViewHolder>.shotRecyclerView( | |
recyclerView: RecyclerView, bgColor: Int? = null): Bitmap { | |
val size = itemCount | |
var height = 0 | |
val maxMemory: Int = ((Runtime.getRuntime().maxMemory() / 1024).toInt()) | |
// Use 1/8th of the available memory for this memory cache. | |
val cacheSize = maxMemory / 8 | |
val bitmapCache: LruCache<String, Bitmap> = LruCache(cacheSize) | |
for (i in 0 until size) { | |
var itemView: View? |
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
/** | |
* 拼接bitmap | |
* @param bgColor 画布颜色,默认为null,透明色 | |
*/ | |
fun combineBitmaps(vararg bitmaps: Bitmap, bgColor: Int? = null, direction: CombineDirection = CombineDirection.Vertical, maxLength: Int? = null): Bitmap { | |
var height = 0 | |
var width = 0 | |
// 计算组合后宽高 | |
loop@ for (bitmap in bitmaps) { | |
when (direction) { |
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
import 'dart:convert'; | |
import 'dart:io'; | |
String fileToBase64(File file){ | |
var imageByte = file.readAsBytesSync(); | |
return base64Encode(imageByte); | |
} |
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
ShaderMask( | |
blendMode: BlendMode.srcIn, | |
shaderCallback: (Rect bounds) { | |
return ui.Gradient.linear( | |
Offset(4.0, 24.0), | |
Offset(24.0, 4.0), | |
[ | |
Colors.blue[200], | |
Colors.amber, | |
], |
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
final Shader linearGradient = LinearGradient( | |
colors: <Color>[Colors.pink, Colors.green], | |
).createShader(Rect.fromLTWH(0.0, 0.0, 200.0, 70.0)); | |
Text('Hello Gradients!', | |
style: new TextStyle( | |
fontSize: 60.0, | |
fontWeight: FontWeight.bold, | |
foreground: Paint()..shader = linearGradient), | |
) |