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/rendering.dart'; | |
class Books { | |
int rollNo; | |
String name; | |
Books({ | |
this.rollNo, | |
this.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 'dart:async'; | |
import 'package:path/path.dart'; | |
import 'package:path_provider/path_provider.dart'; | |
import 'package:sembast/sembast.dart'; | |
import 'package:sembast/sembast_io.dart'; | |
class AppDatabase { | |
// Singleton instance | |
static final AppDatabase _singleton = AppDatabase._(); |
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:sembast/sembast.dart'; | |
import 'package:sembast_demo/db/data_base.dart'; | |
import 'package:sembast_demo/model/books_model.dart'; | |
class BooksDao { | |
static const String folderName = "Books"; | |
final _booksFolder = intMapStoreFactory.store(folderName); | |
Future<Database> get _db async => await AppDatabase.instance.database; |
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/rendering.dart'; | |
class Books { | |
int rollNo; | |
String name; | |
Books({ | |
this.rollNo, | |
this.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
class Alligator { | |
void bite() => print('Chomp'); | |
void crawl() => print('Crawling'); | |
void swim() => print('Swimming'); | |
void hunt() { | |
print('Alligator'); | |
crawl(); | |
bite(); | |
swim(); |
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 Crocodile { | |
void swim() => print('Swimming'); | |
void bite() => print('Chomp'); | |
void crawl() => print('Crawling'); | |
void hunt() { | |
print('Crocodile'); | |
swim(); | |
crawl(); | |
bite(); | |
print('Eat Deer'); |
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
abstract class Reptile { | |
void bite() => print('Chomp'); | |
void swim() => print('Swimming'); | |
void crawl() => print('Crawling'); | |
void hunt() { | |
print('${this.runtimeType} '); | |
swim(); | |
crawl(); | |
bite(); | |
} |
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
mixin Swim { | |
void swim() => print('Swimming'); | |
} | |
mixin Bite { | |
void bite() => print('Chomp'); | |
} | |
mixin Crawl { | |
void crawl() => print('Crawling'); |
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
mixin Hunt on Reptile { | |
void hunt(food) { | |
print('${this.runtimeType}'); | |
swim(); | |
crawl(); | |
bite(); | |
print('Eat $food'); | |
} | |
} |
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
mixin Hunt on Reptile { | |
void hunt(food) { | |
print('${this.runtimeType}'); | |
swim(); | |
crawl(); | |
bite(); | |
print('Eat $food'); | |
} | |
} |
OlderNewer