Skip to content

Commit

Permalink
removing path_provider packages
Browse files Browse the repository at this point in the history
  • Loading branch information
alann-maulana committed Oct 13, 2019
1 parent aa1ccc8 commit 1b71eca
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 29 deletions.
25 changes: 4 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
os:
- linux
dist: trusty
sudo: required
addons:
apt:
# Flutter depends on /usr/lib/x86_64-linux-gnu/libstdc++.so.6 version GLIBCXX_3.4.18
sources:
- ubuntu-toolchain-r-test # if we don't specify this, the libstdc++6 we get is the wrong version
packages:
- lib32stdc++6 # https://github.com/flutter/flutter/issues/6207
- libstdc++6
- curl
language: dart
dart:
- stable
install:
- git clone https://github.com/flutter/flutter.git -b beta
- export PATH=`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
- export PATH=`pwd`/flutter/bin:$PATH
- flutter doctor
- gem install coveralls-lcov
- pub global activate pana
script: make
after_success:
- make pana
- coveralls-lcov --repo-token $COVERALLS_TOKEN coverage/lcov.info
cache:
directories:
- $HOME/.pub-cache
- coveralls-lcov --repo-token $COVERALLS_TOKEN coverage/lcov.info
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ DARTANALYZER_FLAGS=--fatal-warnings
build: lib/*dart test/*dart deps
dartanalyzer ${DARTANALYZER_FLAGS} lib/
dartfmt -n --set-exit-if-changed lib/ test/
flutter test --coverage
pub run test_coverage

deps: pubspec.yaml
flutter pub get -v
pub get -v

reformatting:
dartfmt -w lib/ test/
Expand Down
6 changes: 6 additions & 0 deletions lib/flutter_parse.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class ParseConfiguration {
this.clientKey,
this.enableLogging,
this.httpClient,
this.localStoragePath,
}) : uri = Uri.parse((server.endsWith("/")
? server.substring(0, server.length - 1)
: server));
Expand All @@ -107,4 +108,9 @@ class ParseConfiguration {

/// Add your custom [BaseClient] class to intercept Parse request here.
final BaseClient httpClient;

/// Add local storage persistent path to your Flutter Android or iOS app.
///
/// use packages [path_provider] and then set returned path from [getApplicationDocumentsDirectory()]
final String localStoragePath;
}
7 changes: 4 additions & 3 deletions lib/src/path/mobile.dart
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import 'dart:async';

import 'package:flutter_parse/flutter_parse.dart';
import 'package:path/path.dart' as path;
import 'package:path_provider/path_provider.dart' as pp;

final ParsePathProvider parsePathProvider = ParsePathProvider._();

class ParsePathProvider {
ParsePathProvider._();

Future<String> databasePath(String dbName) async {
final appDocDir = await pp.getApplicationDocumentsDirectory();
final appDocDir = parse.configuration.localStoragePath;
assert(appDocDir != null || appDocDir.isEmpty);

return path.join(appDocDir.path, dbName);
return path.join(appDocDir, dbName);
}
}
3 changes: 0 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ dependencies:
http: ^0.12.0+2
meta: ^1.1.7
path: ^1.6.0
path_provider: ^1.3.0
sembast: ^2.0.1+2

dev_dependencies:
flutter_test:
sdk: flutter
pedantic: ^1.8.0
test: ^1.6.0
test_coverage: ^0.2.0

0 comments on commit 1b71eca

Please sign in to comment.