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 Photos; | |
@import AVKit; | |
[PHPhotoLibrary.sharedPhotoLibrary performChanges:^{ | |
NSURL *url = [NSURL fileURLWithPath:[FileUtil filePath:fileName]]; | |
[PHAssetChangeRequest creationRequestForAssetFromVideoAtFileURL:url]; | |
} completionHandler:^(BOOL success, NSError * _Nullable error) { | |
if (error) { | |
NSLog(@"Error : %@", error); |
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/foundation.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'package:flutter/material.dart'; | |
const Duration _kBottomSheetDuration = Duration(milliseconds: 200); | |
const double _kMinFlingVelocity = 700.0; | |
const double _kCloseProgressThreshold = 0.5; |
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 'dart:convert'; | |
import 'dart:core'; | |
import 'dart:io'; | |
import 'package:http/http.dart' as http; | |
typedef OnUploadProgressCallback = void Function(int sentBytes, int totalBytes); | |
Future<String> fileUpload({@required File file, OnUploadProgressCallback onUploadProgress}) async { | |
assert(file != null); |
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
class CustomScaffold extends StatelessWidget { | |
const CustomScaffold._({ | |
Key key, | |
this.title, | |
this.color, | |
this.sliverChildDelegate, | |
this.padding = const EdgeInsets.symmetric(horizontal: 20, vertical: 10), | |
this.actions, | |
this.onRefresh, | |
}) : super(key: key); |
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 dayjs from 'dayjs' | |
import React from 'react' | |
import { Controlled as CodeMirror } from 'react-codemirror2' | |
import { useDispatch, useSelector } from 'react-redux' | |
import { getActiveNote } from '@/utils/helpers' | |
import { updateNote } from '@/slices/note' | |
import { togglePreviewMarkdown } from '@/slices/settings' | |
import { NoteItem } from '@/types' | |
import { EmptyEditor } from '@/components/Editor/EmptyEditor' |
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 React from "react"; | |
import PropTypes from "prop-types"; | |
import DimensionConsumer from "./DimensionContext"; | |
import { getScreenWidth, getScreenHeight } from "./selectors"; | |
const ScreenConsumer = ({ children }) => { | |
return ( | |
<DimensionConsumer> | |
{dimensions => | |
children(getScreenWidth(dimensions), getScreenHeight(dimensions)) |
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 React from "react"; | |
import PropTypes from "prop-types"; | |
import DimensionConsumer from "./DimensionContext"; | |
import { getScreenWidth, getScreenHeight } from "./selectors"; | |
const ScreenConsumer = ({ children }) => { | |
return ( | |
<DimensionConsumer> | |
{dimensions => | |
children(getScreenWidth(dimensions), getScreenHeight(dimensions)) |
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
// | |
// RemoteImage.swift | |
// List | |
// | |
// Created by noda on 12/13/20. | |
// | |
import SwiftUI | |
struct RemoteImage: View { |
OlderNewer