Skip to content

Instantly share code, notes, and snippets.

View reasje's full-sized avatar
🏠
Working from home

Reza reasje

🏠
Working from home
View GitHub Profile
@reasje
reasje / main.dart
Last active February 10, 2022 09:29
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart';
import 'package:hive/hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:hive_tut/models/note_model.dart';
import 'package:hive_tut/models/timedetail_model.dart';
import 'package:path_provider/path_provider.dart';
String noteBoxName = "noteBoxName";
import 'package:hive/hive.dart';
part 'timedetail_model.g.dart';
@HiveType(typeId: 1)
class TimeDetail {
@HiveField(0)
DateTime createdAt;
@HiveField(1)
DateTime updatedAt;
import 'package:hive/hive.dart';
import 'package:hive_tut/models/timedetail_model.dart';
part 'note_model.g.dart';
@HiveType(typeId: 0)
class Note {
@HiveField(0)
String title;
@HiveField(1)
@reasje
reasje / main.dart
Created December 27, 2021 13:31
hive_tut all 2
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart';
import 'package:hive/hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:path_provider/path_provider.dart';
String someRandomName = "someRandomName";
void main() async {
WidgetsFlutterBinding.ensureInitialized();
@reasje
reasje / main.dart
Created December 27, 2021 12:45
hive_tut all
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart';
import 'package:hive/hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:path_provider/path_provider.dart';
String someRandomName = "someRandomName";
void main() async {
WidgetsFlutterBinding.ensureInitialized();
@reasje
reasje / main.dart
Last active December 25, 2021 20:40
hive_tut main function
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart';
import 'package:hive/hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:path_provider/path_provider.dart';
String someRandomName = "someRandomName";
void main() async {
WidgetsFlutterBinding.ensureInitialized();