GithubHelp home page GithubHelp logo

harahq / flutter_isar Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 272 KB

proof test flutter dan isar

Kotlin 0.25% Swift 2.42% Objective-C 0.07% Dart 11.62% CMake 35.48% C++ 43.96% C 2.69% HTML 3.51%

flutter_isar's Introduction

form_learn

A new Flutter project.

Getting Started

Step:

  • bikin folder models

  • bikin file contoh lib/models/todo.dart

    import 'package:isar/isar.dart';
    
    part 'todo.g.dart';
    
    @Collection()
    class Todos {
      Id id = Isar.autoIncrement;
      late String title;
      late String content;
    
      @Backlink(to: "todo")
      final category = IsarLink<TodoCategories>();
    }
  • bikin file contoh lib/models/todo_category.dart

    import 'package:form_learn/models/todo.dart';
    import 'package:isar/isar.dart';
    
    part 'todo-category.g.dart';
    
    @Collection()
    class TodoCategories {
      Id? id = Isar.autoIncrement;
      late String title;
    
      final todo = IsarLinks<Todos>();
    }
    
  • pada terminal jalankan: flutter pub run build_runner build --delete-conflicting-outputs --delete-conflicting-outputs : ini untuk replace model generated by Isar

  • selesai terminal nanti ada file yang kegenerate contoh todo.g.dart dan todo_category.g.dart

  • file diatas adalah auto generate jadi gak perlu di ubah2

  • bikin lib/isar_service.dart untuk mastiin nantinya main.dart bisa running service db nya Isar

  • attach lib/isar_service.dart pada main.dart

  • buat Future function di isar_service.dart

  • akses function tersebut di main.dart atau di halaman lain

  • contoh lain bisa di cek langsung pada file2 nya

flutter_isar's People

Contributors

harahq avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.