sqlview 0.1.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new50

Sqlview #

pub package

Crud page widget for Sqlite and Flutter using Sqlcool

Example #

import 'package:flutter/material.dart';
import 'package:sqlcool/sqlcool.dart';
import 'package:sqlview/sqlview.dart';

class _PageExpensesState extends State<PageExpenses> {
  final SelectBloc bloc = SelectBloc(
    table: "mytable",
    columns: "id,name",
    where: 'name LIKE "%joe%"',
    orderBy: 'name ASC',
    reactive: true,
    verbose: true,
  );

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: <Widget>[
        CrudView(
            bloc: bloc,
            onUpdate: update,
            onDelete: delete,
            trailingBuilder: (_context, _item) {
              return IconButton(
                icon: Icon(Icons.location_off),
                onPressed: () => print("$_item"),
              );
            }),
        Positioned(
            right: 15.0,
            bottom: 15.0,
            child: FloatingActionButton(
              heroTag: "actionBtn",
              child: Icon(Icons.add),
              onPressed: () => print("Add action"),
            )),
      ],
    );
  }
}

update(BuildContext context, Map<String, dynamic> item) {
  // item is the json record
  showDialog(
      context: context,
      builder: (BuildContext context) {
        return AlertDialog(
          title: Text("Update"),
          // ...
          // Update using the Sqlcool database
          // Map<String, String> row = {"name": "value"};
          // db.update(table: "mytable", row: row, where: 'id=${item["id"]}');
        );
      });
}

delete(BuildContext context, Map<String, dynamic> item) {
  // item is the json record
  showDialog(
      context: context,
      builder: (BuildContext context) {
        return AlertDialog(
          title: Text("Delete"),
          // ...
          // delete using the Sqlcool database
          // db.delete(table: "mytable", where: 'id=${item["id"]}');
        );
      });
}

class PageExpenses extends StatefulWidget {
  @override
  _PageExpensesState createState() => _PageExpensesState();
}

Changelog #

0.1.0 #

Initial release

example/README.md

example #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  sqlview: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:sqlview/sqlview.dart';
  
Version Uploaded Documentation Archive
0.1.0 Mar 15, 2019 Go to the documentation of sqlview 0.1.0 Download sqlview 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Mar 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.3.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
cupertino_icons ^0.1.2 0.1.2
flutter 0.0.0
flutter_slidable ^0.4.9 0.4.9
sqlcool ^2.2.0 2.2.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
path 1.6.2
path_provider 0.4.1 0.5.0+1
sky_engine 0.0.99
sqflite 1.1.0 1.1.3
synchronized 1.5.3+2 2.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test