diff --git a/web/filipino_cuisine/.gitignore b/web/filipino_cuisine/.gitignore deleted file mode 100644 index 0fa6b675c..000000000 --- a/web/filipino_cuisine/.gitignore +++ /dev/null @@ -1,46 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ - -# 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 -.pub-cache/ -.pub/ -/build/ - -# Web related -lib/generated_plugin_registrant.dart - -# Symbolication related -app.*.symbols - -# Obfuscation related -app.*.map.json - -# Android Studio will place build artifacts here -/android/app/debug -/android/app/profile -/android/app/release diff --git a/web/filipino_cuisine/.metadata b/web/filipino_cuisine/.metadata deleted file mode 100644 index 0f055bf16..000000000 --- a/web/filipino_cuisine/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: ffb2ecea5223acdd139a5039be2f9c796962833d - channel: stable - -project_type: app diff --git a/web/filipino_cuisine/LICENSE b/web/filipino_cuisine/LICENSE deleted file mode 100644 index 33177f0ea..000000000 --- a/web/filipino_cuisine/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2019 John Mark Grancapal - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/web/filipino_cuisine/README.md b/web/filipino_cuisine/README.md deleted file mode 100644 index cb17c90a8..000000000 --- a/web/filipino_cuisine/README.md +++ /dev/null @@ -1,31 +0,0 @@ -A sample that shows a visual recipe catalog for Filipino food. - -Contributed as part of the Flutter Create 5K challenge by John Mark Grancapal. -Original source at -[github.com/markgrancapal/filipino_cuisine](https://github.com/markgrancapal/filipino_cuisine). - - -**Asset License**: All images used on this app are under the "CC0 - Creative Commons" license - - -## Developed By - -John Mark Grancapal -Homepage: https://github.com/markgrancapal - - -## License - - Copyright 2019 John Mark Grancapal - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/web/filipino_cuisine/analysis_options.yaml b/web/filipino_cuisine/analysis_options.yaml deleted file mode 100644 index 85f6fbe91..000000000 --- a/web/filipino_cuisine/analysis_options.yaml +++ /dev/null @@ -1,19 +0,0 @@ -include: package:flutter_lints/flutter.yaml - -analyzer: - strong-mode: - implicit-casts: false - implicit-dynamic: false - -linter: - rules: - avoid_types_on_closure_parameters: true - avoid_void_async: true - cancel_subscriptions: true - close_sinks: true - directives_ordering: true - package_api_docs: true - package_prefixed_library_names: true - test_types_in_equals: true - throw_in_finally: true - unnecessary_statements: true diff --git a/web/filipino_cuisine/assets/banana.png b/web/filipino_cuisine/assets/banana.png deleted file mode 100644 index 2ffe61bd7..000000000 Binary files a/web/filipino_cuisine/assets/banana.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/beef.png b/web/filipino_cuisine/assets/beef.png deleted file mode 100644 index 6727b415a..000000000 Binary files a/web/filipino_cuisine/assets/beef.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/beef_caldereta.jpg b/web/filipino_cuisine/assets/beef_caldereta.jpg deleted file mode 100644 index 2cc3a073f..000000000 Binary files a/web/filipino_cuisine/assets/beef_caldereta.jpg and /dev/null differ diff --git a/web/filipino_cuisine/assets/black_pepper.png b/web/filipino_cuisine/assets/black_pepper.png deleted file mode 100644 index d1504cac8..000000000 Binary files a/web/filipino_cuisine/assets/black_pepper.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/bokchoy.png b/web/filipino_cuisine/assets/bokchoy.png deleted file mode 100644 index d1fc50181..000000000 Binary files a/web/filipino_cuisine/assets/bokchoy.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/butter.png b/web/filipino_cuisine/assets/butter.png deleted file mode 100644 index 83799878a..000000000 Binary files a/web/filipino_cuisine/assets/butter.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/cabbage.png b/web/filipino_cuisine/assets/cabbage.png deleted file mode 100644 index bf754cc7c..000000000 Binary files a/web/filipino_cuisine/assets/cabbage.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/calamares.jpg b/web/filipino_cuisine/assets/calamares.jpg deleted file mode 100644 index 52871020b..000000000 Binary files a/web/filipino_cuisine/assets/calamares.jpg and /dev/null differ diff --git a/web/filipino_cuisine/assets/carrot.png b/web/filipino_cuisine/assets/carrot.png deleted file mode 100644 index fb988e53b..000000000 Binary files a/web/filipino_cuisine/assets/carrot.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/cheese.png b/web/filipino_cuisine/assets/cheese.png deleted file mode 100644 index 0a8b2f76e..000000000 Binary files a/web/filipino_cuisine/assets/cheese.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/chicken_adobo.jpg b/web/filipino_cuisine/assets/chicken_adobo.jpg deleted file mode 100644 index b19a6dad1..000000000 Binary files a/web/filipino_cuisine/assets/chicken_adobo.jpg and /dev/null differ diff --git a/web/filipino_cuisine/assets/chili.png b/web/filipino_cuisine/assets/chili.png deleted file mode 100644 index b2c1f1f46..000000000 Binary files a/web/filipino_cuisine/assets/chili.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/crispy_pata.jpg b/web/filipino_cuisine/assets/crispy_pata.jpg deleted file mode 100644 index c9d516c0a..000000000 Binary files a/web/filipino_cuisine/assets/crispy_pata.jpg and /dev/null differ diff --git a/web/filipino_cuisine/assets/egg.png b/web/filipino_cuisine/assets/egg.png deleted file mode 100644 index 83471a731..000000000 Binary files a/web/filipino_cuisine/assets/egg.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/embutido.jpg b/web/filipino_cuisine/assets/embutido.jpg deleted file mode 100644 index 850a8a78d..000000000 Binary files a/web/filipino_cuisine/assets/embutido.jpg and /dev/null differ diff --git a/web/filipino_cuisine/assets/flour.png b/web/filipino_cuisine/assets/flour.png deleted file mode 100644 index b3bf62641..000000000 Binary files a/web/filipino_cuisine/assets/flour.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/garlic.png b/web/filipino_cuisine/assets/garlic.png deleted file mode 100644 index f439c36a1..000000000 Binary files a/web/filipino_cuisine/assets/garlic.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/green_beans.png b/web/filipino_cuisine/assets/green_beans.png deleted file mode 100644 index 038e98fdb..000000000 Binary files a/web/filipino_cuisine/assets/green_beans.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/green_bell.png b/web/filipino_cuisine/assets/green_bell.png deleted file mode 100644 index 9cc90d548..000000000 Binary files a/web/filipino_cuisine/assets/green_bell.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/grilled_pork_ribs.jpg b/web/filipino_cuisine/assets/grilled_pork_ribs.jpg deleted file mode 100644 index 713b5191d..000000000 Binary files a/web/filipino_cuisine/assets/grilled_pork_ribs.jpg and /dev/null differ diff --git a/web/filipino_cuisine/assets/grilled_seafood.jpg b/web/filipino_cuisine/assets/grilled_seafood.jpg deleted file mode 100644 index c33038d20..000000000 Binary files a/web/filipino_cuisine/assets/grilled_seafood.jpg and /dev/null differ diff --git a/web/filipino_cuisine/assets/ground_pork.png b/web/filipino_cuisine/assets/ground_pork.png deleted file mode 100644 index 36ad1c41f..000000000 Binary files a/web/filipino_cuisine/assets/ground_pork.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/icon/fc_icon.png b/web/filipino_cuisine/assets/icon/fc_icon.png deleted file mode 100644 index b40f02533..000000000 Binary files a/web/filipino_cuisine/assets/icon/fc_icon.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/lemon.png b/web/filipino_cuisine/assets/lemon.png deleted file mode 100644 index 00a6d6041..000000000 Binary files a/web/filipino_cuisine/assets/lemon.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/oil.png b/web/filipino_cuisine/assets/oil.png deleted file mode 100644 index 6428fea98..000000000 Binary files a/web/filipino_cuisine/assets/oil.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/onion.png b/web/filipino_cuisine/assets/onion.png deleted file mode 100644 index 23e8ad722..000000000 Binary files a/web/filipino_cuisine/assets/onion.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/pancit_canton.jpg b/web/filipino_cuisine/assets/pancit_canton.jpg deleted file mode 100644 index 31ddf6a3e..000000000 Binary files a/web/filipino_cuisine/assets/pancit_canton.jpg and /dev/null differ diff --git a/web/filipino_cuisine/assets/pochero.jpg b/web/filipino_cuisine/assets/pochero.jpg deleted file mode 100644 index 2107e1dcc..000000000 Binary files a/web/filipino_cuisine/assets/pochero.jpg and /dev/null differ diff --git a/web/filipino_cuisine/assets/pork.png b/web/filipino_cuisine/assets/pork.png deleted file mode 100644 index 56cd5ccf3..000000000 Binary files a/web/filipino_cuisine/assets/pork.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/pork_sisig.jpg b/web/filipino_cuisine/assets/pork_sisig.jpg deleted file mode 100644 index ed8eff4f0..000000000 Binary files a/web/filipino_cuisine/assets/pork_sisig.jpg and /dev/null differ diff --git a/web/filipino_cuisine/assets/potato.png b/web/filipino_cuisine/assets/potato.png deleted file mode 100644 index 894f69d96..000000000 Binary files a/web/filipino_cuisine/assets/potato.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/preview.png b/web/filipino_cuisine/assets/preview.png deleted file mode 100644 index c05c393b2..000000000 Binary files a/web/filipino_cuisine/assets/preview.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/raisins.png b/web/filipino_cuisine/assets/raisins.png deleted file mode 100644 index e21ba5748..000000000 Binary files a/web/filipino_cuisine/assets/raisins.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/red_bell.png b/web/filipino_cuisine/assets/red_bell.png deleted file mode 100644 index 15e87f38c..000000000 Binary files a/web/filipino_cuisine/assets/red_bell.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/red_pepper.png b/web/filipino_cuisine/assets/red_pepper.png deleted file mode 100644 index fdffc287c..000000000 Binary files a/web/filipino_cuisine/assets/red_pepper.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/salt.png b/web/filipino_cuisine/assets/salt.png deleted file mode 100644 index 61291b6a7..000000000 Binary files a/web/filipino_cuisine/assets/salt.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/sausage.png b/web/filipino_cuisine/assets/sausage.png deleted file mode 100644 index 472d8d3aa..000000000 Binary files a/web/filipino_cuisine/assets/sausage.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/smoked_salmon.jpg b/web/filipino_cuisine/assets/smoked_salmon.jpg deleted file mode 100644 index fd6694b37..000000000 Binary files a/web/filipino_cuisine/assets/smoked_salmon.jpg and /dev/null differ diff --git a/web/filipino_cuisine/assets/squid.png b/web/filipino_cuisine/assets/squid.png deleted file mode 100644 index 3df4e8d42..000000000 Binary files a/web/filipino_cuisine/assets/squid.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/sweet_and_sour_chicken_poultry.jpg b/web/filipino_cuisine/assets/sweet_and_sour_chicken_poultry.jpg deleted file mode 100644 index ad225dfc8..000000000 Binary files a/web/filipino_cuisine/assets/sweet_and_sour_chicken_poultry.jpg and /dev/null differ diff --git a/web/filipino_cuisine/assets/tomato.png b/web/filipino_cuisine/assets/tomato.png deleted file mode 100644 index a0a0fc115..000000000 Binary files a/web/filipino_cuisine/assets/tomato.png and /dev/null differ diff --git a/web/filipino_cuisine/assets/yellow_onion.png b/web/filipino_cuisine/assets/yellow_onion.png deleted file mode 100644 index 94809cef8..000000000 Binary files a/web/filipino_cuisine/assets/yellow_onion.png and /dev/null differ diff --git a/web/filipino_cuisine/fonts/Arkipelago.otf b/web/filipino_cuisine/fonts/Arkipelago.otf deleted file mode 100644 index 37afb8423..000000000 Binary files a/web/filipino_cuisine/fonts/Arkipelago.otf and /dev/null differ diff --git a/web/filipino_cuisine/fonts/OpenSans-Bold.ttf b/web/filipino_cuisine/fonts/OpenSans-Bold.ttf deleted file mode 100644 index fd79d43be..000000000 Binary files a/web/filipino_cuisine/fonts/OpenSans-Bold.ttf and /dev/null differ diff --git a/web/filipino_cuisine/fonts/OpenSans-Regular.ttf b/web/filipino_cuisine/fonts/OpenSans-Regular.ttf deleted file mode 100644 index db433349b..000000000 Binary files a/web/filipino_cuisine/fonts/OpenSans-Regular.ttf and /dev/null differ diff --git a/web/filipino_cuisine/lib/cook.dart b/web/filipino_cuisine/lib/cook.dart deleted file mode 100644 index 691e1a233..000000000 --- a/web/filipino_cuisine/lib/cook.dart +++ /dev/null @@ -1,65 +0,0 @@ -import 'package:flutter/material.dart'; - -class Cook extends StatefulWidget { - final List dr; - final String? img; - final String? nme; - - const Cook(this.dr, this.img, this.nme, {Key? key}) : super(key: key); - - @override - CState createState() => CState(); -} - -class CState extends State { - late List cb; - - @override - initState() { - super.initState(); - cb = []; - } - - @override - Widget build(context) { - List dr = widget.dr; - return Scaffold( - appBar: AppBar( - backgroundColor: Colors.red, - title: const Text("INSTRUCTIONS"), - centerTitle: true), - body: Column( - children: [ - Container( - child: ListTile( - leading: ClipRRect( - borderRadius: BorderRadius.circular(50), - child: Hero( - tag: widget.nme!, - child: Image.asset(widget.img!, - fit: BoxFit.cover, width: 100, height: 100))), - title: Text(widget.nme!, - style: Theme.of(context) - .textTheme - .headline3! - .copyWith(fontFamily: 'ark', color: Colors.black))), - margin: const EdgeInsets.only(top: 40, bottom: 30, left: 20)), - Expanded( - child: ListView.builder( - itemCount: dr.length, - padding: const EdgeInsets.all(10), - itemBuilder: (ct, i) { - cb.add(false); - return ListTile( - title: Text(dr[i]), - trailing: Checkbox( - value: cb[i], - onChanged: (v) => setState(() => cb[i] = v))); - }, - ), - ), - ], - ), - ); - } -} diff --git a/web/filipino_cuisine/lib/flutter_page_indicator.dart b/web/filipino_cuisine/lib/flutter_page_indicator.dart deleted file mode 100644 index 8cc53f8a2..000000000 --- a/web/filipino_cuisine/lib/flutter_page_indicator.dart +++ /dev/null @@ -1,344 +0,0 @@ -// Package flutter_page_indicator: -// https://pub.dartlang.org/packages/flutter_page_indicator - -import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; - -class WarmPainter extends BasePainter { - WarmPainter(PageIndicator widget, double page, int index, Paint paint) - : super(widget, page, index, paint); - - @override - void draw(Canvas canvas, double space, double size, double radius) { - double progress = page - index; - double distance = size + space; - double start = index * (size + space); - - if (progress > 0.5) { - double right = start + size + distance; - //progress=>0.5-1.0 - //left:0.0=>distance - - double left = index * distance + distance * (progress - 0.5) * 2; - canvas.drawRRect( - RRect.fromLTRBR(left, 0.0, right, size, Radius.circular(radius)), - _paint); - } else { - double right = start + size + distance * progress * 2; - - canvas.drawRRect( - RRect.fromLTRBR(start, 0.0, right, size, Radius.circular(radius)), - _paint); - } - } -} - -class DropPainter extends BasePainter { - DropPainter(PageIndicator widget, double page, int index, Paint paint) - : super(widget, page, index, paint); - - @override - void draw(Canvas canvas, double space, double size, double radius) { - double progress = page - index; - double dropHeight = widget.dropHeight; - double rate = (0.5 - progress).abs() * 2; - double scale = widget.scale; - - //lerp(begin, end, progress) - - canvas.drawCircle( - Offset(radius + ((page) * (size + space)), - radius - dropHeight * (1 - rate)), - radius * (scale + rate * (1.0 - scale)), - _paint); - } -} - -class NonePainter extends BasePainter { - NonePainter(PageIndicator widget, double page, int index, Paint paint) - : super(widget, page, index, paint); - - @override - void draw(Canvas canvas, double space, double size, double radius) { - double progress = page - index; - double secondOffset = index == widget.count - 1 - ? radius - : radius + ((index + 1) * (size + space)); - - if (progress > 0.5) { - canvas.drawCircle(Offset(secondOffset, radius), radius, _paint); - } else { - canvas.drawCircle( - Offset(radius + (index * (size + space)), radius), radius, _paint); - } - } -} - -class SlidePainter extends BasePainter { - SlidePainter(PageIndicator widget, double page, int index, Paint paint) - : super(widget, page, index, paint); - - @override - void draw(Canvas canvas, double space, double size, double radius) { - canvas.drawCircle( - Offset(radius + (page * (size + space)), radius), radius, _paint); - } -} - -class ScalePainter extends BasePainter { - ScalePainter(PageIndicator widget, double page, int index, Paint paint) - : super(widget, page, index, paint); - - // 连续的两个点,含有最后一个和第一个 - @override - bool _shouldSkip(int index) { - if (super.index == widget.count - 1) { - return index == 0 || index == super.index; - } - return (index == super.index || index == super.index + 1); - } - - @override - void paint(Canvas canvas, Size size) { - _paint.color = widget.color; - double space = widget.space; - double size = widget.size; - double radius = size / 2; - for (int i = 0, c = widget.count; i < c; ++i) { - if (_shouldSkip(i)) { - continue; - } - canvas.drawCircle(Offset(i * (size + space) + radius, radius), - radius * widget.scale, _paint); - } - - _paint.color = widget.activeColor; - draw(canvas, space, size, radius); - } - - @override - void draw(Canvas canvas, double space, double size, double radius) { - double secondOffset = index == widget.count - 1 - ? radius - : radius + ((index + 1) * (size + space)); - - double progress = page - index; - _paint.color = Color.lerp(widget.activeColor, widget.color, progress)!; - //last - canvas.drawCircle(Offset(radius + (index * (size + space)), radius), - lerp(radius, radius * widget.scale, progress), _paint); - //first - _paint.color = Color.lerp(widget.color, widget.activeColor, progress)!; - canvas.drawCircle(Offset(secondOffset, radius), - lerp(radius * widget.scale, radius, progress), _paint); - } -} - -class ColorPainter extends BasePainter { - ColorPainter(PageIndicator widget, double page, int index, Paint paint) - : super(widget, page, index, paint); - - // 连续的两个点,含有最后一个和第一个 - @override - bool _shouldSkip(int index) { - if (super.index == widget.count - 1) { - return index == 0 || index == super.index; - } - return (index == super.index || index == super.index + 1); - } - - @override - void draw(Canvas canvas, double space, double size, double radius) { - double progress = page - index; - double secondOffset = index == widget.count - 1 - ? radius - : radius + ((index + 1) * (size + space)); - - _paint.color = Color.lerp(widget.activeColor, widget.color, progress)!; - //left - canvas.drawCircle( - Offset(radius + (index * (size + space)), radius), radius, _paint); - //right - _paint.color = Color.lerp(widget.color, widget.activeColor, progress)!; - canvas.drawCircle(Offset(secondOffset, radius), radius, _paint); - } -} - -abstract class BasePainter extends CustomPainter { - final PageIndicator widget; - final double page; - final int index; - final Paint _paint; - - double lerp(double begin, double end, double progress) { - return begin + (end - begin) * progress; - } - - BasePainter(this.widget, this.page, this.index, this._paint); - - void draw(Canvas canvas, double space, double size, double radius); - - bool _shouldSkip(int index) { - return false; - } - //double secondOffset = index == widget.count-1 ? radius : radius + ((index + 1) * (size + space)); - - @override - void paint(Canvas canvas, Size size) { - _paint.color = widget.color; - double space = widget.space; - double size = widget.size; - double radius = size / 2; - for (int i = 0, c = widget.count; i < c; ++i) { - if (_shouldSkip(i)) { - continue; - } - canvas.drawCircle( - Offset(i * (size + space) + radius, radius), radius, _paint); - } - - double page = this.page; - if (page < index) { - page = 0.0; - } - _paint.color = widget.activeColor; - draw(canvas, space, size, radius); - } - - @override - bool shouldRepaint(BasePainter oldDelegate) { - return oldDelegate.page != page; - } -} - -class _PageIndicatorState extends State { - int index = 0; - final Paint _paint = Paint(); - - BasePainter _createPainer() { - switch (widget.layout) { - case PageIndicatorLayout.NONE: - return NonePainter( - widget, widget.controller.page ?? 0.0, index, _paint); - case PageIndicatorLayout.SLIDE: - return SlidePainter( - widget, widget.controller.page ?? 0.0, index, _paint); - case PageIndicatorLayout.WARM: - return WarmPainter( - widget, widget.controller.page ?? 0.0, index, _paint); - case PageIndicatorLayout.COLOR: - return ColorPainter( - widget, widget.controller.page ?? 0.0, index, _paint); - case PageIndicatorLayout.SCALE: - return ScalePainter( - widget, widget.controller.page ?? 0.0, index, _paint); - case PageIndicatorLayout.DROP: - return DropPainter( - widget, widget.controller.page ?? 0.0, index, _paint); - default: - throw Exception("Not a valid layout"); - } - } - - @override - Widget build(BuildContext context) { - Widget child = SizedBox( - width: widget.count * widget.size + (widget.count - 1) * widget.space, - height: widget.size, - child: CustomPaint( - painter: _createPainer(), - ), - ); - - if (widget.layout == PageIndicatorLayout.SCALE || - widget.layout == PageIndicatorLayout.COLOR) { - child = ClipRect( - child: child, - ); - } - - return IgnorePointer( - child: child, - ); - } - - void _onController() { - double page = widget.controller.page ?? 0.0; - index = page.floor(); - - setState(() {}); - } - - @override - void initState() { - widget.controller.addListener(_onController); - super.initState(); - } - - @override - void didUpdateWidget(PageIndicator oldWidget) { - if (widget.controller != oldWidget.controller) { - oldWidget.controller.removeListener(_onController); - widget.controller.addListener(_onController); - } - super.didUpdateWidget(oldWidget); - } - - @override - void dispose() { - widget.controller.removeListener(_onController); - super.dispose(); - } -} - -// ignore: constant_identifier_names -enum PageIndicatorLayout { NONE, SLIDE, WARM, COLOR, SCALE, DROP } - -class PageIndicator extends StatefulWidget { - /// size of the dots - final double size; - - /// space between dots. - final double space; - - /// count of dots - final int count; - - /// active color - final Color activeColor; - - /// normal color - final Color color; - - /// layout of the dots,default is [PageIndicatorLayout.SLIDE] - final PageIndicatorLayout? layout; - - // Only valid when layout==PageIndicatorLayout.scale - final double scale; - - // Only valid when layout==PageIndicatorLayout.drop - final double dropHeight; - - final PageController controller; - - final double activeSize; - - const PageIndicator( - {Key? key, - this.size = 20.0, - this.space = 5.0, - required this.count, - this.activeSize = 20.0, - required this.controller, - this.color = Colors.white30, - this.layout = PageIndicatorLayout.SLIDE, - this.activeColor = Colors.white, - this.scale = 0.6, - this.dropHeight = 20.0}) - : super(key: key); - - @override - State createState() { - return _PageIndicatorState(); - } -} diff --git a/web/filipino_cuisine/lib/flutter_swiper.dart b/web/filipino_cuisine/lib/flutter_swiper.dart deleted file mode 100644 index 318ce4168..000000000 --- a/web/filipino_cuisine/lib/flutter_swiper.dart +++ /dev/null @@ -1,1871 +0,0 @@ -// Package flutter_swiper: -// https://pub.dartlang.org/packages/flutter_swiper - -import 'dart:async'; - -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; - -import 'flutter_page_indicator.dart'; -import 'transformer_page_view.dart'; - -typedef SwiperOnTap = void Function(int index); - -typedef SwiperDataBuilder = Widget Function( - BuildContext context, dynamic data, int index); - -/// default auto play delay -const int kDefaultAutoplayDelayMs = 3000; - -/// Default auto play transition duration (in millisecond) -const int kDefaultAutoplayTransactionDuration = 300; - -const int kMaxValue = 2000000000; -const int kMiddleValue = 1000000000; - -// ignore_for_file: constant_identifier_names -enum SwiperLayout { DEFAULT, STACK, TINDER, CUSTOM } - -class Swiper extends StatefulWidget { - /// If set true , the pagination will display 'outer' of the 'content' container. - final bool outer; - - /// Inner item height, this property is valid if layout=STACK or layout=TINDER or LAYOUT=CUSTOM, - final double? itemHeight; - - /// Inner item width, this property is valid if layout=STACK or layout=TINDER or LAYOUT=CUSTOM, - final double? itemWidth; - - // height of the inside container,this property is valid when outer=true,otherwise the inside container size is controlled by parent widget - final double? containerHeight; - // width of the inside container,this property is valid when outer=true,otherwise the inside container size is controlled by parent widget - final double? containerWidth; - - /// Build item on index - final IndexedWidgetBuilder? itemBuilder; - - /// Support transform like Android PageView did - /// `itemBuilder` and `transformItemBuilder` must have one not null - final PageTransformer? transformer; - - /// count of the display items - final int itemCount; - - final ValueChanged? onIndexChanged; - - ///auto play config - final bool autoplay; - - ///Duration of the animation between transactions (in millisecond). - final int autoplayDelay; - - ///disable auto play when interaction - final bool autoplayDisableOnInteraction; - - ///auto play transition duration (in millisecond) - final int duration; - - ///horizontal/vertical - final Axis scrollDirection; - - ///transition curve - final Curve curve; - - /// Set to false to disable continuous loop mode. - final bool loop; - - ///Index number of initial slide. - ///If not set , the `Swiper` is 'uncontrolled', which means manage index by itself - ///If set , the `Swiper` is 'controlled', which means the index is fully managed by parent widget. - final int? index; - - ///Called when tap - final SwiperOnTap? onTap; - - ///The swiper pagination plugin - final SwiperPlugin? pagination; - - ///the swiper control button plugin - final SwiperPlugin? control; - - ///other plugins, you can custom your own plugin - final List? plugins; - - /// - final SwiperController? controller; - - final ScrollPhysics? physics; - - /// - final double viewportFraction; - - /// Build in layouts - final SwiperLayout layout; - - /// this value is valid when layout == SwiperLayout.CUSTOM - final CustomLayoutOption? customLayoutOption; - - // This value is valid when viewportFraction is set and < 1.0 - final double? scale; - - // This value is valid when viewportFraction is set and < 1.0 - final double? fade; - - final PageIndicatorLayout indicatorLayout; - - const Swiper({ - this.itemBuilder, - this.indicatorLayout = PageIndicatorLayout.NONE, - - /// - this.transformer, - required this.itemCount, - this.autoplay = false, - this.layout = SwiperLayout.DEFAULT, - this.autoplayDelay = kDefaultAutoplayDelayMs, - this.autoplayDisableOnInteraction = true, - this.duration = kDefaultAutoplayTransactionDuration, - this.onIndexChanged, - this.index, - this.onTap, - this.control, - this.loop = true, - this.curve = Curves.ease, - this.scrollDirection = Axis.horizontal, - this.pagination, - this.plugins, - this.physics, - Key? key, - this.controller, - this.customLayoutOption, - - /// since v1.0.0 - this.containerHeight, - this.containerWidth, - this.viewportFraction = 1.0, - this.itemHeight, - this.itemWidth, - this.outer = false, - this.scale, - this.fade, - }) : assert(itemBuilder != null || transformer != null, - "itemBuilder and transformItemBuilder must not be both null"), - assert( - !loop || - ((loop && - layout == SwiperLayout.DEFAULT && - (indicatorLayout == PageIndicatorLayout.SCALE || - indicatorLayout == PageIndicatorLayout.COLOR || - indicatorLayout == PageIndicatorLayout.NONE)) || - (loop && layout != SwiperLayout.DEFAULT)), - "Only support `PageIndicatorLayout.SCALE` and `PageIndicatorLayout.COLOR`when layout==SwiperLayout.DEFAULT in loop mode"), - super(key: key); - - factory Swiper.children({ - required List children, - bool autoplay = false, - PageTransformer? transformer, - int autoplayDelay = kDefaultAutoplayDelayMs, - bool reverse = false, - bool autoplayDisableOnInteraction = true, - int duration = kDefaultAutoplayTransactionDuration, - ValueChanged? onIndexChanged, - int? index, - SwiperOnTap? onTap, - bool loop = true, - Curve curve = Curves.ease, - Axis scrollDirection = Axis.horizontal, - SwiperPlugin? pagination, - SwiperPlugin? control, - List? plugins, - SwiperController? controller, - Key? key, - CustomLayoutOption? customLayoutOption, - ScrollPhysics? physics, - double? containerHeight, - double? containerWidth, - double viewportFraction = 1.0, - double? itemHeight, - double? itemWidth, - bool outer = false, - double scale = 1.0, - }) { - return Swiper( - transformer: transformer, - customLayoutOption: customLayoutOption, - containerHeight: containerHeight, - containerWidth: containerWidth, - viewportFraction: viewportFraction, - itemHeight: itemHeight, - itemWidth: itemWidth, - outer: outer, - scale: scale, - autoplay: autoplay, - autoplayDelay: autoplayDelay, - autoplayDisableOnInteraction: autoplayDisableOnInteraction, - duration: duration, - onIndexChanged: onIndexChanged, - index: index, - onTap: onTap, - curve: curve, - scrollDirection: scrollDirection, - pagination: pagination, - control: control, - controller: controller, - loop: loop, - plugins: plugins, - physics: physics, - key: key, - itemBuilder: (context, index) { - return children[index]; - }, - itemCount: children.length); - } - - factory Swiper.list({ - PageTransformer? transformer, - required List list, - CustomLayoutOption? customLayoutOption, - SwiperDataBuilder? builder, - bool autoplay = false, - int autoplayDelay = kDefaultAutoplayDelayMs, - bool reverse = false, - bool autoplayDisableOnInteraction = true, - int duration = kDefaultAutoplayTransactionDuration, - ValueChanged? onIndexChanged, - int? index, - SwiperOnTap? onTap, - bool loop = true, - Curve curve = Curves.ease, - Axis scrollDirection = Axis.horizontal, - SwiperPlugin? pagination, - SwiperPlugin? control, - List? plugins, - SwiperController? controller, - Key? key, - ScrollPhysics? physics, - double? containerHeight, - double? containerWidth, - double viewportFraction = 1.0, - double? itemHeight, - double? itemWidth, - bool outer = false, - double scale = 1.0, - }) { - return Swiper( - transformer: transformer, - customLayoutOption: customLayoutOption, - containerHeight: containerHeight, - containerWidth: containerWidth, - viewportFraction: viewportFraction, - itemHeight: itemHeight, - itemWidth: itemWidth, - outer: outer, - scale: scale, - autoplay: autoplay, - autoplayDelay: autoplayDelay, - autoplayDisableOnInteraction: autoplayDisableOnInteraction, - duration: duration, - onIndexChanged: onIndexChanged, - index: index, - onTap: onTap, - curve: curve, - key: key, - scrollDirection: scrollDirection, - pagination: pagination, - control: control, - controller: controller, - loop: loop, - plugins: plugins, - physics: physics, - itemBuilder: (context, index) { - return builder!(context, list[index], index); - }, - itemCount: list.length); - } - - @override - State createState() { - return _SwiperState(); - } -} - -abstract class _SwiperTimerMixin extends State { - Timer? _timer; - - SwiperController? _controller; - - @override - void initState() { - _controller = widget.controller; - _controller ??= SwiperController(); - _controller!.addListener(_onController); - _handleAutoplay(); - super.initState(); - } - - void _onController() { - switch (_controller!.event) { - case SwiperController.START_AUTOPLAY: - { - if (_timer == null) { - _startAutoplay(); - } - } - break; - case SwiperController.STOP_AUTOPLAY: - { - if (_timer != null) { - _stopAutoplay(); - } - } - break; - } - } - - @override - void didUpdateWidget(Swiper oldWidget) { - if (_controller != oldWidget.controller) { - if (oldWidget.controller != null) { - oldWidget.controller!.removeListener(_onController); - _controller = oldWidget.controller; - _controller!.addListener(_onController); - } - } - _handleAutoplay(); - super.didUpdateWidget(oldWidget); - } - - @override - void dispose() { - if (_controller != null) { - _controller!.removeListener(_onController); - // _controller.dispose(); - } - - _stopAutoplay(); - super.dispose(); - } - - bool _autoplayEnabled() { - return _controller!.autoplay ?? widget.autoplay; - } - - void _handleAutoplay() { - if (_autoplayEnabled() && _timer != null) return; - _stopAutoplay(); - if (_autoplayEnabled()) { - _startAutoplay(); - } - } - - void _startAutoplay() { - assert(_timer == null, "Timer must be stopped before start!"); - _timer = - Timer.periodic(Duration(milliseconds: widget.autoplayDelay), _onTimer); - } - - void _onTimer(Timer timer) { - _controller!.next(animation: true); - } - - void _stopAutoplay() { - if (_timer != null) { - _timer!.cancel(); - _timer = null; - } - } -} - -class _SwiperState extends _SwiperTimerMixin { - int? _activeIndex; - - TransformerPageController? _pageController; - - Widget _wrapTap(BuildContext context, int index) { - return GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - widget.onTap!(index); - }, - child: widget.itemBuilder!(context, index), - ); - } - - @override - void initState() { - _activeIndex = widget.index ?? 0; - if (_isPageViewLayout()) { - _pageController = TransformerPageController( - initialPage: widget.index, - loop: widget.loop, - itemCount: widget.itemCount, - reverse: - widget.transformer == null ? false : widget.transformer!.reverse, - viewportFraction: widget.viewportFraction); - } - super.initState(); - } - - bool _isPageViewLayout() { - return widget.layout == SwiperLayout.DEFAULT; - } - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - } - - bool _getReverse(Swiper widget) => - widget.transformer == null ? false : widget.transformer!.reverse; - - @override - void didUpdateWidget(Swiper oldWidget) { - super.didUpdateWidget(oldWidget); - if (_isPageViewLayout()) { - if (_pageController == null || - (widget.index != oldWidget.index || - widget.loop != oldWidget.loop || - widget.itemCount != oldWidget.itemCount || - widget.viewportFraction != oldWidget.viewportFraction || - _getReverse(widget) != _getReverse(oldWidget))) { - _pageController = TransformerPageController( - initialPage: widget.index, - loop: widget.loop, - itemCount: widget.itemCount, - reverse: _getReverse(widget), - viewportFraction: widget.viewportFraction); - } - } else { - scheduleMicrotask(() { - // So that we have a chance to do `removeListener` in child widgets. - if (_pageController != null) { - _pageController!.dispose(); - _pageController = null; - } - }); - } - if (widget.index != null && widget.index != _activeIndex) { - _activeIndex = widget.index; - } - } - - void _onIndexChanged(int index) { - setState(() { - _activeIndex = index; - }); - if (widget.onIndexChanged != null) { - widget.onIndexChanged!(index); - } - } - - Widget _buildSwiper() { - IndexedWidgetBuilder? itemBuilder; - if (widget.onTap != null) { - itemBuilder = _wrapTap; - } else { - itemBuilder = widget.itemBuilder; - } - - if (widget.layout == SwiperLayout.STACK) { - return _StackSwiper( - loop: widget.loop, - itemWidth: widget.itemWidth, - itemHeight: widget.itemHeight, - itemCount: widget.itemCount, - itemBuilder: itemBuilder, - index: _activeIndex, - curve: widget.curve, - duration: widget.duration, - onIndexChanged: _onIndexChanged, - controller: _controller, - scrollDirection: widget.scrollDirection, - ); - } else if (_isPageViewLayout()) { - PageTransformer? transformer = widget.transformer; - if (widget.scale != null || widget.fade != null) { - transformer = - ScaleAndFadeTransformer(scale: widget.scale, fade: widget.fade); - } - - Widget child = TransformerPageView( - pageController: _pageController, - loop: widget.loop, - itemCount: widget.itemCount, - itemBuilder: itemBuilder, - transformer: transformer, - viewportFraction: widget.viewportFraction, - index: _activeIndex, - duration: Duration(milliseconds: widget.duration), - scrollDirection: widget.scrollDirection, - onPageChanged: _onIndexChanged, - curve: widget.curve, - physics: widget.physics, - controller: _controller, - ); - if (widget.autoplayDisableOnInteraction && widget.autoplay) { - return NotificationListener( - child: child, - onNotification: (dynamic notification) { - if (notification is ScrollStartNotification) { - if (notification.dragDetails != null) { - //by human - if (_timer != null) _stopAutoplay(); - } - } else if (notification is ScrollEndNotification) { - if (_timer == null) _startAutoplay(); - } - - return false; - }, - ); - } - - return child; - } else if (widget.layout == SwiperLayout.TINDER) { - return _TinderSwiper( - loop: widget.loop, - itemWidth: widget.itemWidth, - itemHeight: widget.itemHeight, - itemCount: widget.itemCount, - itemBuilder: itemBuilder, - index: _activeIndex, - curve: widget.curve, - duration: widget.duration, - onIndexChanged: _onIndexChanged, - controller: _controller, - scrollDirection: widget.scrollDirection, - ); - } else if (widget.layout == SwiperLayout.CUSTOM) { - return _CustomLayoutSwiper( - loop: widget.loop, - option: widget.customLayoutOption!, - itemWidth: widget.itemWidth, - itemHeight: widget.itemHeight, - itemCount: widget.itemCount, - itemBuilder: itemBuilder, - index: _activeIndex, - curve: widget.curve, - duration: widget.duration, - onIndexChanged: _onIndexChanged, - controller: _controller, - scrollDirection: widget.scrollDirection, - ); - } else { - return Container(); - } - } - - SwiperPluginConfig? _ensureConfig(SwiperPluginConfig? config) { - config ??= SwiperPluginConfig( - outer: widget.outer, - itemCount: widget.itemCount, - layout: widget.layout, - indicatorLayout: widget.indicatorLayout, - pageController: _pageController, - activeIndex: _activeIndex, - scrollDirection: widget.scrollDirection, - controller: _controller!, - loop: widget.loop); - return config; - } - - List? _ensureListForStack( - Widget swiper, List? listForStack, Widget widget) { - if (listForStack == null) { - listForStack = [swiper, widget]; - } else { - listForStack.add(widget); - } - return listForStack; - } - - @override - Widget build(BuildContext context) { - Widget swiper = _buildSwiper(); - List? listForStack; - SwiperPluginConfig? config; - if (widget.control != null) { - //Stack - config = _ensureConfig(config); - listForStack = _ensureListForStack( - swiper, listForStack, widget.control!.build(context, config)); - } - - if (widget.plugins != null) { - config = _ensureConfig(config); - for (SwiperPlugin plugin in widget.plugins!) { - listForStack = _ensureListForStack( - swiper, listForStack, plugin.build(context, config)); - } - } - if (widget.pagination != null) { - config = _ensureConfig(config); - if (widget.outer) { - return _buildOuterPagination( - widget.pagination as SwiperPagination, - listForStack == null ? swiper : Stack(children: listForStack), - config!); - } else { - listForStack = _ensureListForStack( - swiper, listForStack, widget.pagination!.build(context, config)); - } - } - - if (listForStack != null) { - return Stack( - children: listForStack, - ); - } - - return swiper; - } - - Widget _buildOuterPagination( - SwiperPagination pagination, Widget swiper, SwiperPluginConfig config) { - List list = []; - //Only support bottom yet! - if (widget.containerHeight != null || widget.containerWidth != null) { - list.add(swiper); - } else { - list.add(Expanded(child: swiper)); - } - - list.add(Align( - alignment: Alignment.center, - child: pagination.build(context, config), - )); - - return Column( - children: list, - crossAxisAlignment: CrossAxisAlignment.stretch, - mainAxisSize: MainAxisSize.min, - ); - } -} - -abstract class _SubSwiper extends StatefulWidget { - final IndexedWidgetBuilder? itemBuilder; - final int? itemCount; - final int? index; - final ValueChanged? onIndexChanged; - final SwiperController? controller; - final int? duration; - final Curve? curve; - final double? itemWidth; - final double? itemHeight; - final bool? loop; - final Axis? scrollDirection; - - const _SubSwiper( - {Key? key, - this.loop, - this.itemHeight, - this.itemWidth, - this.duration, - this.curve, - this.itemBuilder, - this.controller, - this.index, - this.itemCount, - this.scrollDirection = Axis.horizontal, - this.onIndexChanged}) - : super(key: key); - - int getCorrectIndex(int indexNeedsFix) { - if (itemCount == 0) return 0; - int value = indexNeedsFix % itemCount!; - if (value < 0) { - value += itemCount!; - } - return value; - } -} - -class _TinderSwiper extends _SubSwiper { - const _TinderSwiper({ - Key? key, - Curve? curve, - int? duration, - SwiperController? controller, - ValueChanged? onIndexChanged, - required double? itemHeight, - required double? itemWidth, - IndexedWidgetBuilder? itemBuilder, - int? index, - bool? loop, - int? itemCount, - Axis? scrollDirection, - }) : assert(itemWidth != null && itemHeight != null), - super( - loop: loop, - key: key, - itemWidth: itemWidth, - itemHeight: itemHeight, - itemBuilder: itemBuilder, - curve: curve, - duration: duration, - controller: controller, - index: index, - onIndexChanged: onIndexChanged, - itemCount: itemCount, - scrollDirection: scrollDirection); - - @override - State createState() { - return _TinderState(); - } -} - -class _StackSwiper extends _SubSwiper { - const _StackSwiper({ - Key? key, - Curve? curve, - int? duration, - SwiperController? controller, - ValueChanged? onIndexChanged, - double? itemHeight, - double? itemWidth, - IndexedWidgetBuilder? itemBuilder, - int? index, - bool? loop, - int? itemCount, - Axis? scrollDirection, - }) : super( - loop: loop, - key: key, - itemWidth: itemWidth, - itemHeight: itemHeight, - itemBuilder: itemBuilder, - curve: curve, - duration: duration, - controller: controller, - index: index, - onIndexChanged: onIndexChanged, - itemCount: itemCount, - scrollDirection: scrollDirection); - - @override - State createState() { - return _StackViewState(); - } -} - -class _TinderState extends _CustomLayoutStateBase<_TinderSwiper> { - late List scales; - late List offsetsX; - late List offsetsY; - late List opacity; - late List rotates; - - double getOffsetY(double scale) { - return widget.itemHeight! - widget.itemHeight! * scale; - } - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - } - - @override - void didUpdateWidget(_TinderSwiper oldWidget) { - _updateValues(); - super.didUpdateWidget(oldWidget); - } - - @override - void afterRender() { - super.afterRender(); - - _startIndex = -3; - _animationCount = 5; - opacity = [0.0, 0.9, 0.9, 1.0, 0.0, 0.0]; - scales = [0.80, 0.80, 0.85, 0.90, 1.0, 1.0, 1.0]; - rotates = [0.0, 0.0, 0.0, 0.0, 20.0, 25.0]; - _updateValues(); - } - - void _updateValues() { - if (widget.scrollDirection == Axis.horizontal) { - offsetsX = [0.0, 0.0, 0.0, 0.0, _swiperWidth, _swiperWidth]; - offsetsY = [ - 0.0, - 0.0, - -5.0, - -10.0, - -15.0, - -20.0, - ]; - } else { - offsetsX = [ - 0.0, - 0.0, - 5.0, - 10.0, - 15.0, - 20.0, - ]; - - offsetsY = [0.0, 0.0, 0.0, 0.0, _swiperHeight, _swiperHeight]; - } - } - - @override - Widget _buildItem(int i, int realIndex, double animationValue) { - double s = _getValue(scales, animationValue, i)!; - double f = _getValue(offsetsX, animationValue, i)!; - double fy = _getValue(offsetsY, animationValue, i)!; - double o = _getValue(opacity, animationValue, i)!; - double a = _getValue(rotates, animationValue, i)!; - - Alignment alignment = widget.scrollDirection == Axis.horizontal - ? Alignment.bottomCenter - : Alignment.centerLeft; - - return Opacity( - opacity: o, - child: Transform.rotate( - angle: a / 180.0, - child: Transform.translate( - key: ValueKey(_currentIndex + i), - offset: Offset(f, fy), - child: Transform.scale( - scale: s, - alignment: alignment, - child: SizedBox( - width: widget.itemWidth ?? double.infinity, - height: widget.itemHeight ?? double.infinity, - child: widget.itemBuilder!(context, realIndex), - ), - ), - ), - ), - ); - } -} - -class _StackViewState extends _CustomLayoutStateBase<_StackSwiper> { - late List scales; - late List offsets; - late List opacity; - @override - void didChangeDependencies() { - super.didChangeDependencies(); - } - - void _updateValues() { - if (widget.scrollDirection == Axis.horizontal) { - double space = (_swiperWidth! - widget.itemWidth!) / 2; - offsets = [-space, -space / 3 * 2, -space / 3, 0.0, _swiperWidth]; - } else { - double space = (_swiperHeight! - widget.itemHeight!) / 2; - offsets = [-space, -space / 3 * 2, -space / 3, 0.0, _swiperHeight]; - } - } - - @override - void didUpdateWidget(_StackSwiper oldWidget) { - _updateValues(); - super.didUpdateWidget(oldWidget); - } - - @override - void afterRender() { - super.afterRender(); - - //length of the values array below - _animationCount = 5; - - //Array below this line, '0' index is 1.0 ,witch is the first item show in swiper. - _startIndex = -3; - scales = [0.7, 0.8, 0.9, 1.0, 1.0]; - opacity = [0.0, 0.5, 1.0, 1.0, 1.0]; - - _updateValues(); - } - - @override - Widget _buildItem(int i, int realIndex, double animationValue) { - double s = _getValue(scales, animationValue, i)!; - double? f = _getValue(offsets, animationValue, i); - double o = _getValue(opacity, animationValue, i)!; - - Offset offset = widget.scrollDirection == Axis.horizontal - ? Offset(f!, 0.0) - : Offset(0.0, f!); - - Alignment alignment = widget.scrollDirection == Axis.horizontal - ? Alignment.centerLeft - : Alignment.topCenter; - - return Opacity( - opacity: o, - child: Transform.translate( - key: ValueKey(_currentIndex + i), - offset: offset, - child: Transform.scale( - scale: s, - alignment: alignment, - child: SizedBox( - width: widget.itemWidth ?? double.infinity, - height: widget.itemHeight ?? double.infinity, - child: widget.itemBuilder!(context, realIndex), - ), - ), - ), - ); - } -} - -class ScaleAndFadeTransformer extends PageTransformer { - final double? _scale; - final double? _fade; - - ScaleAndFadeTransformer({double? fade = 0.3, double? scale = 0.8}) - : _fade = fade, - _scale = scale; - - @override - // ignore: avoid_renaming_method_parameters - Widget transform(Widget item, TransformInfo info) { - double? position = info.position; - Widget child = item; - if (_scale != null) { - double scaleFactor = (1 - position!.abs()) * (1 - _scale!); - double scale = _scale! + scaleFactor; - - child = Transform.scale( - scale: scale, - child: item, - ); - } - - if (_fade != null) { - double fadeFactor = (1 - position!.abs()) * (1 - _fade!); - double opacity = _fade! + fadeFactor; - child = Opacity( - opacity: opacity, - child: child, - ); - } - - return child; - } -} - -class SwiperControl extends SwiperPlugin { - ///IconData for previous - final IconData iconPrevious; - - ///iconData fopr next - final IconData iconNext; - - ///icon size - final double size; - - ///Icon normal color, The theme's [ThemeData.primaryColor] by default. - final Color? color; - - ///if set loop=false on Swiper, this color will be used when swiper goto the last slide. - ///The theme's [ThemeData.disabledColor] by default. - final Color? disableColor; - - final EdgeInsetsGeometry padding; - - final Key? key; - - const SwiperControl( - {this.iconPrevious = Icons.arrow_back_ios, - this.iconNext = Icons.arrow_forward_ios, - this.color, - this.disableColor, - this.key, - this.size = 30.0, - this.padding = const EdgeInsets.all(5.0)}); - - Widget buildButton(SwiperPluginConfig? config, Color color, IconData iconDaga, - int quarterTurns, bool previous) { - return GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - if (previous) { - config!.controller.previous(animation: true); - } else { - config!.controller.next(animation: true); - } - }, - child: Padding( - padding: padding, - child: RotatedBox( - quarterTurns: quarterTurns, - child: Icon( - iconDaga, - semanticLabel: previous ? "Previous" : "Next", - size: size, - color: color, - ))), - ); - } - - @override - Widget build(BuildContext context, SwiperPluginConfig? config) { - ThemeData themeData = Theme.of(context); - - Color color = this.color ?? themeData.primaryColor; - Color disableColor = this.disableColor ?? themeData.disabledColor; - Color prevColor; - Color nextColor; - - if (config!.loop!) { - prevColor = nextColor = color; - } else { - bool next = config.activeIndex! < config.itemCount! - 1; - bool prev = config.activeIndex! > 0; - prevColor = prev ? color : disableColor; - nextColor = next ? color : disableColor; - } - - Widget child; - if (config.scrollDirection == Axis.horizontal) { - child = Row( - key: key, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - buildButton(config, prevColor, iconPrevious, 0, true), - buildButton(config, nextColor, iconNext, 0, false) - ], - ); - } else { - child = Column( - key: key, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - buildButton(config, prevColor, iconPrevious, -3, true), - buildButton(config, nextColor, iconNext, -3, false) - ], - ); - } - - return SizedBox( - height: double.infinity, - child: child, - width: double.infinity, - ); - } -} - -class SwiperController extends IndexController { - // Autoplay is started - static const int START_AUTOPLAY = 2; - - // Autoplay is stopped. - static const int STOP_AUTOPLAY = 3; - - // Indicate that the user is swiping - static const int SWIPE = 4; - - // Indicate that the `Swiper` has changed it's index and is building it's ui ,so that the - // `SwiperPluginConfig` is available. - static const int BUILD = 5; - - // available when `event` == SwiperController.BUILD - SwiperPluginConfig? config; - - // available when `event` == SwiperController.SWIPE - // this value is PageViewController.pos - double? pos; - - // ignore: overridden_fields, annotate_overrides - int? index; - // ignore: overridden_fields, annotate_overrides - bool? animation; - bool? autoplay; - - SwiperController(); - - void startAutoplay() { - event = SwiperController.START_AUTOPLAY; - autoplay = true; - notifyListeners(); - } - - void stopAutoplay() { - event = SwiperController.STOP_AUTOPLAY; - autoplay = false; - notifyListeners(); - } -} - -class FractionPaginationBuilder extends SwiperPlugin { - ///color ,if set null , will be Theme.of(context).scaffoldBackgroundColor - final Color? color; - - ///color when active,if set null , will be Theme.of(context).primaryColor - final Color? activeColor; - - ////font size - final double fontSize; - - ///font size when active - final double activeFontSize; - - final Key? key; - - const FractionPaginationBuilder( - {this.color, - this.fontSize = 20.0, - this.key, - this.activeColor, - this.activeFontSize = 35.0}); - - @override - Widget build(BuildContext context, SwiperPluginConfig? config) { - ThemeData themeData = Theme.of(context); - Color activeColor = this.activeColor ?? themeData.primaryColor; - Color color = this.color ?? themeData.scaffoldBackgroundColor; - - if (Axis.vertical == config!.scrollDirection) { - return Column( - key: key, - mainAxisSize: MainAxisSize.min, - children: [ - Text( - "${config.activeIndex! + 1}", - style: TextStyle(color: activeColor, fontSize: activeFontSize), - ), - Text( - "/", - style: TextStyle(color: color, fontSize: fontSize), - ), - Text( - "${config.itemCount}", - style: TextStyle(color: color, fontSize: fontSize), - ) - ], - ); - } else { - return Row( - key: key, - mainAxisSize: MainAxisSize.min, - children: [ - Text( - "${config.activeIndex! + 1}", - style: TextStyle(color: activeColor, fontSize: activeFontSize), - ), - Text( - " / ${config.itemCount}", - style: TextStyle(color: color, fontSize: fontSize), - ) - ], - ); - } - } -} - -class RectSwiperPaginationBuilder extends SwiperPlugin { - ///color when current index,if set null , will be Theme.of(context).primaryColor - final Color? activeColor; - - ///,if set null , will be Theme.of(context).scaffoldBackgroundColor - final Color? color; - - ///Size of the rect when activate - final Size activeSize; - - ///Size of the rect - final Size size; - - /// Space between rects - final double space; - - final Key? key; - - const RectSwiperPaginationBuilder( - {this.activeColor, - this.color, - this.key, - this.size = const Size(10.0, 2.0), - this.activeSize = const Size(10.0, 2.0), - this.space = 3.0}); - - @override - Widget build(BuildContext context, SwiperPluginConfig? config) { - ThemeData themeData = Theme.of(context); - Color activeColor = this.activeColor ?? themeData.primaryColor; - Color color = this.color ?? themeData.scaffoldBackgroundColor; - - List list = []; - - if (config!.itemCount! > 20) { - // ignore: avoid_print - print( - "The itemCount is too big, we suggest use FractionPaginationBuilder instead of DotSwiperPaginationBuilder in this sitituation"); - } - - int itemCount = config.itemCount!; - int? activeIndex = config.activeIndex; - - for (int i = 0; i < itemCount; ++i) { - bool active = i == activeIndex; - Size size = active ? activeSize : this.size; - list.add(SizedBox( - width: size.width, - height: size.height, - child: Container( - color: active ? activeColor : color, - key: Key("pagination_$i"), - margin: EdgeInsets.all(space), - ), - )); - } - - if (config.scrollDirection == Axis.vertical) { - return Column( - key: key, - mainAxisSize: MainAxisSize.min, - children: list, - ); - } else { - return Row( - key: key, - mainAxisSize: MainAxisSize.min, - children: list, - ); - } - } -} - -class DotSwiperPaginationBuilder extends SwiperPlugin { - ///color when current index,if set null , will be Theme.of(context).primaryColor - final Color? activeColor; - - ///,if set null , will be Theme.of(context).scaffoldBackgroundColor - final Color? color; - - ///Size of the dot when activate - final double activeSize; - - ///Size of the dot - final double size; - - /// Space between dots - final double space; - - final Key? key; - - const DotSwiperPaginationBuilder( - {this.activeColor, - this.color, - this.key, - this.size = 10.0, - this.activeSize = 10.0, - this.space = 3.0}); - - @override - Widget build(BuildContext context, SwiperPluginConfig? config) { - if (config!.itemCount! > 20) { - // ignore: avoid_print - print( - "The itemCount is too big, we suggest use FractionPaginationBuilder instead of DotSwiperPaginationBuilder in this sitituation"); - } - Color? activeColor = this.activeColor; - Color? color = this.color; - - if (activeColor == null || color == null) { - ThemeData themeData = Theme.of(context); - activeColor = this.activeColor ?? themeData.primaryColor; - color = this.color ?? themeData.scaffoldBackgroundColor; - } - - if (config.indicatorLayout != PageIndicatorLayout.NONE && - config.layout == SwiperLayout.DEFAULT) { - return PageIndicator( - count: config.itemCount!, - controller: config.pageController!, - layout: config.indicatorLayout, - size: size, - activeColor: activeColor, - color: color, - space: space, - ); - } - - List list = []; - - int itemCount = config.itemCount!; - int? activeIndex = config.activeIndex; - - for (int i = 0; i < itemCount; ++i) { - bool active = i == activeIndex; - list.add(Container( - key: Key("pagination_$i"), - margin: EdgeInsets.all(space), - child: ClipOval( - child: Container( - color: active ? activeColor : color, - width: active ? activeSize : size, - height: active ? activeSize : size, - ), - ), - )); - } - - if (config.scrollDirection == Axis.vertical) { - return Column( - key: key, - mainAxisSize: MainAxisSize.min, - children: list, - ); - } else { - return Row( - key: key, - mainAxisSize: MainAxisSize.min, - children: list, - ); - } - } -} - -typedef SwiperPaginationBuilder = Widget Function( - BuildContext context, SwiperPluginConfig? config); - -class SwiperCustomPagination extends SwiperPlugin { - final SwiperPaginationBuilder builder; - - SwiperCustomPagination({required this.builder}); - - @override - Widget build(BuildContext context, SwiperPluginConfig? config) { - return builder(context, config); - } -} - -class SwiperPagination extends SwiperPlugin { - /// dot style pagination - static const SwiperPlugin dots = DotSwiperPaginationBuilder(); - - /// fraction style pagination - static const SwiperPlugin fraction = FractionPaginationBuilder(); - - static const SwiperPlugin rect = RectSwiperPaginationBuilder(); - - /// Alignment.bottomCenter by default when scrollDirection== Axis.horizontal - /// Alignment.centerRight by default when scrollDirection== Axis.vertical - final Alignment? alignment; - - /// Distance between pagination and the container - final EdgeInsetsGeometry margin; - - /// Build the widet - final SwiperPlugin builder; - - final Key? key; - - const SwiperPagination( - {this.alignment, - this.key, - this.margin = const EdgeInsets.all(10.0), - this.builder = SwiperPagination.dots}); - - @override - Widget build(BuildContext context, SwiperPluginConfig? config) { - Alignment alignment = this.alignment ?? - (config!.scrollDirection == Axis.horizontal - ? Alignment.bottomCenter - : Alignment.centerRight); - Widget child = Container( - margin: margin, - child: builder.build(context, config), - ); - if (!config!.outer!) { - child = Align( - key: key, - alignment: alignment, - child: child, - ); - } - return child; - } -} - -/// plugin to display swiper components -/// -abstract class SwiperPlugin { - const SwiperPlugin(); - - Widget build(BuildContext context, SwiperPluginConfig? config); -} - -class SwiperPluginConfig { - final int? activeIndex; - final int? itemCount; - final PageIndicatorLayout? indicatorLayout; - final Axis scrollDirection; - final bool? loop; - final bool? outer; - final PageController? pageController; - final SwiperController controller; - final SwiperLayout? layout; - - const SwiperPluginConfig( - {this.activeIndex, - this.itemCount, - this.indicatorLayout, - this.outer, - required this.scrollDirection, - required this.controller, - this.pageController, - this.layout, - this.loop}); -} - -class SwiperPluginView extends StatelessWidget { - final SwiperPlugin plugin; - final SwiperPluginConfig config; - - const SwiperPluginView(this.plugin, this.config, {Key? key}) - : super(key: key); - - @override - Widget build(BuildContext context) { - return plugin.build(context, config); - } -} - -abstract class _CustomLayoutStateBase extends State - with SingleTickerProviderStateMixin { - double? _swiperWidth; - double? _swiperHeight; - late Animation _animation; - AnimationController? _animationController; - late int _startIndex; - int? _animationCount; - - @override - void initState() { - if (widget.itemWidth == null) { - throw Exception( - "==============\n\nwidget.itemWith must not be null when use stack layout.\n========\n"); - } - - _createAnimationController(); - widget.controller!.addListener(_onController); - super.initState(); - } - - void _createAnimationController() { - _animationController = AnimationController(vsync: this, value: 0.5); - Tween tween = Tween(begin: 0.0, end: 1.0); - _animation = tween.animate(_animationController!); - } - - @override - void didChangeDependencies() { - WidgetsBinding.instance!.addPostFrameCallback(_getSize); - super.didChangeDependencies(); - } - - void _getSize(dynamic _) { - afterRender(); - } - - @mustCallSuper - void afterRender() { - RenderObject renderObject = context.findRenderObject()!; - Size size = renderObject.paintBounds.size; - _swiperWidth = size.width; - _swiperHeight = size.height; - setState(() {}); - } - - @override - void didUpdateWidget(T oldWidget) { - if (widget.controller != oldWidget.controller) { - oldWidget.controller!.removeListener(_onController); - widget.controller!.addListener(_onController); - } - - if (widget.loop != oldWidget.loop) { - if (!widget.loop!) { - _currentIndex = _ensureIndex(_currentIndex); - } - } - - super.didUpdateWidget(oldWidget); - } - - int _ensureIndex(int index) { - index = index % widget.itemCount!; - if (index < 0) { - index += widget.itemCount!; - } - return index; - } - - @override - void dispose() { - widget.controller!.removeListener(_onController); - _animationController?.dispose(); - super.dispose(); - } - - Widget _buildItem(int i, int realIndex, double animationValue); - - Widget _buildContainer(List list) { - return Stack( - children: list, - ); - } - - Widget _buildAnimation(BuildContext context, Widget? w) { - List list = []; - - double animationValue = _animation.value; - - for (int i = 0; i < _animationCount!; ++i) { - int realIndex = _currentIndex + i + _startIndex; - realIndex = realIndex % widget.itemCount!; - if (realIndex < 0) { - realIndex += widget.itemCount!; - } - - list.add(_buildItem(i, realIndex, animationValue)); - } - - return GestureDetector( - behavior: HitTestBehavior.opaque, - onPanStart: _onPanStart, - onPanEnd: _onPanEnd, - onPanUpdate: _onPanUpdate, - child: ClipRect( - child: Center( - child: _buildContainer(list), - ), - ), - ); - } - - @override - Widget build(BuildContext context) { - if (_animationCount == null) { - return Container(); - } - return AnimatedBuilder( - animation: _animationController!, builder: _buildAnimation); - } - - late double _currentValue; - late double _currentPos; - - bool _lockScroll = false; - - Future _move(double position, {int? nextIndex}) async { - if (_lockScroll) return; - try { - _lockScroll = true; - await _animationController!.animateTo(position, - duration: Duration(milliseconds: widget.duration!), - curve: widget.curve!); - if (nextIndex != null) { - widget.onIndexChanged!(widget.getCorrectIndex(nextIndex)); - } - } catch (e) { - // ignore: avoid_print - print(e); - } finally { - if (nextIndex != null) { - try { - _animationController!.value = 0.5; - } catch (e) { - // ignore: avoid_print - print(e); - } - - _currentIndex = nextIndex; - } - _lockScroll = false; - } - } - - int _nextIndex() { - int index = _currentIndex + 1; - if (!widget.loop! && index >= widget.itemCount! - 1) { - return widget.itemCount! - 1; - } - return index; - } - - int _prevIndex() { - int index = _currentIndex - 1; - if (!widget.loop! && index < 0) { - return 0; - } - return index; - } - - void _onController() { - switch (widget.controller!.event) { - case IndexController.PREVIOUS: - int prevIndex = _prevIndex(); - if (prevIndex == _currentIndex) return; - _move(1.0, nextIndex: prevIndex); - break; - case IndexController.NEXT: - int nextIndex = _nextIndex(); - if (nextIndex == _currentIndex) return; - _move(0.0, nextIndex: nextIndex); - break; - case IndexController.MOVE: - throw Exception( - "Custom layout does not support SwiperControllerEvent.MOVE_INDEX yet!"); - case SwiperController.STOP_AUTOPLAY: - case SwiperController.START_AUTOPLAY: - break; - } - } - - void _onPanEnd(DragEndDetails details) { - if (_lockScroll) return; - - double velocity = widget.scrollDirection == Axis.horizontal - ? details.velocity.pixelsPerSecond.dx - : details.velocity.pixelsPerSecond.dy; - - if (_animationController!.value >= 0.75 || velocity > 500.0) { - if (_currentIndex <= 0 && !widget.loop!) { - return; - } - _move(1.0, nextIndex: _currentIndex - 1); - } else if (_animationController!.value < 0.25 || velocity < -500.0) { - if (_currentIndex >= widget.itemCount! - 1 && !widget.loop!) { - return; - } - _move(0.0, nextIndex: _currentIndex + 1); - } else { - _move(0.5); - } - } - - void _onPanStart(DragStartDetails details) { - if (_lockScroll) return; - _currentValue = _animationController!.value; - _currentPos = widget.scrollDirection == Axis.horizontal - ? details.globalPosition.dx - : details.globalPosition.dy; - } - - void _onPanUpdate(DragUpdateDetails details) { - if (_lockScroll) return; - double value = _currentValue + - ((widget.scrollDirection == Axis.horizontal - ? details.globalPosition.dx - : details.globalPosition.dy) - - _currentPos) / - _swiperWidth! / - 2; - // no loop ? - if (!widget.loop!) { - if (_currentIndex >= widget.itemCount! - 1) { - if (value < 0.5) { - value = 0.5; - } - } else if (_currentIndex <= 0) { - if (value > 0.5) { - value = 0.5; - } - } - } - - _animationController!.value = value; - } - - int _currentIndex = 0; -} - -double? _getValue(List values, double animationValue, int index) { - double? s = values[index]; - if (animationValue >= 0.5) { - if (index < values.length - 1) { - s = s! + (values[index + 1]! - s) * (animationValue - 0.5) * 2.0; - } - } else { - if (index != 0) { - s = s! - (s - values[index - 1]!) * (0.5 - animationValue) * 2.0; - } - } - return s; -} - -Offset _getOffsetValue(List values, double animationValue, int index) { - Offset s = values[index]; - double dx = s.dx; - double dy = s.dy; - if (animationValue >= 0.5) { - if (index < values.length - 1) { - dx = dx + (values[index + 1].dx - dx) * (animationValue - 0.5) * 2.0; - dy = dy + (values[index + 1].dy - dy) * (animationValue - 0.5) * 2.0; - } - } else { - if (index != 0) { - dx = dx - (dx - values[index - 1].dx) * (0.5 - animationValue) * 2.0; - dy = dy - (dy - values[index - 1].dy) * (0.5 - animationValue) * 2.0; - } - } - return Offset(dx, dy); -} - -abstract class TransformBuilder { - List? values; - TransformBuilder({this.values}); - Widget build(int i, double animationValue, Widget widget); -} - -class ScaleTransformBuilder extends TransformBuilder { - final Alignment alignment; - ScaleTransformBuilder( - {List? values, this.alignment = Alignment.center}) - : super(values: values); - - @override - Widget build(int i, double animationValue, Widget widget) { - double s = _getValue(values!, animationValue, i)!; - return Transform.scale(scale: s, child: widget); - } -} - -class OpacityTransformBuilder extends TransformBuilder { - OpacityTransformBuilder({List? values}) : super(values: values); - - @override - Widget build(int i, double animationValue, Widget widget) { - double v = _getValue(values!, animationValue, i)!; - return Opacity( - opacity: v, - child: widget, - ); - } -} - -class RotateTransformBuilder extends TransformBuilder { - RotateTransformBuilder({List? values}) : super(values: values); - - @override - Widget build(int i, double animationValue, Widget widget) { - double v = _getValue(values!, animationValue, i)!; - return Transform.rotate( - angle: v, - child: widget, - ); - } -} - -class TranslateTransformBuilder extends TransformBuilder { - TranslateTransformBuilder({List? values}) : super(values: values); - - @override - Widget build(int i, double animationValue, Widget widget) { - Offset s = _getOffsetValue(values!, animationValue, i); - return Transform.translate( - offset: s, - child: widget, - ); - } -} - -class CustomLayoutOption { - final List builders = []; - final int startIndex; - final int? stateCount; - - CustomLayoutOption({this.stateCount, required this.startIndex}); - - CustomLayoutOption addOpacity(List values) { - builders.add(OpacityTransformBuilder(values: values)); - return this; - } - - CustomLayoutOption addTranslate(List values) { - builders.add(TranslateTransformBuilder(values: values)); - return this; - } - - CustomLayoutOption addScale(List values, Alignment alignment) { - builders.add(ScaleTransformBuilder(values: values, alignment: alignment)); - return this; - } - - CustomLayoutOption addRotate(List values) { - builders.add(RotateTransformBuilder(values: values)); - return this; - } -} - -class _CustomLayoutSwiper extends _SubSwiper { - final CustomLayoutOption option; - - const _CustomLayoutSwiper( - {required this.option, - double? itemWidth, - bool? loop, - double? itemHeight, - ValueChanged? onIndexChanged, - Key? key, - IndexedWidgetBuilder? itemBuilder, - Curve? curve, - int? duration, - int? index, - int? itemCount, - Axis? scrollDirection, - SwiperController? controller}) - : super( - loop: loop, - onIndexChanged: onIndexChanged, - itemWidth: itemWidth, - itemHeight: itemHeight, - key: key, - itemBuilder: itemBuilder, - curve: curve, - duration: duration, - index: index, - itemCount: itemCount, - controller: controller, - scrollDirection: scrollDirection); - - @override - State createState() { - return _CustomLayoutState(); - } -} - -class _CustomLayoutState extends _CustomLayoutStateBase<_CustomLayoutSwiper> { - @override - void didChangeDependencies() { - super.didChangeDependencies(); - _startIndex = widget.option.startIndex; - _animationCount = widget.option.stateCount; - } - - @override - void didUpdateWidget(_CustomLayoutSwiper oldWidget) { - _startIndex = widget.option.startIndex; - _animationCount = widget.option.stateCount; - super.didUpdateWidget(oldWidget); - } - - @override - Widget _buildItem(int index, int realIndex, double animationValue) { - List builders = widget.option.builders; - - Widget child = SizedBox( - width: widget.itemWidth ?? double.infinity, - height: widget.itemHeight ?? double.infinity, - child: widget.itemBuilder!(context, realIndex)); - - for (int i = builders.length - 1; i >= 0; --i) { - TransformBuilder builder = builders[i]; - child = builder.build(index, animationValue, child); - } - - return child; - } -} diff --git a/web/filipino_cuisine/lib/main.dart b/web/filipino_cuisine/lib/main.dart deleted file mode 100644 index 51582e1ee..000000000 --- a/web/filipino_cuisine/lib/main.dart +++ /dev/null @@ -1,158 +0,0 @@ -import 'dart:convert'; -import 'package:flutter/material.dart'; -import 'package:http/http.dart' as http; - -import 'cook.dart'; -import 'flutter_swiper.dart'; - -void main() => runApp(const MyApp()); - -class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); - - @override - Widget build(context) { - final _themeData = ThemeData( - brightness: Brightness.light, - iconTheme: const IconThemeData(color: Colors.red), - ); - return MaterialApp( - theme: _themeData.copyWith( - colorScheme: _themeData.colorScheme.copyWith( - secondary: Colors.red, - ), - ), - title: "Filipino Cuisine", - home: const Home()); - } -} - -class Home extends StatefulWidget { - const Home({Key? key}) : super(key: key); - - @override - HState createState() => HState(); -} - -class HState extends State { - Map? fd; - Map? fi; - - @override - void initState() { - super.initState(); - getData(); - } - - Future getData() async { - http.Response r = await http.get(Uri.parse( - 'https://flutter.github.io/samples/web/filipino_cuisine/data.json')); - fd = json.decode(r.body) as Map?; - setState(() => fi = fd!['0'] as Map?); - } - - @override - Widget build(context) { - if (fd == null) { - return Container( - color: Colors.white, - child: const Center( - child: CircularProgressIndicator(), - ), - ); - } - var t = Theme.of(context).textTheme; - return Scaffold( - body: Column( - children: [ - Expanded( - flex: 5, - child: Swiper( - onIndexChanged: (n) => - setState(() => fi = fd!['$n'] as Map?), - itemCount: - fd!.keys.where((key) => int.tryParse(key) != null).length, - itemBuilder: (cx, i) { - return Container( - margin: const EdgeInsets.only(top: 40, bottom: 24), - child: ClipRRect( - borderRadius: BorderRadius.circular(20), - child: Hero( - tag: fd!['$i']['fn'] as Object, - child: Image.asset(fd!['$i']['pf'] as String, - fit: BoxFit.cover)), - )); - }, - viewportFraction: .85, - scale: .9)), - Text(fi!['fn'] as String, - style: t.headline2! - .copyWith(fontFamily: 'ark', color: Colors.black)), - Container( - child: Text(fi!['cn'] as String, - style: - t.subtitle1!.apply(color: Colors.red, fontFamily: 'opb')), - margin: const EdgeInsets.only(top: 10, bottom: 30), - ), - Container( - child: Text(fi!['dc'] as String, - textAlign: TextAlign.center, - style: t.subtitle1!.copyWith(fontFamily: 'opr')), - margin: const EdgeInsets.only(left: 10, right: 10)), - Expanded( - flex: 2, - child: ListView.builder( - scrollDirection: Axis.horizontal, - itemCount: fi!['ig'].length as int?, - itemBuilder: (cx, i) { - return Row(children: [ - Container( - margin: const EdgeInsets.only(left: 10), - height: 60, - child: Image.asset(fi!['ig'][i]['p'] as String, - fit: BoxFit.contain)), - Container( - margin: const EdgeInsets.only(left: 5, right: 10), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text(fi!['ig'][i]['n'] as String, - style: t.subtitle2! - .copyWith(fontFamily: 'opb')), - Text(fi!['ig'][i]['c'] as String, - style: - t.caption!.copyWith(fontFamily: 'opr')) - ])) - ]); - })) - ], - ), - floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, - floatingActionButton: FloatingActionButton( - child: const Icon(Icons.restaurant_menu), - onPressed: () => Navigator.push( - context, - MaterialPageRoute( - builder: (cx) => Cook( - (fi!['in'] as List).cast(), - fi!['pf'] as String?, - fi!['fn'] as String?, - ))), - ), - bottomNavigationBar: BottomAppBar( - shape: const CircularNotchedRectangle(), - notchMargin: 4.0, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - IconButton( - icon: Icon(fi!['fv'] as bool - ? Icons.favorite - : Icons.favorite_border), - onPressed: () => - setState(() => fi!['fv'] = !(fi!['fv'] as bool))), - IconButton(icon: const Icon(Icons.share), onPressed: () {}) - ])), - ); - } -} diff --git a/web/filipino_cuisine/lib/transformer_page_view.dart b/web/filipino_cuisine/lib/transformer_page_view.dart deleted file mode 100644 index c25e77273..000000000 --- a/web/filipino_cuisine/lib/transformer_page_view.dart +++ /dev/null @@ -1,805 +0,0 @@ -// Package transformer_page_view: -// https://pub.dartlang.org/packages/transformer_page_view - -import 'dart:async'; - -import 'package:flutter/foundation.dart'; -import 'package:flutter/widgets.dart'; - -class IndexController extends ChangeNotifier { - // ignore: constant_identifier_names - static const int NEXT = 1; - // ignore: constant_identifier_names - static const int PREVIOUS = -1; - // ignore: constant_identifier_names - static const int MOVE = 0; - - late Completer _completer; - - int? index; - bool? animation; - int? event; - - Future move(int index, {bool? animation = true}) { - this.animation = animation ?? true; - this.index = index; - event = MOVE; - _completer = Completer(); - notifyListeners(); - return _completer.future; - } - - Future next({bool? animation = true}) { - event = NEXT; - this.animation = animation ?? true; - _completer = Completer(); - notifyListeners(); - return _completer.future; - } - - Future previous({bool? animation = true}) { - event = PREVIOUS; - this.animation = animation ?? true; - _completer = Completer(); - notifyListeners(); - return _completer.future; - } - - void complete() { - if (!_completer.isCompleted) { - _completer.complete(); - } - } -} - -typedef PaintCallback = void Function(Canvas canvas, Size siz); - -class ColorPainter extends CustomPainter { - final Paint _paint; - final TransformInfo info; - final List colors; - - ColorPainter(this._paint, this.info, this.colors); - - @override - void paint(Canvas canvas, Size size) { - int index = info.fromIndex!; - _paint.color = colors[index]; - canvas.drawRect(Rect.fromLTWH(0.0, 0.0, size.width, size.height), _paint); - if (info.done!) { - return; - } - int alpha; - int color; - double opacity; - double? position = info.position; - if (info.forward!) { - if (index < colors.length - 1) { - color = colors[index + 1].value & 0x00ffffff; - opacity = (position! <= 0 - ? (-position / info.viewportFraction!) - : 1 - position / info.viewportFraction!); - if (opacity > 1) { - opacity -= 1.0; - } - if (opacity < 0) { - opacity += 1.0; - } - alpha = (0xff * opacity).toInt(); - - _paint.color = Color((alpha << 24) | color); - canvas.drawRect( - Rect.fromLTWH(0.0, 0.0, size.width, size.height), _paint); - } - } else { - if (index > 0) { - color = colors[index - 1].value & 0x00ffffff; - opacity = (position! > 0 - ? position / info.viewportFraction! - : (1 + position / info.viewportFraction!)); - if (opacity > 1) { - opacity -= 1.0; - } - if (opacity < 0) { - opacity += 1.0; - } - alpha = (0xff * opacity).toInt(); - - _paint.color = Color((alpha << 24) | color); - canvas.drawRect( - Rect.fromLTWH(0.0, 0.0, size.width, size.height), _paint); - } - } - } - - @override - bool shouldRepaint(ColorPainter oldDelegate) { - return oldDelegate.info != info; - } -} - -class _ParallaxColorState extends State { - Paint paint = Paint(); - - @override - Widget build(BuildContext context) { - return CustomPaint( - painter: ColorPainter(paint, widget.info, widget.colors), - child: widget.child, - ); - } -} - -class ParallaxColor extends StatefulWidget { - final Widget child; - - final List colors; - - final TransformInfo info; - - const ParallaxColor({ - required this.colors, - required this.info, - required this.child, - Key? key, - }) : super(key: key); - - @override - State createState() { - return _ParallaxColorState(); - } -} - -class ParallaxContainer extends StatelessWidget { - final Widget child; - final double position; - final double translationFactor; - final double opacityFactor; - - const ParallaxContainer( - {required this.child, - required this.position, - this.translationFactor = 100.0, - this.opacityFactor = 1.0, - Key? key}) - : super(key: key); - - @override - Widget build(BuildContext context) { - return Opacity( - opacity: (1 - position.abs()).clamp(0.0, 1.0) * opacityFactor, - child: Transform.translate( - offset: Offset(position * translationFactor, 0.0), - child: child, - ), - ); - } -} - -class ParallaxImage extends StatelessWidget { - final Image image; - final double imageFactor; - - ParallaxImage.asset(String name, - {required double position, this.imageFactor = 0.3, Key? key}) - : image = Image.asset(name, - fit: BoxFit.cover, - alignment: FractionalOffset( - 0.5 + position * imageFactor, - 0.5, - )), - super(key: key); - - @override - Widget build(BuildContext context) { - return image; - } -} - -/// -/// NOTICE:: -/// -/// In order to make package smaller,currently we're not supporting any build-in page transformers -/// You can find build in transforms here: -/// -/// -/// - -const int kMaxValue = 2000000000; -const int kMiddleValue = 1000000000; - -/// Default auto play transition duration (in millisecond) -const int kDefaultTransactionDuration = 300; - -class TransformInfo { - /// The `width` of the `TransformerPageView` - final double? width; - - /// The `height` of the `TransformerPageView` - final double? height; - - /// The `position` of the widget pass to [PageTransformer.transform] - /// A `position` describes how visible the widget is. - /// The widget in the center of the screen' which is full visible, position is 0.0. - /// The widge in the left ,may be hidden, of the screen's position is less than 0.0, -1.0 when out of the screen. - /// The widge in the right ,may be hidden, of the screen's position is greater than 0.0, 1.0 when out of the screen - /// - /// - final double? position; - - /// The `index` of the widget pass to [PageTransformer.transform] - final int? index; - - /// The `activeIndex` of the PageView - final int? activeIndex; - - /// The `activeIndex` of the PageView, from user start to swipe - /// It will change when user end drag - final int? fromIndex; - - /// Next `index` is greater than this `index` - final bool? forward; - - /// User drag is done. - final bool? done; - - /// Same as [TransformerPageView.viewportFraction] - final double? viewportFraction; - - /// Copy from [TransformerPageView.scrollDirection] - final Axis? scrollDirection; - - TransformInfo( - {this.index, - this.position, - this.width, - this.height, - this.activeIndex, - this.fromIndex, - this.forward, - this.done, - this.viewportFraction, - this.scrollDirection}); -} - -abstract class PageTransformer { - /// - final bool reverse; - - PageTransformer({this.reverse = false}); - - /// Return a transformed widget, based on child and TransformInfo - Widget transform(Widget child, TransformInfo info); -} - -typedef PageTransformerBuilderCallback = Widget Function( - Widget child, TransformInfo info); - -class PageTransformerBuilder extends PageTransformer { - final PageTransformerBuilderCallback builder; - - PageTransformerBuilder({bool reverse = false, required this.builder}) - : super(reverse: reverse); - - @override - Widget transform(Widget child, TransformInfo info) { - return builder(child, info); - } -} - -class TransformerPageController extends PageController { - final bool loop; - final int? itemCount; - final bool reverse; - - TransformerPageController({ - int? initialPage = 0, - bool keepPage = true, - double viewportFraction = 1.0, - this.loop = false, - this.itemCount, - this.reverse = false, - }) : super( - initialPage: TransformerPageController._getRealIndexFromRenderIndex( - initialPage ?? 0, loop, itemCount, reverse)!, - keepPage: keepPage, - viewportFraction: viewportFraction); - - int getRenderIndexFromRealIndex(int? index) { - return _getRenderIndexFromRealIndex(index, loop, itemCount, reverse); - } - - int? getRealItemCount() { - if (itemCount == 0) return 0; - return loop ? itemCount! + kMaxValue : itemCount; - } - - static int _getRenderIndexFromRealIndex( - int? index, bool loop, int? itemCount, bool reverse) { - if (itemCount == 0) return 0; - int? renderIndex; - if (loop) { - renderIndex = index! - kMiddleValue; - renderIndex = renderIndex % itemCount!; - if (renderIndex < 0) { - renderIndex += itemCount; - } - } else { - renderIndex = index; - } - if (reverse) { - renderIndex = itemCount! - renderIndex! - 1; - } - - return renderIndex!; - } - - double? get realPage { - double? page; - - page = super.page; - - return page; - } - - static double _getRenderPageFromRealPage( - double? page, bool loop, int? itemCount, bool reverse) { - double? renderPage; - if (loop) { - renderPage = page! - kMiddleValue; - renderPage = renderPage % itemCount!; - if (renderPage < 0) { - renderPage += itemCount; - } - } else { - renderPage = page; - } - if (reverse) { - renderPage = itemCount! - renderPage! - 1; - } - - return renderPage!; - } - - @override - double? get page { - return loop - ? _getRenderPageFromRealPage(realPage, loop, itemCount, reverse) - : realPage; - } - - int? getRealIndexFromRenderIndex(int? index) { - return _getRealIndexFromRenderIndex(index, loop, itemCount, reverse); - } - - static int? _getRealIndexFromRenderIndex( - int? index, bool loop, int? itemCount, bool reverse) { - int? result = reverse ? (itemCount! - index! - 1) : index; - if (loop) { - result = result! + kMiddleValue; - } - return result; - } -} - -class TransformerPageView extends StatefulWidget { - /// Create a `transformed` widget base on the widget that has been passed to the [PageTransformer.transform]. - /// See [TransformInfo] - /// - final PageTransformer? transformer; - - /// Same as [PageView.scrollDirection] - /// - /// Defaults to [Axis.horizontal]. - final Axis scrollDirection; - - /// Same as [PageView.physics] - final ScrollPhysics? physics; - - /// Set to false to disable page snapping, useful for custom scroll behavior. - /// Same as [PageView.pageSnapping] - final bool pageSnapping; - - /// Called whenever the page in the center of the viewport changes. - /// Same as [PageView.onPageChanged] - final ValueChanged? onPageChanged; - - final IndexedWidgetBuilder? itemBuilder; - - // See [IndexController.mode],[IndexController.next],[IndexController.previous] - final IndexController? controller; - - /// Animation duration - final Duration duration; - - /// Animation curve - final Curve? curve; - - final TransformerPageController? pageController; - - /// Set true to open infinity loop mode. - final bool loop; - - /// This value is only valid when `pageController` is not set, - final int itemCount; - - /// This value is only valid when `pageController` is not set, - final double viewportFraction; - - /// If not set, it is controlled by this widget. - final int? index; - - /// Creates a scrollable list that works page by page using widgets that are - /// created on demand. - /// - /// This constructor is appropriate for page views with a large (or infinite) - /// number of children because the builder is called only for those children - /// that are actually visible. - /// - /// Providing a non-null [itemCount] lets the [PageView] compute the maximum - /// scroll extent. - /// - /// [itemBuilder] will be called only with indices greater than or equal to - /// zero and less than [itemCount]. - const TransformerPageView({ - Key? key, - this.index, - Duration? duration, - this.curve = Curves.ease, - this.viewportFraction = 1.0, - this.loop = false, - this.scrollDirection = Axis.horizontal, - this.physics, - this.pageSnapping = true, - this.onPageChanged, - this.controller, - this.transformer, - this.itemBuilder, - this.pageController, - required this.itemCount, - }) : assert(itemCount == 0 || itemBuilder != null || transformer != null), - duration = duration ?? - const Duration(milliseconds: kDefaultTransactionDuration), - super(key: key); - - factory TransformerPageView.children( - {Key? key, - int? index, - Duration? duration, - Curve curve = Curves.ease, - double viewportFraction = 1.0, - bool loop = false, - Axis scrollDirection = Axis.horizontal, - ScrollPhysics? physics, - bool pageSnapping = true, - ValueChanged? onPageChanged, - IndexController? controller, - PageTransformer? transformer, - required List children, - TransformerPageController? pageController}) { - return TransformerPageView( - itemCount: children.length, - itemBuilder: (context, index) { - return children[index]; - }, - pageController: pageController, - transformer: transformer, - pageSnapping: pageSnapping, - key: key, - index: index, - duration: duration, - curve: curve, - viewportFraction: viewportFraction, - scrollDirection: scrollDirection, - physics: physics, - onPageChanged: onPageChanged, - controller: controller, - ); - } - - @override - State createState() { - return _TransformerPageViewState(); - } - - static int? getRealIndexFromRenderIndex( - {required bool reverse, int? index, int? itemCount, required bool loop}) { - int? initPage = reverse ? (itemCount! - index! - 1) : index; - if (loop) { - initPage = initPage! + kMiddleValue; - } - return initPage; - } - - static PageController createPageController( - {required bool reverse, - int? index, - int? itemCount, - required bool loop, - required double viewportFraction}) { - return PageController( - initialPage: getRealIndexFromRenderIndex( - reverse: reverse, index: index, itemCount: itemCount, loop: loop)!, - viewportFraction: viewportFraction); - } -} - -class _TransformerPageViewState extends State { - Size? _size; - int? _activeIndex; - double? _currentPixels; - bool _done = false; - - ///This value will not change until user end drag. - int? _fromIndex; - - PageTransformer? _transformer; - - TransformerPageController? _pageController; - - Widget _buildItemNormal(BuildContext context, int index) { - int renderIndex = _pageController!.getRenderIndexFromRealIndex(index); - Widget child = widget.itemBuilder!(context, renderIndex); - return child; - } - - Widget _buildItem(BuildContext context, int index) { - return AnimatedBuilder( - animation: _pageController!, - builder: (c, w) { - int renderIndex = _pageController!.getRenderIndexFromRealIndex(index); - Widget? child; - if (widget.itemBuilder != null) { - child = widget.itemBuilder!(context, renderIndex); - } - child ??= Container(); - if (_size == null) { - return child; - } - - double position; - - double? page = _pageController!.realPage; - - if (_transformer!.reverse) { - position = page! - index; - } else { - position = index - page!; - } - position *= widget.viewportFraction; - - TransformInfo info = TransformInfo( - index: renderIndex, - width: _size!.width, - height: _size!.height, - position: position.clamp(-1.0, 1.0), - activeIndex: - _pageController!.getRenderIndexFromRealIndex(_activeIndex), - fromIndex: _fromIndex, - forward: _pageController!.position.pixels - _currentPixels! >= 0, - done: _done, - scrollDirection: widget.scrollDirection, - viewportFraction: widget.viewportFraction); - return _transformer!.transform(child, info); - }); - } - - double? _calcCurrentPixels() { - _currentPixels = - _pageController!.getRenderIndexFromRealIndex(_activeIndex) * - _pageController!.position.viewportDimension * - widget.viewportFraction; - - // print("activeIndex:$_activeIndex , pix:$_currentPixels"); - - return _currentPixels; - } - - @override - Widget build(BuildContext context) { - IndexedWidgetBuilder builder = - _transformer == null ? _buildItemNormal : _buildItem; - Widget child = PageView.builder( - itemBuilder: builder, - itemCount: _pageController!.getRealItemCount(), - onPageChanged: _onIndexChanged, - controller: _pageController, - scrollDirection: widget.scrollDirection, - physics: widget.physics, - pageSnapping: widget.pageSnapping, - reverse: _pageController!.reverse, - ); - if (_transformer == null) { - return child; - } - return NotificationListener( - // ignore: avoid_types_on_closure_parameters - onNotification: (ScrollNotification notification) { - if (notification is ScrollStartNotification) { - _calcCurrentPixels(); - _done = false; - _fromIndex = _activeIndex; - } else if (notification is ScrollEndNotification) { - _calcCurrentPixels(); - _fromIndex = _activeIndex; - _done = true; - } - - return false; - }, - child: child); - } - - void _onIndexChanged(int index) { - _activeIndex = index; - if (widget.onPageChanged != null) { - widget - .onPageChanged!(_pageController!.getRenderIndexFromRealIndex(index)); - } - } - - void _onGetSize(dynamic _) { - Size? size; - RenderObject? renderObject = context.findRenderObject(); - if (renderObject != null) { - Rect bounds = renderObject.paintBounds; - size = bounds.size; - } - _calcCurrentPixels(); - onGetSize(size); - } - - void onGetSize(Size? size) { - if (mounted) { - setState(() { - _size = size; - }); - } - } - - @override - void initState() { - _transformer = widget.transformer; - // int index = widget.index ?? 0; - _pageController = widget.pageController; - _pageController ??= TransformerPageController( - initialPage: widget.index, - itemCount: widget.itemCount, - loop: widget.loop, - reverse: - widget.transformer == null ? false : widget.transformer!.reverse); - // int initPage = _getRealIndexFromRenderIndex(index); - // _pageController = new PageController(initialPage: initPage,viewportFraction: widget.viewportFraction); - _fromIndex = _activeIndex = _pageController!.initialPage; - - _controller = getNotifier(); - if (_controller != null) { - _controller!.addListener(onChangeNotifier); - } - super.initState(); - } - - @override - void didUpdateWidget(TransformerPageView oldWidget) { - _transformer = widget.transformer; - int index = widget.index ?? 0; - bool created = false; - if (_pageController != widget.pageController) { - if (widget.pageController != null) { - _pageController = widget.pageController; - } else { - created = true; - _pageController = TransformerPageController( - initialPage: widget.index, - itemCount: widget.itemCount, - loop: widget.loop, - reverse: widget.transformer == null - ? false - : widget.transformer!.reverse); - } - } - - if (_pageController!.getRenderIndexFromRealIndex(_activeIndex) != index) { - _fromIndex = _activeIndex = _pageController!.initialPage; - if (!created) { - int initPage = _pageController!.getRealIndexFromRenderIndex(index)!; - _pageController!.animateToPage(initPage, - duration: widget.duration, curve: widget.curve!); - } - } - if (_transformer != null) { - WidgetsBinding.instance!.addPostFrameCallback(_onGetSize); - } - - if (_controller != getNotifier()) { - if (_controller != null) { - _controller!.removeListener(onChangeNotifier); - } - _controller = getNotifier(); - if (_controller != null) { - _controller!.addListener(onChangeNotifier); - } - } - super.didUpdateWidget(oldWidget); - } - - @override - void didChangeDependencies() { - if (_transformer != null) { - WidgetsBinding.instance!.addPostFrameCallback(_onGetSize); - } - super.didChangeDependencies(); - } - - ChangeNotifier? getNotifier() { - return widget.controller; - } - - int _calcNextIndex(bool next) { - int? currentIndex = _activeIndex; - if (_pageController!.reverse) { - if (next) { - currentIndex = currentIndex! - 1; - } else { - currentIndex = currentIndex! + 1; - } - } else { - if (next) { - currentIndex = currentIndex! + 1; - } else { - currentIndex = currentIndex! - 1; - } - } - - if (!_pageController!.loop) { - if (currentIndex >= _pageController!.itemCount!) { - currentIndex = 0; - } else if (currentIndex < 0) { - currentIndex = _pageController!.itemCount! - 1; - } - } - - return currentIndex; - } - - void onChangeNotifier() { - int? event = widget.controller!.event; - int? index; - switch (event) { - case IndexController.MOVE: - { - index = _pageController! - .getRealIndexFromRenderIndex(widget.controller!.index); - } - break; - case IndexController.PREVIOUS: - case IndexController.NEXT: - { - index = _calcNextIndex(event == IndexController.NEXT); - } - break; - default: - //ignore this event - return; - } - if (widget.controller!.animation!) { - _pageController! - .animateToPage(index!, - duration: widget.duration, curve: widget.curve ?? Curves.ease) - .whenComplete(widget.controller!.complete); - } else { - _pageController!.jumpToPage(index!); - widget.controller!.complete(); - } - } - - ChangeNotifier? _controller; - - @override - void dispose() { - super.dispose(); - if (_controller != null) { - _controller!.removeListener(onChangeNotifier); - } - } -} diff --git a/web/filipino_cuisine/pubspec.lock b/web/filipino_cuisine/pubspec.lock deleted file mode 100644 index 9e296e47c..000000000 --- a/web/filipino_cuisine/pubspec.lock +++ /dev/null @@ -1,142 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.8.2" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - flutter_page_indicator: - dependency: transitive - description: - name: flutter_page_indicator - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.3" - flutter_swiper: - dependency: "direct main" - description: - name: flutter_swiper - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" - http: - dependency: "direct main" - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.13.4" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.0" - lints: - dependency: transitive - description: - name: lints - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.0" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.1" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - transformer_page_view: - dependency: transitive - description: - name: transformer_page_view - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.6" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" -sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=0.1.4" diff --git a/web/filipino_cuisine/pubspec.yaml b/web/filipino_cuisine/pubspec.yaml deleted file mode 100644 index fbd68d55d..000000000 --- a/web/filipino_cuisine/pubspec.yaml +++ /dev/null @@ -1,66 +0,0 @@ -name: filipino_cuisine - -environment: - sdk: '>=2.12.0 <3.0.0' - -dependencies: - flutter: - sdk: flutter - flutter_swiper: ^1.1.6 - http: ^0.13.4 - -dev_dependencies: - flutter_lints: ^1.0.0 - -flutter_icons: - android: "launcher_icon" - ios: true - image_path: "assets/icon/fc_icon.png" - -flutter: - uses-material-design: true - assets: - - calamares.jpg - - beef_caldereta.jpg - - pochero.jpg - - pork_sisig.jpg - - embutido.jpg - - black_pepper.png - - butter.png - - chili.png - - egg.png - - flour.png - - garlic.png - - lemon.png - - oil.png - - onion.png - - pork.png - - salt.png - - squid.png - - tomato.png - - banana.png - - cabbage.png - - bokchoy.png - - green_beans.png - - potato.png - - red_pepper.png - - yellow_onion.png - - red_bell.png - - green_bell.png - - carrot.png - - beef.png - - cheese.png - - raisins.png - - ground_pork.png - - sausage.png - - preview.png - fonts: - - family: opr - fonts: - - asset: fonts/OpenSans-Regular.ttf - - family: opb - fonts: - - asset: fonts/OpenSans-Bold.ttf - - family: ark - fonts: - - asset: fonts/Arkipelago.otf diff --git a/web/filipino_cuisine/web/data.json b/web/filipino_cuisine/web/data.json deleted file mode 100644 index 267eee91f..000000000 --- a/web/filipino_cuisine/web/data.json +++ /dev/null @@ -1,366 +0,0 @@ -{ - "0":{ - "cn":"120 Gr 85 Kcal 13 Min", - "ct":"3 minutes", - "dc":"Calamares is the Filipino version of the Mediterranean breaded fried squid dish, Calamari. ", - "fn":"Calamares", - "fv":false, - "ig":[ - { - "c":"1/2 lb", - "n":"Squid", - "p":"squid.png" - }, - { - "c":"3/4 cup", - "n":"Flour", - "p":"flour.png" - }, - { - "c":"1 pc", - "n":"Egg", - "p":"egg.png" - }, - { - "c":"1 tsp", - "n":"Salt", - "p":"salt.png" - }, - { - "c":"1/2 tsp", - "n":"Black Pepper", - "p":"black_pepper.png" - }, - { - "c":"2 cups", - "n":"Cooking Oil", - "p":"oil.png" - } - ], - "in":[ - "Combine squid, salt, and ground black pepper then mix well. Let stand for 10 minutes", - "Heat a cooking pot the pour-in cooking oil", - "Dredge the squid in flour then dip in beaten egg and roll over", - "When the oil is hot enough, deep-fry the squid until the color of the coating turns brown", - "Remove the fried squid from the cooking pot and transfer in a plate lined with paper towels", - "Serve with sinamak or Asian dipping sauce" - ], - "pf":"calamares.jpg", - "pt":"10 minutes", - "sv":"3", - "tt":"13 MIN" - }, - "1":{ - "cn":"260 Gr 293 Kcal 1 Hour 42 Min", - "ct":"1 hour 30 minutes", - "dc":"Sisig is a popular Filipino dish. It is composed of minced pork, chopped onion, and mayonnaise.", - "fn":"Pork Sisig", - "fv":false, - "ig":[ - { - "c":"1 1/2 lb", - "n":"Pork Meat", - "p":"pork.png" - }, - { - "c":"1 pc", - "n":"Onion", - "p":"onion.png" - }, - { - "c":"3 tsp", - "n":"Chili", - "p":"chili.png" - }, - { - "c":"1/2 tsp", - "n":"Garlic", - "p":"garlic.png" - }, - { - "c":"1/4 tsp", - "n":"Black Pepper", - "p":"black_pepper.png" - }, - { - "c":"1 pc", - "n":"Lemon", - "p":"lemon.png" - }, - { - "c":"1/2 cup", - "n":"Butter", - "p":"butter.png" - }, - { - "c":"1/2 tsp", - "n":"Salt", - "p":"salt.png" - }, - { - "c":"1 pc", - "n":"Egg", - "p":"egg.png" - } - ], - "in":[ - "Pour the water in a pan and bring to a boil Add salt and pepper", - "Put-in the pork meat then simmer for 40 minutes to 1 hour (or until tender)", - "Grill the boiled pork meat until done", - "Chop the pork meat into fine pieces", - "In a wide pan, melt the butter. Add the onions. Cook until onions are soft.", - "Put-in the ginger and cook for 2 minutes", - "Add the pork meat. Cook for 10 to 12 minutes", - "Put-in the soy sauce, garlic powder, and chili. Mix well", - "Add salt and pepper to taste", - "Put-in the mayonnaise and mix with the other ingredients", - "Transfer to a serving plate. Top with chopped green onions and raw egg", - "Add the lemon before eating" - ], - "pf":"pork_sisig.jpg", - "pt":"12 minutes", - "sv":"6", - "tt":"1 hour 42 minutes" - }, - "2":{ - "cn":"120 Gr 168 Kcal 1 Hour 10 Min", - "ct":"3 minutes", - "dc":"Pochero or Puchero is a well-loved Filipino stew. Made with meat, tomatoes, and saba bananas. ", - "fn":"Pochero", - "fv":false, - "ig":[ - { - "c":"1 large", - "n":"Banana", - "p":"banana.png" - }, - { - "c":"2 pcs", - "n":"Tomato", - "p":"tomato.png" - }, - { - "c":"1 lb", - "n":"Pork Meat", - "p":"pork.png" - }, - { - "c":"1 pc", - "n":"Onion", - "p":"onion.png" - }, - { - "c":"1 tsp", - "n":"Garlic", - "p":"garlic.png" - }, - { - "c":"1 tbsp", - "n":"Peppercorn", - "p":"black_pepper.png" - }, - { - "c":"1 medium", - "n":"Potato", - "p":"potato.png" - }, - { - "c":"1 small", - "n":"Cabbage", - "p":"cabbage.png" - }, - { - "c":"1 bunch", - "n":"Bok Choy", - "p":"bokchoy.png" - }, - { - "c":"1/4 lb", - "n":"Green Beans", - "p":"green_beans.png" - }, - { - "c":"2 tbsp", - "n":"Cooking Oil", - "p":"oil.png" - } - ], - "in":[ - "Heat cooking oil in a cooking pot", - "Sauté garlic, onions, and tomatoes", - "Add pork and cook until the color turns light brown", - "Put-in fish sauce, whole pepper corn, and tomato sauce. Stir.", - "Add water and let boil. Simmer until pork is tender (about 30 to 40 minutes)", - "Put-in potato, plantain, and chick peas. Cook for 5 to 7 minutes.", - "Add cabbage and long green beans. Cook for 5 minutes", - "Stir-in the bok choy. Cover the pot and turn off the heat", - "Let the residual heat cook the bok choy (about 5 minutes)", - "Transfer to a serving plate and serve" - ], - "pf":"pochero.jpg", - "pt":"10 minutes", - "sv":"3", - "tt":"13 MIN" - }, - "3":{ - "cn":"140 Gr 250 Kcal 1 Hour 30 Min", - "ct":"3 minutes", - "dc":"A type of Filipino Beef Stew. This dish is cooked in a tomato-based sauce with vegetables such as potato, carrot, and bell pepper.", - "fn":"Beef Caldereta", - "fv":false, - "ig":[ - { - "c":"1/2 lb", - "n":"Beef", - "p":"beef.png" - }, - { - "c":"2 medium", - "n":"Carrot", - "p":"carrot.png" - }, - { - "c":"1 large", - "n":"Potato", - "p":"potato.png" - }, - { - "c":"1 small", - "n":"Green Bell Pepper", - "p":"green_bell.png" - }, - { - "c":"1 small", - "n":"Red Bell Pepper", - "p":"red_bell.png" - }, - { - "c":"2 Cloves", - "n":"Garlic", - "p":"garlic.png" - }, - { - "c":"1 medium", - "n":"Yellow Onion", - "p":"yellow_onion.png" - }, - { - "c":"1 tsp", - "n":"Salt", - "p":"salt.png" - }, - { - "c":"6 tbsp", - "n":"Cooking oil", - "p":"oil.png" - }, - { - "c":"1 tsp", - "n":"Peppercorn", - "p":"black_pepper.png" - }, - { - "c":"1 tsp", - "n":"Red Pepper", - "p":"chili.png" - } - ], - "in":[ - "Heat a pan or wok and then pour 3 tablespoons cooking oil. Stir-fry the bell peppers for 3 minutes. Remove the bell peppers and put in a plate. Set aside", - "Using the oil in the pan (add more if necessary), pan fry the carrots and potato for 3 to 5 minutes. Put these in a plate and then set aside", - "Heat the remaining 3 tablespoons of oil in a clean pot", - "Sauté the garlic and onion", - "Add the beef. Cook until it turns light brown", - "Pour –in tomato sauce and water. Let boil", - "Continue to cook in low heat for 60 minutes or until the beef gets tender. Add more water if needed", - "Stir-in the liver spread and then add some salt and pepper", - "Put the pan-fried potato and carrots in the pot. Stir. Add the bell peppers", - "Cover the pot. Continue to cook for 5 minutes", - "Add the red pepper flakes. Stir and cook for 3 minutes more", - "Transfer to a serving plate. Serve" - ], - "pf":"beef_caldereta.jpg", - "pt":"10 minutes", - "sv":"3", - "tt":"13 MIN" - }, - "4":{ - "cn":"90 Gr 130 Kcal 1 Hour 15 Min", - "ct":"3 minutes", - "dc":"Pork Embutido is a Filipino-style meatloaf made with a festive mixture of ground pork, carrots, and raisins wrapped around slices of eggs and sausage.", - "fn":"Embutido", - "fv":false, - "ig":[ - { - "c":"2 lbs", - "n":"Ground pork", - "p":"ground_pork.png" - }, - { - "c":"12 pcs", - "n":"Sausage", - "p":"sausage.png" - }, - { - "c":"3 pcs", - "n":"Egg", - "p":"egg.png" - }, - { - "c":"2 cups", - "n":"Cheese", - "p":"cheese.png" - }, - { - "c":"1 cup", - "n":"Red Bell Pepper", - "p":"red_bell.png" - }, - { - "c":"1 cup", - "n":"Green Bell Pepper", - "p":"green_bell.png" - }, - { - "c":"1/2 cup", - "n":"Raisins", - "p":"raisins.png" - }, - { - "c":"1/2 cup", - "n":"Carrot", - "p":"carrot.png" - }, - { - "c":"1/2 cup", - "n":"Onion", - "p":"onion.png" - }, - { - "c":"2 tbsp", - "n":"Salt", - "p":"salt.png" - }, - { - "c":"1 tbsp", - "n":"Peppercorn", - "p":"black_pepper.png" - } - ], - "in":[ - "Place the ground pork in a large container", - "Add the bread crumbs then break the raw eggs and add it in. Mix well", - "Put-in the carrots, bell pepper (red and green), onion, pickle relish, and cheddar cheese. Mix thoroughly", - "Add the raisins, tomato sauce, salt, and pepper then mix well.", - "Put in the sliced vienna sausage and sliced boiled eggs alternately on the middle of the flat meat mixture.", - "Roll the foil to form a cylinder — locking the sausage and egg in the middle if the meat mixture. Once done, lock the edges of the foil.", - "Place in a steamer and let cook for 1 hour.", - "Place inside the refrigerator until temperature turns cold", - "Slice and serve" - ], - "pf":"embutido.jpg", - "pt":"10 minutes", - "sv":"3", - "tt":"13 MIN" - } -} diff --git a/web/filipino_cuisine/web/favicon.png b/web/filipino_cuisine/web/favicon.png deleted file mode 100644 index 8aaa46ac1..000000000 Binary files a/web/filipino_cuisine/web/favicon.png and /dev/null differ diff --git a/web/filipino_cuisine/web/icons/Icon-192.png b/web/filipino_cuisine/web/icons/Icon-192.png deleted file mode 100644 index b749bfef0..000000000 Binary files a/web/filipino_cuisine/web/icons/Icon-192.png and /dev/null differ diff --git a/web/filipino_cuisine/web/icons/Icon-512.png b/web/filipino_cuisine/web/icons/Icon-512.png deleted file mode 100644 index 88cfd48df..000000000 Binary files a/web/filipino_cuisine/web/icons/Icon-512.png and /dev/null differ diff --git a/web/filipino_cuisine/web/icons/Icon-maskable-192.png b/web/filipino_cuisine/web/icons/Icon-maskable-192.png deleted file mode 100644 index eb9b4d76e..000000000 Binary files a/web/filipino_cuisine/web/icons/Icon-maskable-192.png and /dev/null differ diff --git a/web/filipino_cuisine/web/icons/Icon-maskable-512.png b/web/filipino_cuisine/web/icons/Icon-maskable-512.png deleted file mode 100644 index d69c56691..000000000 Binary files a/web/filipino_cuisine/web/icons/Icon-maskable-512.png and /dev/null differ diff --git a/web/filipino_cuisine/web/index.html b/web/filipino_cuisine/web/index.html deleted file mode 100644 index 2eb82cd35..000000000 --- a/web/filipino_cuisine/web/index.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - filipino_cuisine - - - - - - - diff --git a/web/filipino_cuisine/web/manifest.json b/web/filipino_cuisine/web/manifest.json deleted file mode 100644 index 4836eb1fe..000000000 --- a/web/filipino_cuisine/web/manifest.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "filipino_cuisine", - "short_name": "filipino_cuisine", - "start_url": ".", - "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "A new Flutter project.", - "orientation": "portrait-primary", - "prefer_related_applications": false, - "icons": [ - { - "src": "icons/Icon-192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "icons/Icon-512.png", - "sizes": "512x512", - "type": "image/png" - }, - { - "src": "icons/Icon-maskable-192.png", - "sizes": "192x192", - "type": "image/png", - "purpose": "maskable" - }, - { - "src": "icons/Icon-maskable-512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } - ] -} diff --git a/web/samples_index/lib/src/samples.yaml b/web/samples_index/lib/src/samples.yaml index 5764999f9..7336ebabd 100644 --- a/web/samples_index/lib/src/samples.yaml +++ b/web/samples_index/lib/src/samples.yaml @@ -485,23 +485,6 @@ samples: web: web/charts type: demo - - name: Filipino Cuisine - author: github.com/markgrancapal - screenshots: - - url: images/filipino_cuisine1.png - alt: Filipino Cuisine screenshot - source: https://github.com/markgrancapal/filipino_cuisine - description: > - Flutter Create challenge entry - difficulty: intermediate - widgets: [] - packages: [] - platforms: ['web'] - links: [] - tags: ['demo', 'flutter create'] - web: web/filipino_cuisine - type: demo - - name: GitHub Dataviz author: Larva Labs screenshots: diff --git a/web/samples_index/web/images/filipino_cuisine1.png b/web/samples_index/web/images/filipino_cuisine1.png deleted file mode 100644 index 145c40343..000000000 Binary files a/web/samples_index/web/images/filipino_cuisine1.png and /dev/null differ