sql_query 1.1.2+2 copy "sql_query: ^1.1.2+2" to clipboard
sql_query: ^1.1.2+2 copied to clipboard

Extended Function for sqflite.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';
import 'package:sql_query/query.dart';
import 'package:sql_query_example/produk.dart';
import 'package:sql_query_example/customer.dart';
import 'package:sql_query_example/produk2.dart';
import 'package:sql_query_example/satuan.dart';

final navigatorKey = GlobalKey<NavigatorState>();

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await DB.init(
    databaseName: 'testings',
    customPath: '',
    tableList: [
      Produk.tables(),
      Produk2.tables(),
      Satuan.tables(),
      Customer.tables(),
    ],
  );
  // await Merger.init();
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();

    Future.delayed(Duration.zero, () async {
      // await Produk.add();
      // print(await Produk.get());
      SQL.view(isFirst: true, context: navigatorKey.currentContext!);
    });
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {}

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      navigatorKey: navigatorKey,
      home: const Scaffold(),
    );
  }
}
1
likes
120
pub points
29%
popularity

Publisher

unverified uploader

Extended Function for sqflite.

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, flutter_feather_icons, sqflite

More

Packages that depend on sql_query