코딩(개발)/Flutter(18) todolist(firebase) step2 *pubspec.yaml dependencies: flutter: sdk: flutter cloud_firestore: ^0.14.4 firebase_core: ^0.5.3 * model\todo.dart class Todo { String uid; String subject; String memo; bool isComplet; String date; Todo({this.uid, this.subject, this.memo, this.isComplet, this.date}); } * services\database_services.dart import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:sql_example/todofirebas.. 2021. 3. 12. todolist(firebase) step1 data 넣기 전 ui import 'package:flutter/material.dart'; class TodoList extends StatefulWidget { @override _TodoListState createState() => _TodoListState(); } class _TodoListState extends State { bool isComplet = false; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('todolist firebase'), ), body: SafeArea( child: Padding( padding: const EdgeInsets.all(8.0.. 2021. 3. 10. sqflite - rawQuery/rawInsert * models\dog_model.dart class Dog { final int id; final String name; final String content; final bool active; Dog({this.id, this.name, this.content, this.active}); } - Map형태로 바꾸기 class Dog { final int id; final String name; final String content; final bool active; Dog({this.id, this.name, this.content, this.active}); factory Dog.fromJson(Map json) => Dog( id: json["id"], name: json["name"], cont.. 2021. 3. 8. sqflite * pubsec.yaml dependencies: flutter: sdk: flutter sqflite: ^1.3.0 path: ^1.7.0 * todo.dart class Todo { String title; String content; bool active; int id; Todo({this.title, this.content, this.active, this.id}); Map toMap() { return { 'id': id, 'title': title, 'content': content, 'active': active, }; } } * main.dart import 'package:flutter/material.dart'; import 'package:path/path.dart'; import '.. 2021. 3. 5. 이전 1 2 3 4 5 다음