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
from stream_chat import StreamChat | |
# instantiate your stream client using the API key and secret | |
# the secret is only used server side and gives you full access to the API | |
server_client = StreamChat( | |
api_key="xxxx", api_secret="ttttt") | |
token = server_client.create_token("admin_user") | |
# print(token) | |
if __name__ == "__main__": |
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'; | |
class AnimatedCount extends ImplicitlyAnimatedWidget { | |
const AnimatedCount({ | |
super.key, | |
required this.count, | |
super.duration = const Duration(milliseconds: 600), | |
super.curve = Curves.fastOutSlowIn, | |
required this.formatter, | |
this.style, |
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'; | |
class HideableWidgetController { | |
_HideableBottomWidgetWhenScrollingState? _state; | |
// Internal method to attach the state | |
void _addState(_HideableBottomWidgetWhenScrollingState state) { | |
_state = state; | |
} |
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:ui' as ui; | |
import 'package:flutter/foundation.dart'; | |
import 'package:photo_manager/photo_manager.dart'; | |
import 'package:flutter/material.dart'; | |
class PhotoAssetEntityImageProvider extends ImageProvider<String> { | |
const PhotoAssetEntityImageProvider(this.photoId); |
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
name: qat_apk on pgy | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./app/xxxxxx |
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:wechat_assets_picker/wechat_assets_picker.dart'; | |
import 'package:wechat_camera_picker/wechat_camera_picker.dart'; | |
Future<void> showAssetsPicker( | |
BuildContext context, | |
bool forVideo, | |
int maxCount, { | |
required Function(BuildContext, List<AssetEntity>? result) handleResult, |
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
private func resolutionForVideo(url: URL) -> CGSize? { | |
guard let track = AVURLAsset(url: url).tracks(withMediaType: AVMediaType.video).first else { return nil } | |
let size = track.naturalSize.applying(track.preferredTransform) | |
return CGSize(width: abs(size.width), height: abs(size.height)) | |
} | |
@objc func tapped(recognizer :UIGestureRecognizer) { | |
guard let currentFrame = self.sceneView.session.currentFrame else { | |
return |
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:http/http.dart'; | |
static Future downloadFragmentedFile(String url, File localFile) async { | |
final request = Request('get', Uri.parse(url)); | |
request.headers.addAll({"range": "bytes=0-"}); | |
StreamedResponse rs = await Client().send(request); | |
var fileStream = localFile.openWrite(); | |
await rs.stream.pipe(fileStream); | |
} |
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
echo ">>>Creating flutter project:$1"; | |
flutter create $1 | |
cd $1 | |
#添加常用Packages | |
flutter pub add equatable | |
flutter pub add flutter_bloc | |
flutter pub add intl | |
flutter pub add flutter_svprogresshud | |
flutter pub add shared_preferences | |
flutter pub add package_info_plus |
NewerOlder