
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
24 |
25 |
26 | 以下是一些支持的预定义样式:
27 |
28 | | **fixed** | **react** | **badge chip** |
29 | |:---------------------------------:|:--------------------------------:|:-------------------------:|
30 | |  |  |  |
31 | | **fixedCircle** | **reactCircle** | **flip** |
32 | |  |  |  |
33 | | **textIn** | **titled** | **tab image** |
34 | |  |  |  |
35 | | **button** | **fixed corner** | |
36 | |  |  | |
37 |
38 | ## 快速上手
39 |
40 | 通常ConvexAppBar可以通过设置bottomNavigationBar与Scaffold一起使用。
41 |
42 | ConvexAppBar具有两个构造函数,ConvexAppBar()将使用默认样式来简化选项卡的创建。
43 |
44 | 将此添加到您程序包的pubspec.yaml文件中,注意使用最新版本[](https://pub.dartlang.org/packages/convex_bottom_bar):
45 |
46 | ```yaml
47 | dependencies:
48 | convex_bottom_bar: ^latest_version
49 | ```
50 |
51 | ```dart
52 | import 'package:convex_bottom_bar/convex_bottom_bar.dart';
53 |
54 | Scaffold(
55 | bottomNavigationBar: ConvexAppBar(
56 | items: [
57 | TabItem(icon: Icons.home, title: 'Home'),
58 | TabItem(icon: Icons.map, title: 'Discovery'),
59 | TabItem(icon: Icons.add, title: 'Add'),
60 | TabItem(icon: Icons.message, title: 'Message'),
61 | TabItem(icon: Icons.people, title: 'Profile'),
62 | ],
63 | onTap: (int i) => print('click index=$i'),
64 | )
65 | );
66 | ```
67 |
68 | **Flutter Version Support**
69 | 由于Flutter迭代非常快。SDK本身有可能出现不兼容的API变更,我们将继续支持flutter稳定版本,非稳定的beta、dev channel
70 | 通过单独版本号进行兼容。
71 |
72 | | **Stable Flutter Version** | **Package Version** | **More** |
73 | |:--------------------------:|:-------------------:|:------------------------------------------:|
74 | | >=3.7.0 | >=3.2.0 | 从v3.7.0版本DefaultTabController的API有变更 |
75 | | >=1.20 | >=2.4.0 | 从 v1.20开始, Stack组件的API发送不兼容变更 |
76 | | <1.20 | <2.4.0 | v1.20稳定版发布后,我们对老版本如v1.17, v1.12 的支持将不再继续更新 |
77 |
78 | 如果你只需要一个单独的按钮,不妨试试 `ConvexButton`.
79 |
80 | ## 功能
81 |
82 | * 提供多种内部样式
83 | * 能够更改AppBar的主题
84 | * 提供Builder API以自定义新样式
85 | * 在AppBar上添加徽章
86 | * 支持优雅的过渡动画
87 | * 提供Hook API来重载一些内部样式
88 | * RTL布局支持
89 |
90 | ## Table of contents
91 |
92 | - [主题](#主题)
93 | - [角标](#角标)
94 | - [单独按钮](#单独按钮)
95 | - [样式重载](#样式重载)
96 | - [RTL支持](#RTL支持)
97 | - [自定义样例](#自定义样例)
98 | - [常见问题](#常见问题)
99 | - [支持](#支持)
100 |
101 | ## 角标
102 | 如果需要在TAB上添加徽章/角标,请使用`ConvexAppBar.badge`来构建。
103 |
104 | [](doc/badge-demo.mp4 "badge demo")
105 |
106 | ```dart
107 | ConvexAppBar.badge({0: '99+', 1: Icons.assistant_photo, 2: Colors.redAccent},
108 | items: [
109 | TabItem(icon: Icons.home, title: 'Home'),
110 | TabItem(icon: Icons.map, title: 'Discovery'),
111 | TabItem(icon: Icons.add, title: 'Add'),
112 | ],
113 | onTap: (int i) => print('click index=$i'),
114 | );
115 | ```
116 |
117 | `badge()`方法接受一个角标数组; 角标是带有选项卡项的映射,每个条目的值可以是String,IconData,Color或Widget。
118 |
119 | ## 单独按钮
120 | 
121 |
122 | ```dart
123 | Scaffold(
124 | appBar: AppBar(title: const Text('ConvexButton Example')),
125 | body: Center(child: Text('count $count')),
126 | bottomNavigationBar: ConvexButton.fab(
127 | onTap: () => setState(() => count++),
128 | ),
129 | );
130 | ```
131 |
132 | ## 主题
133 | AppBar默认使用内置样式,您可能需要为其设置主题。 以下是一些支持的属性:
134 |
135 | 
136 |
137 | | Attributes | Description |
138 | |-----------------|--------------------------------------------------------|
139 | | backgroundColor | AppBar 背景 |
140 | | gradient | 渐变属性,可以覆盖backgroundColor |
141 | | height | AppBar 高度 |
142 | | color | icon/text 的颜色值 |
143 | | activeColor | icon/text 的**选中态**颜色值 |
144 | | curveSize | 凸形大小 |
145 | | top | 凸形到AppBar上边缘的距离 |
146 | | style | 支持的样式: **fixed, fixedCircle, react, reactCircle**, ... |
147 | | chipBuilder | 角标构造器builder, **ConvexAppBar.badge**会使用默认样式 |
148 |
149 | ## 样式重载
150 | 重载Tab内置样式。 该API与`ConvexAppBar.builder`不同,为了满足您可能需要更新选项卡样式而不定义新的选项卡样式。
151 | **温馨提示:**
152 | 则此Hook能力是有限的,如果您提供的尺寸与内部样式不匹配,并且可能导致`overflow broken`。
153 |
154 | ```dart
155 | StyleProvider(
156 | style: Style(),
157 | child: ConvexAppBar(
158 | initialActiveIndex: 1,
159 | height: 50,
160 | top: -30,
161 | curveSize: 100,
162 | style: TabStyle.fixedCircle,
163 | items: [
164 | TabItem(icon: Icons.link),
165 | TabItem(icon: Icons.import_contacts),
166 | TabItem(title: "2020", icon: Icons.work),
167 | ],
168 | backgroundColor: _tabBackgroundColor,
169 | ),
170 | )
171 | class Style extends StyleHook {
172 | @override
173 | double get activeIconSize => 40;
174 |
175 | @override
176 | double get activeIconMargin => 10;
177 |
178 | @override
179 | double get iconSize => 20;
180 |
181 | @override
182 | TextStyle textStyle(Color color) {
183 | return TextStyle(fontSize: 20, color: color);
184 | }
185 | }
186 | ```
187 |
188 | ## RTL支持
189 | RTL的内部适配,如果你配置了Directionality,将自动支持ltf和rtl两种布局风格。
190 | ```dart
191 | Directionality(
192 | textDirection: TextDirection.rtl,
193 | child: Scaffold(body:ConvexAppBar(/*TODO ...*/)),
194 | )
195 | ```
196 |
197 | ## 自定义样例
198 |
199 | 如果默认样式与您的情况不符,请尝试使用`ConvexAppBar.builder()`,它可以让您自定义几乎所有TAB样式。
200 | ```dart
201 | Scaffold(
202 | bottomNavigationBar: ConvexAppBar.builder(
203 | count: 5,
204 | backgroundColor: Colors.blue,
205 | itemBuilder: Builder(),
206 | )
207 | );
208 |
209 | /*user defined class*/
210 | class Builder extends DelegateBuilder {
211 | @override
212 | Widget build(BuildContext context, int index, bool active) {
213 | return Text('TAB $index');
214 | }
215 | }
216 | ```
217 |
218 | 完整的自定义示例可以在[example](example)中找到。
219 |
220 | ## 常见问题
221 | 如您在使用过程中有新功能建议或者遇到问题,请移步至[issue tracker](https://github.com/hacktons/convex_bottom_bar/issues)提交。
222 |
223 | * [如何拦截Tab事件](doc/how-to-block-tab-event.md)
224 | * [Flutter dev/beta channel运行崩溃](doc/issue-crash-on-flutter-dev-channel.md)
225 | * [动态修改选中的TAB](doc/issue-change-active-tab-index.md)
226 | * [如何给TAB添加图片而不是ICON](doc/issue-image-for-actionitem.md)
227 | * [如何移除AppBar的边缘阴影](doc/issue-remove-elevation.md)
228 |
229 | ## 支持
230 | 如果对你有帮助,微信扫码请作者喝杯咖啡 :)
231 |
232 | 
--------------------------------------------------------------------------------
/example/lib/default_appbar_demo.dart:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 chaobinwu89@gmail.com
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import 'package:convex_bottom_bar/convex_bottom_bar.dart';
18 | import 'package:flutter/foundation.dart';
19 | import 'package:flutter/material.dart';
20 | import 'package:flutter/rendering.dart';
21 | import 'package:flutter/widgets.dart';
22 |
23 | import 'components/chip_item.dart';
24 | import 'components/choose_tab_item.dart';
25 | import 'components/colors_item.dart';
26 | import 'components/gradient_item.dart';
27 | import 'components/heading.dart';
28 | import 'components/radio_item.dart';
29 | import 'data.dart';
30 | import 'model/badge.dart';
31 | import 'model/choice_value.dart';
32 |
33 | class DefaultAppBarDemo extends StatefulWidget {
34 | @override
35 | State createState() {
36 | return _State();
37 | }
38 | }
39 |
40 | class _State extends State
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
26 |
27 |
28 | Here are some supported style:
29 |
30 | | **fixed** | **react** | **badge chip** |
31 | |:---------------------------------:|:--------------------------------:|:-------------------------:|
32 | |  |  |  |
33 | | **fixedCircle** | **reactCircle** | **flip** |
34 | |  |  |  |
35 | | **textIn** | **titled** | **tab image** |
36 | |  |  |  |
37 | | **button** | **fixed corner** | |
38 | |  |  | |
39 |
40 | ## How to use
41 | Typically ConvexAppBar can work with `Scaffold` by setup its `bottomNavigationBar`.
42 |
43 | The `ConvexAppBar` has two constructors. The `ConvexAppBar()` will use the default style to simplify the tab creation.
44 |
45 | Add this to your package's pubspec.yaml file, use the latest version [](https://pub.dartlang.org/packages/convex_bottom_bar):
46 |
47 | ```yaml
48 | dependencies:
49 | convex_bottom_bar: ^latest_version
50 | ```
51 |
52 | ```dart
53 | import 'package:convex_bottom_bar/convex_bottom_bar.dart';
54 |
55 | Scaffold(
56 | bottomNavigationBar: ConvexAppBar(
57 | items: [
58 | TabItem(icon: Icons.home, title: 'Home'),
59 | TabItem(icon: Icons.map, title: 'Discovery'),
60 | TabItem(icon: Icons.add, title: 'Add'),
61 | TabItem(icon: Icons.message, title: 'Message'),
62 | TabItem(icon: Icons.people, title: 'Profile'),
63 | ],
64 | onTap: (int i) => print('click index=$i'),
65 | )
66 | );
67 | ```
68 |
69 | **Flutter Version Support**
70 | As Flutter is developing fast. There can be breaking changes. We will be trying to support the
71 | stable version and beta version through different package versions.
72 |
73 | | **Stable Flutter Version** | **Package Version** | **More** |
74 | |:--------------------------:|:-------------------:|:--------------------------------------------------------------------------:|
75 | | >=3.7.0 | >=3.2.0 | Since v3.7.0, the stable version changed the DefaultTabController api |
76 | | >=1.20 | >=2.4.0 | Since v1.20, the stable version changed the Stack api |
77 | | <1.20 | <=2.3.0 | Support for stable version such as v1.17, v1.12 is not going to be updated |
78 |
79 | ## Features
80 | * Provide multiple internal styles
81 | * Ability to change the theme of AppBar
82 | * Provide builder API to customize a new style
83 | * Add badge on the tab menu
84 | * Elegant transition animation
85 | * Provide hook API to override some of the internal styles
86 | * RTL support
87 |
88 | ## Table of contents
89 |
90 | - [Theming](#theming)
91 | - [Badge](#badge)
92 | - [Single Button](#single-button)
93 | - [Style Hook](#style-hook)
94 | - [RTL Support](#rtl-support)
95 | - [Custom Example](#custom-example)
96 | - [FAQ](#faq)
97 | - [Donate](#donate)
98 |
99 | ## Theming
100 | The bar will use default style, you may want to theme it. Here are some supported attributes:
101 |
102 | 
103 |
104 | | Attributes | Description |
105 | |-----------------|--------------------------------------------------------------------------------------|
106 | | backgroundColor | AppBar background |
107 | | gradient | gradient will override backgroundColor |
108 | | height | AppBar height |
109 | | color | tab icon/text color |
110 | | activeColor | tab icon/text color **when selected** |
111 | | curveSize | size of the convex shape |
112 | | top | top edge of the convex shape relative to AppBar |
113 | | cornerRadius | draw the background with topLeft and topRight corner; Only work with fixed tab style |
114 | | style | style to describe the convex shape: **fixed, fixedCircle, react, reactCircle**, ... |
115 | | chipBuilder | custom badge builder, use **ConvexAppBar.badge** for default badge |
116 |
117 | ## Badge
118 |
119 | If you need to add a badge on the tab, use the `ConvexAppBar.badge` to get it done.
120 |
121 | [](doc/badge-demo.mp4 "badge demo")
122 |
123 | ```dart
124 | ConvexAppBar.badge({0: '99+', 1: Icons.assistant_photo, 2: Colors.redAccent},
125 | items: [
126 | TabItem(icon: Icons.home, title: 'Home'),
127 | TabItem(icon: Icons.map, title: 'Discovery'),
128 | TabItem(icon: Icons.add, title: 'Add'),
129 | ],
130 | onTap: (int i) => print('click index=$i'),
131 | );
132 | ```
133 |
134 | The `badge()` method accepts an array of badges; The `badges` is a map with tab items. Each value of entry can be either `String`, `IconData`, `Color` or `Widget`.
135 |
136 | ## Single Button
137 |
138 | If you only need a single button, checkout the `ConvexButton`.
139 |
140 | 
141 |
142 | ```dart
143 | Scaffold(
144 | appBar: AppBar(title: const Text('ConvexButton Example')),
145 | body: Center(child: Text('count $count')),
146 | bottomNavigationBar: ConvexButton.fab(
147 | onTap: () => setState(() => count++),
148 | ),
149 | );
150 | ```
151 |
152 | ## Style Hook
153 | Hook for internal tab style. Unlike the `ConvexAppBar.builder`, you may want to update the tab style without defining a new tab style.
154 |
155 | **Warning:**
156 | This hook is limited and can lead to `overflow broken` if the size you provide does not match with internal style.
157 |
158 | ```dart
159 | StyleProvider(
160 | style: Style(),
161 | child: ConvexAppBar(
162 | initialActiveIndex: 1,
163 | height: 50,
164 | top: -30,
165 | curveSize: 100,
166 | style: TabStyle.fixedCircle,
167 | items: [
168 | TabItem(icon: Icons.link),
169 | TabItem(icon: Icons.import_contacts),
170 | TabItem(title: "2020", icon: Icons.work),
171 | ],
172 | backgroundColor: _tabBackgroundColor,
173 | ),
174 | )
175 | class Style extends StyleHook {
176 | @override
177 | double get activeIconSize => 40;
178 |
179 | @override
180 | double get activeIconMargin => 10;
181 |
182 | @override
183 | double get iconSize => 20;
184 |
185 | @override
186 | TextStyle textStyle(Color color) {
187 | return TextStyle(fontSize: 20, color: color);
188 | }
189 | }
190 | ```
191 |
192 | ## RTL Support
193 | RTL is supported internally, and if you define the TextDirection inside the app, the AppBar should work fine.
194 | Both RTL and LTR can be configured through `Directionality`:
195 | ```dart
196 | Directionality(
197 | textDirection: TextDirection.rtl,
198 | child: Scaffold(body:ConvexAppBar(/*TODO ...*/)),
199 | )
200 | ```
201 |
202 | ## Custom Example
203 |
204 | If the default style does not match your situation, try with `ConvexAppBar.builder()`, allowing you to custom nearly all the tab features.
205 |
206 | ```dart
207 | Scaffold(
208 | bottomNavigationBar: ConvexAppBar.builder(
209 | count: 5,
210 | backgroundColor: Colors.blue,
211 | itemBuilder: Builder(),
212 | )
213 | );
214 |
215 | // user defined class
216 | class Builder extends DelegateBuilder {
217 | @override
218 | Widget build(BuildContext context, int index, bool active) {
219 | return Text('TAB $index');
220 | }
221 | }
222 | ```
223 |
224 | Full custom example can be found at [example](example).
225 |
226 | ## FAQ
227 | Please file feature requests and bugs at the [issue tracker](https://github.com/hacktons/convex_bottom_bar/issues).
228 |
229 | * [How to block tab event?](doc/how-to-block-tab-event.md)
230 | * [Crash on flutter dev/beta channel](doc/issue-crash-on-flutter-dev-channel.md)
231 | * [Change active tab index programmatically](doc/issue-change-active-tab-index.md)
232 | * [Using an image instead of an icon for actionItem](doc/issue-image-for-actionitem.md)
233 | * [Is there anyway to remove elevation in the bottom bar?](doc/issue-remove-elevation.md)
234 |
235 | ## Donate
236 | You like the package ? Buy me a coffee :)
237 |
238 | [](https://ko-fi.com/hacktons)
239 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
--------------------------------------------------------------------------------