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 './point1.dart' as point1; | |
import './point2.dart' as point2; | |
void main() { | |
final p1 = point1.Point(); | |
final p2 = point2.Point(); | |
print(p1 == p2); // false | |
print(p1.hashCode == p2.hashCode); // false | |
} |
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:bloc/bloc.dart'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
enum CounterEvent {increment, decrement} | |
enum ThemeEvent {li, da} | |
void main() => runApp(ThemeSwitcher()); | |
class ThemeBloc extends Bloc<ThemeEvent, ThemeData>{ |
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
// GENERATED CODE - DO NOT MODIFY BY HAND | |
part of 'person.model.dart'; | |
// ************************************************************************** | |
// TypeAdapterGenerator | |
// ************************************************************************** | |
class PersonModelAdapter extends TypeAdapter<PersonModel> { | |
@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:hive/hive.dart'; | |
part 'person.model.g.dart'; | |
@HiveType(typeId: 1) | |
class PersonModel{ | |
@HiveField(0) | |
int id; | |
@HiveField(1) | |
String name; |
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 TableExample extends StatefulWidget { | |
@override | |
_TableExampleState createState() => _TableExampleState(); | |
} | |
class _TableExampleState extends State<TableExample> { | |
@override | |
Widget build(BuildContext context) { |
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
# From https://s3.us-east-2.amazonaws.com/podcast.intelligence.org/razmedia/razfeed.xml | |
let vals = [] | |
document.querySelectorAll('rss channel item link').forEach(l => { | |
if(l.innerHTML) vals.push(l.innerHTML) | |
}) | |
copy(vals.join('\n')) | |
# save as [urls.txt](https://gist.githubusercontent.com/AABoyles/da593afbbdea77aaa593b40f375695ca/raw/df2e2bbadc174b0cbadfdc47eafb01f1cccb7fe6/urls.txt) |
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
// add SingleTickerProviderStateMixin to our State widget | |
class _DefaultAppBarState extends State<DefaultAppBar> with SingleTickerProviderStateMixin { | |
} | |
// intialize animation and controller | |
AnimationController _controller; | |
Animation _animation; | |
@override | |
initState() { |
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 MyPainter extends CustomPainter { | |
final Offset center; | |
final double radius, containerHeight; | |
final BuildContext context; | |
Color color; | |
double statusBarHeight, screenWidth; | |
MyPainter({this.context, this.containerHeight, this.center, this.radius}) { | |
ThemeData theme = Theme.of(context); |
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
double rippleStartX, rippleStartY; | |
void onSearchTapUp(TapUpDetails details) { | |
setState(() { | |
rippleStartX = details.globalPosition.dx; | |
rippleStartY = details.globalPosition.dy; | |
}); | |
print("pointer location $rippleStartX, $rippleStartY"); | |
} |
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 DefaultAppBar extends StatefulWidget implements PreferredSizeWidget { | |
@override | |
Size get preferredSize => Size.fromHeight(56.0); | |
@override | |
_DefaultAppBarState createState() => _DefaultAppBarState(); | |
} | |
class _DefaultAppBarState extends State<DefaultAppBar> { | |
@override |