This file contains hidden or 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 hidden or 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
main(List<String> arguments) { | |
final r = RegExp(r'\s(@(\S+))'); | |
final str = '@abc adkj sfksjdlfj@@@fjdlksjf @abc@aa df @@@ccc @dfj @你好'; | |
final matches = r.allMatches(" " + str); | |
for (final match in matches) { | |
// print(match.group(1)); // 带@符号的 | |
print(match.group(2)); // 不带@符号的 | |
} | |
} |
This file contains hidden or 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 hidden or 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
void main() { | |
print(range(100, start: 1, step: 7)); | |
} | |
Iterable<int> range(int end, {int start = 0, int step = 1}) sync* { | |
assert(step >= 1); | |
int r = start; | |
while (r < end) { | |
yield r; |
This file contains hidden or 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
package top.kikt.imagescanner.util | |
import android.os.Handler | |
import android.os.Looper | |
import io.flutter.plugin.common.MethodChannel | |
class ResultHandler(var result: MethodChannel.Result?) { | |
companion object { |
This file contains hidden or 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
typedef void ForEachHandle<T>(int index, T item); | |
extension _A<T> on List<T> { | |
void forEachIndexed(void func(int index, T item)) { | |
for (var i = 0; i < this.length; i++) { | |
func(i, this[i]); | |
} | |
} | |
void forEachIndexed2(void Function(int index, T item) func) { |
This file contains hidden or 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 'dart:collection'; | |
import 'dart:math'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override |
This file contains hidden or 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( | |
MaterialApp( | |
home: Container( | |
color: Colors.red, | |
child: Stack( | |
children: [ | |
Align( |
This file contains hidden or 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 ../../../../../../ |