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 'package:flutter/material.dart'; | |
import 'package:pinyin/pinyin.dart'; | |
class PinyinCompareResult { | |
final bool isMatch; | |
final String pinyin; | |
final Map<int, bool> matchIndex; | |
PinyinCompareResult({ | |
required this.isMatch, |
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 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', |
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:async'; | |
import 'package:flutter/material.dart'; | |
class MeasureWidget extends StatefulWidget { | |
final Widget child; | |
final ValueSetter<Rect> measureRect; | |
final BoxConstraints boxConstraints; | |
const MeasureWidget({ |
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
// Thanks to: https://gist.github.com/bennyhuo/af7c43cc4831661193605e124f539942 | |
println("The init script init.gradle.kts is running!") | |
val gradleHome = System.getProperty("user.home") + "/.gradle" | |
apply { | |
val gradleVersion = gradle.gradleVersion | |
if (gradleVersion < "6.8") { | |
from(gradleHome + "/old.gradle.kts") | |
} else { |
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
# Add dayjs dep first | |
pnpm add dayjs |
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
// Thanks to: https://gist.github.com/bennyhuo/af7c43cc4831661193605e124f539942 | |
val localMavenUrl = "http://localhost:8081/repository/maven-public/" | |
val urlMappings = mapOf( | |
"https://dl.google.com/dl/android/maven2" to localMavenUrl, | |
"https://repo.maven.apache.org/maven2" to localMavenUrl, | |
"https://plugins.gradle.org/m2" to localMavenUrl, | |
) |
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
// 转换数字为中文大写 | |
// 比如:123456789.12 转换为 壹亿贰仟叁佰肆拾伍万陆仟柒佰捌拾玖元壹角贰分 | |
String convertNumberToChinese(double number) { | |
final numberText = number.toStringAsFixed(2); | |
final numberTextList = numberText.split('.'); | |
final integerText = numberTextList[0]; | |
final decimalText = numberTextList[1]; | |
final integerTextList = integerText.split(''); | |
final decimalTextList = decimalText.split(''); |
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
#!/bin/bash | |
NDK=/Volumes/Samsung-T5/sdk/android-ndk-r21b | |
TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/darwin-x86_64 | |
API=21 | |
function build_android() { | |
cd ffmpeg-4.3.1 | |
echo "Compiling FFmpeg for $CPU" | |
./configure \ |
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
# remove iOS bitcode | |
flutter build ios | |
cd build/ios/iphoneos/Runner.app/Frameworks | |
cd App.framework | |
xcrun bitcode_strip -r app -o app | |
cd .. | |
cd Flutter.framework | |
xcrun bitcode_strip -r Flutter -o Flutter | |
cd ../../../../../../ |
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 'package:flutter/material.dart'; | |
import 'scale_text_widget.dart'; | |
class MyApp extends StatefulWidget { | |
@override | |
_MyAppState createState() => _MyAppState(); | |
} | |
class _MyAppState extends State<MyApp> { | |
@override |
NewerOlder