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 'dart:typed_data'; | |
import 'package:extended_image/extended_image.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:image_editor/image_editor.dart'; | |
import 'const/resource.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { |
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'; | |
class ThrottleWrapper extends StatefulWidget { | |
final Duration throttleDuration; | |
final Widget child; | |
final Function onTap; | |
const ThrottleWrapper({ | |
Key key, | |
this.throttleDuration, |
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
int dayOfMonth(int year, int month) { | |
return DateTime(year, month + 1, 1).subtract(Duration(days: 1)).day; | |
} |
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
static Future<Uint8List> getImageFromEditorKey( | |
GlobalKey<ExtendedImageEditorState> editorKey) async { | |
Uint8List result; | |
final provider = | |
editorKey.currentState.widget.extendedImageState.imageProvider; | |
if (provider is AssetImage) { | |
ByteData byteData; | |
if (provider.package == null) { | |
byteData = await rootBundle.load(provider.assetName); | |
} else { |
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 'package:provider/provider.dart'; | |
class BaseProvider extends ChangeNotifier { | |
RouteHelper get route => RouteHelper(); | |
T getProvider<T>() { | |
return Provider.of<T>(route.navigatorKey.currentContext); | |
} | |
} |
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 'dart:async'; | |
import 'dart:io'; | |
main(List<String> arguments) async { | |
// final path = "timg.jpg"; | |
// final path = "/Users/cai/Desktop/1CD83646CA9CF1C2B0F7364B341E8580.gif"; | |
final path = "/Users/cai/Desktop/sxwphone.png"; | |
final imgFile = File(path); |
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
class HomeContainer extends StatefulWidget { | |
final List<Widget> children; | |
final int currentIndex; | |
const HomeContainer({ | |
Key key, | |
this.children, | |
this.currentIndex, | |
}) : super(key: key); |
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'; | |
class Mask extends StatefulWidget { | |
final Function onTap; | |
final Rect rect; | |
const Mask({Key key, this.onTap, this.rect}) : super(key: key); | |
@override | |
_MaskState createState() => _MaskState(); | |
} |
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 '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 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
<uses-permission android:name="android.permission.USE_FINGERPRINT"/> |