Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate shared_preferences and path_provider #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ Please report issues at the [go-flutter issue tracker](https://github.com/go-flu

## From [flutter/plugins](https://github.com/flutter/plugins)

Some plugins like `shared_preferences` have been implemented in pure Dart and don't need any work done on the go-flutter side.
You just need to add `shared_preferences_{linux,macos,windows}` to your dependencies in the `pubspec.yaml`.
(The respective go-flutter plugins have been deprecated and will eventually be removed, because they sometimes interfere with the official implementation and cause confusion).

- [image_picker](image_picker) - Select an image or video from storage. ([pub.dev](https://pub.dev/packages/image_picker))
- [path_provider](path_provider) - Finding commonly used locations on the filesystem. ([pub.dev](https://pub.dev/packages/path_provider))
- [package_info](package_info) - Provides information about an application package. ([pub.dev](https://pub.dev/packages/package_info))
- [shared_preferences](shared_preferences) - Provides a persistent store for simple data. ([pub.dev](https://pub.dev/packages/shared_preferences))
- [url_launcher](url_launcher) - Flutter plugin for launching a URL. ([pub.dev](https://pub.dev/packages/url_launcher))
- [video_player](video_player) - Flutter plugin for playing back video on a Widget surface. ([pub.dev](https://pub.dev/packages/video_player)) (:warning: work-in-progress, needs rewrite)

Expand Down
1 change: 0 additions & 1 deletion path_provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20200802091954-4b90ce9b60b3 h1:qDJKu1y/1SjhWac4BQZjLljqvqiWUhjmDMnonmVGDAU=
golang.org/x/sys v0.0.0-20200802091954-4b90ce9b60b3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand Down
2 changes: 2 additions & 0 deletions path_provider/plugin.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package path_provider

import (
"fmt"
"path/filepath"

"github.com/adrg/xdg"
Expand Down Expand Up @@ -29,6 +30,7 @@ var _ flutter.Plugin = &PathProviderPlugin{} // compile-time type check

// InitPlugin initializes the path provider plugin.
func (p *PathProviderPlugin) InitPlugin(messenger plugin.BinaryMessenger) error {
fmt.Println("The go-flutter 'path_provider' plugin has been deprecated in favor of the official pure Dart implementation. Please see https://github.com/go-flutter-desktop/plugins for more information")
if p.VendorName == "" {
// returned immediately because this is likely a programming error
return errors.New("PathProviderPlugin.VendorName must be set")
Expand Down
2 changes: 2 additions & 0 deletions shared_preferences/plugin.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package shared_preferences

import (
"fmt"
"os"
"path/filepath"

Expand Down Expand Up @@ -34,6 +35,7 @@ var _ flutter.Plugin = &SharedPreferencesPlugin{} // compile-time type check

// InitPlugin initializes the shared preferences plugin.
func (p *SharedPreferencesPlugin) InitPlugin(messenger plugin.BinaryMessenger) error {
fmt.Println("The go-flutter 'shared_preferences' plugin has been deprecated in favor of the official pure Dart implementation. Please see https://github.com/go-flutter-desktop/plugins for more information")
if p.VendorName == "" {
// returned immediately because this is likely a programming error
return errors.New("SharedPreferencesPlugin.VendorName must be set")
Expand Down