setup repo from the template w/Travis (#1)
* setup repo from the template w/Travis
* unhardcode path to flutter
* split out pub get; analyze specific dirs; print commands
* update .analysis_options header
diff --git a/packages/flutter_image/.analysis_options b/packages/flutter_image/.analysis_options
new file mode 100644
index 0000000..754054c
--- /dev/null
+++ b/packages/flutter_image/.analysis_options
@@ -0,0 +1,132 @@
+# Specify Dart code analysis options.
+#
+# For a list of lints, see: http://dart-lang.github.io/linter/lints/
+# See the configuration guide for more
+# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
+#
+# This file contains the analysis options used by Flutter editors, such as Atom.
+
+analyzer:
+ language:
+ enableStrictCallChecks: true
+ enableSuperMixins: true
+ enableAssertInitializer: true
+ strong-mode:
+ implicit-dynamic: false
+ errors:
+ # treat missing required parameters as a warning (not a hint)
+ missing_required_param: warning
+ # treat missing returns as a warning (not a hint)
+ missing_return: warning
+ # allow having TODOs in the code
+ todo: ignore
+ exclude:
+ - 'bin/cache/**'
+ # the following two are relative to the stocks example and the flutter package respectively
+ # see https://github.com/dart-lang/sdk/issues/28463
+ - 'lib/i18n/stock_messages_*.dart'
+ - 'lib/src/http/**'
+
+linter:
+ rules:
+ # these rules are documented on and in the same order as
+ # the Dart Lint rules page to make maintenance easier
+ # http://dart-lang.github.io/linter/lints/
+
+ # === error rules ===
+ - avoid_empty_else
+ - avoid_slow_async_io
+ - cancel_subscriptions
+ # - close_sinks # https://github.com/flutter/flutter/issues/5789
+ # - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
+ - control_flow_in_finally
+ - empty_statements
+ - hash_and_equals
+ # - invariant_booleans # https://github.com/flutter/flutter/issues/5790
+ - iterable_contains_unrelated_type
+ - list_remove_unrelated_type
+ # - literal_only_boolean_expressions # https://github.com/flutter/flutter/issues/5791
+ - no_adjacent_strings_in_list
+ - no_duplicate_case_values
+ - test_types_in_equals
+ - throw_in_finally
+ - unrelated_type_equality_checks
+ - valid_regexps
+
+ # === style rules ===
+ - always_declare_return_types
+ - always_put_control_body_on_new_line
+ - always_require_non_null_named_parameters
+ - always_specify_types
+ - annotate_overrides
+ # - avoid_annotating_with_dynamic # not yet tested
+ - avoid_as
+ # - avoid_catches_without_on_clauses # not yet tested
+ # - avoid_catching_errors # not yet tested
+ # - avoid_classes_with_only_static_members # not yet tested
+ # - avoid_function_literals_in_foreach_calls # not yet tested
+ - avoid_init_to_null
+ - avoid_null_checks_in_equality_operators
+ # - avoid_positional_boolean_parameters # not yet tested
+ - avoid_return_types_on_setters
+ # - avoid_returning_null # not yet tested
+ # - avoid_returning_this # not yet tested
+ # - avoid_setters_without_getters # not yet tested
+ # - avoid_types_on_closure_parameters # not yet tested
+ - await_only_futures
+ - camel_case_types
+ # - cascade_invocations # not yet tested
+ # - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
+ - directives_ordering
+ - empty_catches
+ - empty_constructor_bodies
+ - implementation_imports
+ # - join_return_with_assignment # not yet tested
+ - library_names
+ - library_prefixes
+ - non_constant_identifier_names
+ # - omit_local_variable_types # opposite of always_specify_types
+ # - one_member_abstracts # too many false positives
+ # - only_throw_errors # https://github.com/flutter/flutter/issues/5792
+ - overridden_fields
+ - package_api_docs
+ - package_prefixed_library_names
+ # - parameter_assignments # we do this commonly
+ - prefer_adjacent_string_concatenation
+ - prefer_collection_literals
+ # - prefer_conditional_assignment # not yet tested
+ - prefer_const_constructors
+ # - prefer_constructors_over_static_methods # not yet tested
+ - prefer_contains
+ # - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
+ # - prefer_final_fields # https://github.com/dart-lang/linter/issues/506
+ - prefer_final_locals
+ # - prefer_foreach # not yet tested
+ # - prefer_function_declarations_over_variables # not yet tested
+ - prefer_initializing_formals
+ # - prefer_interpolation_to_compose_strings # not yet tested
+ - prefer_is_empty
+ - prefer_is_not_empty
+ # - public_member_api_docs # this is the only difference from .analysis_options_repo
+ # - recursive_getters # https://github.com/dart-lang/linter/issues/452
+ - slash_for_doc_comments
+ - sort_constructors_first
+ - sort_unnamed_constructors_first
+ - super_goes_last
+ # - type_annotate_public_apis # subset of always_specify_types
+ - type_init_formals
+ # - unawaited_futures # https://github.com/flutter/flutter/issues/5793
+ - unnecessary_brace_in_string_interps
+ - unnecessary_getters_setters
+ # - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498
+ - unnecessary_null_aware_assignments
+ - unnecessary_null_in_if_null_operators
+ # - unnecessary_overrides # https://github.com/dart-lang/linter/issues/626 and https://github.com/dart-lang/linter/issues/627
+ - unnecessary_this
+ - use_rethrow_when_possible
+ # - use_setters_to_change_properties # not yet tested
+ # - use_string_buffers # https://github.com/dart-lang/linter/pull/664
+ # - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
+
+ # === pub rules ===
+ - package_names
diff --git a/packages/flutter_image/.gitignore b/packages/flutter_image/.gitignore
index 25a1df3..b063423 100644
--- a/packages/flutter_image/.gitignore
+++ b/packages/flutter_image/.gitignore
@@ -1,6 +1,8 @@
.buildlog
.DS_Store
-.idea
+.idea/libraries/*
+.idea/vcs.xml
+.idea/workspace.xml
.pub/
.settings/
build/
diff --git a/packages/flutter_image/.idea/flutter_image.iml b/packages/flutter_image/.idea/flutter_image.iml
new file mode 100644
index 0000000..8e57b7f
--- /dev/null
+++ b/packages/flutter_image/.idea/flutter_image.iml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="FLUTTER_MODULE_TYPE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/.pub" />
+ <excludeFolder url="file://$MODULE_DIR$/build" />
+ <excludeFolder url="file://$MODULE_DIR$/packages" />
+ <excludeFolder url="file://$MODULE_DIR$/test/packages" />
+ <excludeFolder url="file://$MODULE_DIR$/tool/packages" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Dart SDK" level="project" />
+ <orderEntry type="library" name="Dart Packages" level="project" />
+ </component>
+</module>
\ No newline at end of file
diff --git a/packages/flutter_image/.idea/modules.xml b/packages/flutter_image/.idea/modules.xml
new file mode 100644
index 0000000..8cab81c
--- /dev/null
+++ b/packages/flutter_image/.idea/modules.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/.idea/flutter_image.iml" filepath="$PROJECT_DIR$/.idea/flutter_image.iml" />
+ </modules>
+ </component>
+</project>
\ No newline at end of file
diff --git a/packages/flutter_image/.test_config b/packages/flutter_image/.test_config
deleted file mode 100644
index 352d2fe..0000000
--- a/packages/flutter_image/.test_config
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "test_package": true
-}
diff --git a/packages/flutter_image/.travis.yml b/packages/flutter_image/.travis.yml
index b35c9f6..851489c 100644
--- a/packages/flutter_image/.travis.yml
+++ b/packages/flutter_image/.travis.yml
@@ -1,15 +1,23 @@
-language: dart
+os:
+ - linux
+sudo: false
+
+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:
+ - libstdc++6
+ - fonts-droid
+
+before_script:
+ - git clone https://github.com/flutter/flutter.git -b alpha --depth 1
+ - export PATH=$PATH:$(pwd)/flutter/bin
+ - flutter doctor
script: ./tool/travis.sh
-# Speed up builds by using containerization. Disable this if you need to use
-# sudo in your scripts.
-sudo: false
-
-branches:
- only:
- - master
-
cache:
directories:
- - $HOME/.pub-cache
+ - $HOME/.pub-cache
diff --git a/packages/flutter_image/README.md b/packages/flutter_image/README.md
index f18a24c..8678d71 100644
--- a/packages/flutter_image/README.md
+++ b/packages/flutter_image/README.md
@@ -1,9 +1,7 @@
-# REPLACE_ME
+# Image utilities for Flutter
-A library for Flutter developers. It is awesome.
+Nothing yet. Stay tuned!
## Features and bugs
-Please file feature requests and bugs at the [issue tracker][tracker].
-
-[tracker]: https://github.com/flutter/REPLACE_ME/issues
+Please file feature requests and bugs at https://github.com/flutter/flutter/issues.
diff --git a/packages/flutter_image/lib/network.dart b/packages/flutter_image/lib/network.dart
new file mode 100644
index 0000000..0d79637
--- /dev/null
+++ b/packages/flutter_image/lib/network.dart
@@ -0,0 +1,16 @@
+// Copyright 2017, the Flutter project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Utilities for loading images from the network.
+///
+/// This library expands the capabilities of the basic [Image.network] and
+/// [NetworkImage] provided by Flutter core libraries, to include a retry
+/// mechanism and connectivity detection.
+library network;
+
+import 'package:flutter/widgets.dart';
+
+void main() {
+ const NetworkImage('');
+}
diff --git a/packages/flutter_image/lib/sample.dart b/packages/flutter_image/lib/sample.dart
deleted file mode 100644
index 943e491..0000000
--- a/packages/flutter_image/lib/sample.dart
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2016, the Flutter project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-main() => print('foo');
diff --git a/packages/flutter_image/pubspec.yaml b/packages/flutter_image/pubspec.yaml
index 6c169cb..5ebaf5e 100644
--- a/packages/flutter_image/pubspec.yaml
+++ b/packages/flutter_image/pubspec.yaml
@@ -1,14 +1,18 @@
-name: REPLACE_ME
+name: flutter_image
version: 0.0.1
-description: A sample library.
+description: >
+ Image utilities for Flutter: providers, effects, etc
author: Flutter Team <flutter-dev@googlegroups.com>
-homepage: https://github.com/flutter/REPLACE_ME
+homepage: https://github.com/flutter/flutter_image
environment:
sdk: '>=1.0.0 <2.0.0'
-#dependencies:
-# lib_name: any
+dependencies:
+ flutter:
+ sdk: flutter
+ flutter_test:
+ sdk: flutter
+
dev_dependencies:
-# change this to a specific version range when you create your project
- test: REPLACE_ME
+ test: any
diff --git a/packages/flutter_image/test/all_test.dart b/packages/flutter_image/test/network_test.dart
similarity index 70%
rename from packages/flutter_image/test/all_test.dart
rename to packages/flutter_image/test/network_test.dart
index 625e576..eb127db 100644
--- a/packages/flutter_image/test/all_test.dart
+++ b/packages/flutter_image/test/network_test.dart
@@ -1,11 +1,10 @@
-// Copyright (c) 2016, the Flutter project authors. Please see the AUTHORS file
+// Copyright (c) 2017, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'package:sample/sample.dart';
import 'package:test/test.dart';
-main() {
+void main() {
group('A group of tests', () {
test('First Test', () {});
});
diff --git a/packages/flutter_image/todo.txt b/packages/flutter_image/todo.txt
deleted file mode 100644
index 8a638e5..0000000
--- a/packages/flutter_image/todo.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-- rename project in pubspec.yaml
-- update description in pubspec.yaml
-- update the homepage: field in pubspec.yaml
-
-- rename project in readme.md
-- update description in readme.md
-- update the [tracker] url in readme.md
-
-- delete todo.txt :)