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:math'; | |
import 'package:flutter/material.dart'; | |
const double _kMaxWidthRatio = 0.90; | |
const double _kMinWidthRatio = 0.45; | |
const int _kMaxCharRow = 25; | |
void main() => runApp(MaterialApp(home: Screen())); |
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 ClipPolygon extends StatelessWidget { | |
final Widget child; | |
final int sides; | |
ClipPolygon({ | |
@required this.child, | |
@required this.sides, | |
}); | |
@override |
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 MyProgressLine extends CustomPainter { | |
MyProgressLine({this.shipped, this.estDelivery}); | |
final DateTime shipped; | |
final DateTime estDelivery; | |
@override | |
void paint(Canvas canvas, Size size) { | |
Paint paint = Paint() | |
..color = Colors.green |
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 Carousel extends StatefulWidget { | |
_CarouselState createState() => _CarouselState(); | |
} | |
class _CarouselState extends State<Carousel> with SingleTickerProviderStateMixin { | |
final PageController controller = PageController(); | |
AnimationController animationController; | |
List<Widget> list = [ | |
SliderBox( | |
child: FlutterLogo( |
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:math'; | |
import 'package:cached_network_image/cached_network_image.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:jnation/resources/constants.dart'; | |
const double _kPercentageOfScreenAppBar = 0.25; | |
const double _kListViewTopBottomPadding = 25.0; | |
const double _kAppbarScrollOffset = 75.0; |
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
Future<bool> checkConnection() async { | |
try { | |
final result = await InternetAddress.lookup('google.com'); | |
if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) { | |
return true; | |
} | |
} on SocketException catch (_) {} | |
return false; | |
} |
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 BackSwipe extends StatelessWidget { | |
final Widget child; | |
BackSwipe({Key key, this.child}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
double start = 0.0; | |
return GestureDetector( | |
onHorizontalDragStart: (details) => start = details.globalPosition.dx, |
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 AnimatedClock extends StatefulWidget { | |
final bool isToggled; | |
const AnimatedClock({ | |
Key key, | |
this.isToggled, | |
}) : super(key: key); | |
@override | |
_AnimatedClockState createState() => _AnimatedClockState(); | |
} |
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
package io.ptech.cc.plugins.flutter; | |
import android.os.Handler; | |
import android.os.Looper; | |
import io.flutter.plugin.common.MethodChannel; | |
public class MethodResultWrapper implements MethodChannel.Result { |
OlderNewer