sqlite_wrapper 0.2.3 copy "sqlite_wrapper: ^0.2.3" to clipboard
sqlite_wrapper: ^0.2.3 copied to clipboard

A simple way to easily use the SQLite library (even in a reactive way)

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:sqlite_wrapper_sample/database_helper.dart';
import 'package:sqlite_wrapper_sample/todo_list.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  // Init the DB
  await DatabaseHelper().initDB();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'SQLiteWrapper Sample',
      theme: ThemeData(
        primarySwatch: Colors.red,
      ),
      home: const HomePage(title: 'Todos'),
    );
  }
}

class HomePage extends StatelessWidget {
  final String title;

  const HomePage({super.key, required this.title});
  void _addNewTodo() {
    DatabaseHelper().addNewTodo("NEW TODO");
    return;
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(title),
      ),
      body: const TodoList(),
      floatingActionButton: FloatingActionButton(
        onPressed: _addNewTodo,
        tooltip: 'Add new todo',
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
7
likes
150
points
131
downloads

Publisher

verified publisherbabisoft.com

Weekly Downloads

A simple way to easily use the SQLite library (even in a reactive way)

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

sqflite_common_ffi_web, sqlite3

More

Packages that depend on sqlite_wrapper