sqlcool2 2.0.0 copy "sqlcool2: ^2.0.0" to clipboard
sqlcool2: ^2.0.0 copied to clipboard

Easy and reactive Sqlite. Stream of changes, select bloc, custom database models

example/lib/main.dart

import 'package:flutter/material.dart';

import 'conf.dart';
import 'dbmodels/dbmodels.dart';
import 'dbviewer/dbviewer.dart';
import 'init_db.dart';
import 'pages/index.dart';
import 'pages/join.dart';
import 'pages/select_bloc.dart';
import 'pages/upsert.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  /// initialize the database async. We will use the [onReady]
  /// callback later to react to the initialization completed event
  await initDb(db: db);
  await initDb2(db: db2);

  runApp(MyApp());
}

final routes = {
  '/': (BuildContext context) => PageIndex(),
  '/select_bloc': (BuildContext context) => PageSelectBloc(),
  '/join': (BuildContext context) => PageJoinQuery(),
  '/upsert': (BuildContext context) => UpsertPage(),
  '/dbmodel': (BuildContext context) => DbModelPage(),
  '/dbmanager': (BuildContext context) => DbViewer(db: db),
};

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Sqlcool example',
      routes: routes,
    );
  }
}
4
likes
140
points
131
downloads

Publisher

unverified uploader

Weekly Downloads

Easy and reactive Sqlite. Stream of changes, select bloc, custom database models

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, path_provider, sqflite, synchronized

More

Packages that depend on sqlcool2