Skip to content

Commit

Permalink
#1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zc310.tech committed Oct 9, 2020
1 parent 71ab337 commit 5474373
Show file tree
Hide file tree
Showing 31 changed files with 1,491 additions and 218 deletions.
52 changes: 36 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
# See https://www.dartlang.org/guides/libraries/private-files
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# Files and directories created by pub
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
build/
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock
.pub-cache/
.pub/
/build/

# Web related
lib/generated_plugin_registrant.dart

# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
doc/api/
# Symbolication related
app.*.symbols

# Avoid committing generated Javascript files:
*.dart.js
*.info.json # Produced by the --dump-info flag.
*.js # When generated by dart2js. Don't specify *.js if your
# project includes source files written in JavaScript.
*.js_
*.js.deps
*.js.map
# Obfuscation related
app.*.map.json
201 changes: 0 additions & 201 deletions LICENSE

This file was deleted.

16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# rich_boltdb
BoltDB Viewer

A BoltDB Viewer 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:

- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)

For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
Binary file added assets/windows.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added go/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions go/cmd/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package main

import (
"fmt"
"image"
_ "image/png"
"os"
"path/filepath"
"strings"

"github.com/go-flutter-desktop/go-flutter"
"github.com/pkg/errors"
)

// vmArguments may be set by hover at compile-time
var vmArguments string

func main() {
// DO NOT EDIT, add options in options.go
mainOptions := []flutter.Option{
flutter.OptionVMArguments(strings.Split(vmArguments, ";")),
flutter.WindowIcon(iconProvider),
}
err := flutter.Run(append(options, mainOptions...)...)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
}

func iconProvider() ([]image.Image, error) {
execPath, err := os.Executable()
if err != nil {
return nil, errors.Wrap(err, "failed to resolve executable path")
}
execPath, err = filepath.EvalSymlinks(execPath)
if err != nil {
return nil, errors.Wrap(err, "failed to eval symlinks for executable path")
}
imgFile, err := os.Open(filepath.Join(filepath.Dir(execPath), "assets", "icon.png"))
if err != nil {
return nil, errors.Wrap(err, "failed to open assets/icon.png")
}
img, _, err := image.Decode(imgFile)
if err != nil {
return nil, errors.Wrap(err, "failed to decode image")
}
return []image.Image{img}, nil
}
23 changes: 23 additions & 0 deletions go/cmd/options.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package main

import (
"github.com/go-flutter-desktop/go-flutter"

"github.com/go-flutter-desktop/plugins/boltdb/api"
"github.com/go-flutter-desktop/plugins/path_provider"
"github.com/go-flutter-desktop/plugins/url_launcher"
file_picker "github.com/miguelpruivo/flutter_file_picker/go"
)

var options = []flutter.Option{
flutter.WindowInitialDimensions(720, 1200),
flutter.PopBehavior(flutter.PopBehaviorClose), // on SystemNavigator.pop() closes the app

flutter.AddPlugin(&api.DB{}),
flutter.AddPlugin(&file_picker.FilePickerPlugin{}),
flutter.AddPlugin(&path_provider.PathProviderPlugin{
VendorName: "zc310.tech",
ApplicationName: "boltdb",
}),
flutter.AddPlugin(&url_launcher.UrlLauncherPlugin{}),
}
24 changes: 24 additions & 0 deletions go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module github.com/go-flutter-desktop/zc310.tech/plugin/boltdb

go 1.12

require (
github.com/AlecAivazis/survey/v2 v2.1.1 // indirect
github.com/Masterminds/semver/v3 v3.1.0 // indirect
github.com/Xuanwo/go-locale v1.0.0 // indirect
github.com/gen2brain/dlgs v0.0.0-20200211102745-b9c2664df42f // indirect
github.com/go-flutter-desktop/go-flutter v0.42.0
github.com/go-flutter-desktop/plugins/boltdb/api v0.0.1
github.com/go-flutter-desktop/plugins/path_provider v0.4.0
github.com/go-flutter-desktop/plugins/url_launcher v0.1.2
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect
github.com/mattn/go-colorable v0.1.7 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/miguelpruivo/flutter_file_picker/go v0.0.0-20200929170309-1479f8a8cdcd
github.com/oligot/go-mod-upgrade v0.2.1 // indirect
github.com/pkg/errors v0.9.1
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect
golang.org/x/sys v0.0.0-20200929083018-4d22bbb62b3c // indirect
)

replace github.com/go-flutter-desktop/plugins/boltdb/api => ../plugins/boltdb/go
Loading

0 comments on commit 5474373

Please sign in to comment.