View main.dart
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
abstract class FooBar {} | |
// 1. What is this? | |
// 2. How would you use this abstract class? | |
// 3. How can you inherit from it? | |
// 4. How can you get the actual instance, when the app is running? | |
// 5. Do you know other ways of sharing code? | |
class STMResult {} |
View main.dart
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:intl/intl.dart'; | |
class GroupedData<T> { | |
const GroupedData( | |
{required this.startDate, this.endDate, required this.data}); | |
final DateTime startDate; | |
final DateTime? endDate; | |
final List<T> data; | |
} |
View main.dart
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
void main() { | |
var myDouble = double.parse('123.45'); | |
assert(myDouble is double); | |
print(myDouble); | |
} | |
View gist:754ee005e54464fde665
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
@interface ViewController () | |
@property (nonatomic,strong) TestController *controller; | |
@end | |
@implementation ViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; |
View gist:f793d19c81756971bae1
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
override func reverseTransformedValue(value: AnyObject!) -> AnyObject { | |
let data = value as! NSData | |
var components:[CGFloat] = [CGFloat](count: 4, repeatedValue:0) | |
var length=sizeofValue(components) | |
data.getBytes(&components, length: length) | |
let color = UIColor(red: components[0], | |
green: components[1], | |
blue: components[2], | |
alpha: components[3]) | |
View gist:e3a8240a216985fffa95
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
let calendar = NSCalendar.currentCalendar() | |
let components = calendar.components(NSCalendarUnit.CalendarUnitDay , fromDate:NSDate(timeIntervalSince1970: 0) , toDate:timeToShow , options:0 ) | |
Cannot invoke 'components' with an argument list of type '(NSCalendarUnit, fromDate: NSDate, toDate: NSDate, options: Int)' |
View gist:5862063
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
- (void)drawRect:(CGRect)rect | |
{ | |
contextRef = UIGraphicsGetCurrentContext(); | |
[self parseFile]; | |
} | |
-(void)parseFile{ | |
//if certain condition draw e.g. circle at x/y |