diff --git a/.github/ISSUE_TEMPLATE/1_bug_report.yml b/.github/ISSUE_TEMPLATE/1_bug_report.yml new file mode 100644 index 00000000..61243230 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1_bug_report.yml @@ -0,0 +1,120 @@ +name: Report a bug +description: | + You have discovered a bug in our widgets that is causing your application to crash + or throw an exception. It appears that a widget is buggy, or something is not functioning correctly. +body: + - type: markdown + attributes: + value: | + Thank you for using Syncfusion widgets! + + If you are looking for support, please check out our documentation, knowledge base, help bot, + and feedbacks. If you are unable to find a solution, please report the bug here. + + - [User Guide Documentation](https://help.syncfusion.com/flutter/introduction/overview) + - [Knowledge Base](https://support.syncfusion.com/kb/cross-platforms/category/79) + - [HelpBot](https://helpbot.syncfusion.com) + - [Feedbacks](https://stackoverflow.com/questions/tagged/flutter?sort=frequent) + + You can also contact us through the following methods. + - [Support portal](https://support.syncfusion.com) + - [Support forums](https://www.syncfusion.com/forums) + - [Feedback portal](https://www.syncfusion.com/feedback/flutter) + - type: textarea + attributes: + label: Bug description + description: Clearly and concisely describe the problem. + placeholder: | + A clear and concise description of what the bug is. + validations: + required: true + - type: textarea + attributes: + label: Steps to reproduce + description: Kindly provide us with detailed steps to replicate the issue you are experiencing. + placeholder: | + 1. ... + 2. ... + 3. ... + validations: + required: true + - type: textarea + attributes: + label: Code sample + description: | + Kindly create a simplified, reproducible example that demonstrates the issue + and include it within the code block delineated by backticks. + Note: Refrain from posting screenshots containing code. + value: | +
Code sample + + ```dart + [Add your code here] + ``` + +
+ validations: + required: true + - type: textarea + attributes: + label: Screenshots or Video + description: | + Upload any screenshots or video of the bug if applicable. + value: | +
+ Screenshots / Video demonstration + + [Upload media here] + +
+ validations: + required: true + - type: textarea + attributes: + label: Stack Traces + description: | + If it is a runtime exception, kindly provide the stack trace from the console. + If the traces are too large to be uploaded to GitHub, you may upload them as a `zip` file. + Note: If no stack trace is available, please mention it. + value: | +
Stack Traces + + ```dart + [Add the Stack Traces here] + ``` + +
+ validations: + required: true + - type: dropdown + id: target_platforms + attributes: + label: On which target platforms have you observed this bug? + multiple: true + options: + - Android + - iOS + - Web + - Web (Android browser) + - Web (iOS browser) + - Windows + - macOS + - Linux + validations: + required: true + - type: textarea + attributes: + label: Flutter Doctor output + description: | + Kindly share the complete details generated by executing the command + `flutter doctor -v` in your terminal. + value: | +
Doctor output + + ```console + [Add your output here] + ``` + +
+ validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/2_feature_request.yml b/.github/ISSUE_TEMPLATE/2_feature_request.yml new file mode 100644 index 00000000..7f05a4ab --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2_feature_request.yml @@ -0,0 +1,41 @@ +name: Feature request +description: Propose a new idea. +body: + - type: markdown + attributes: + value: | + Thank you for using Syncfusion widgets! + + If you are looking for support, please check out our documentation, knowledge base, help bot, + and feedbacks. If you are unable to find a solution, please report the bug here. + + - [User Guide Documentation](https://help.syncfusion.com/flutter/introduction/overview) + - [Knowledge Base](https://support.syncfusion.com/kb/cross-platforms/category/79) + - [HelpBot](https://helpbot.syncfusion.com) + - [Feedbacks](https://stackoverflow.com/questions/tagged/flutter?sort=frequent) + + You can also contact us through the following methods. + - [Support portal](https://support.syncfusion.com) + - [Support forums](https://www.syncfusion.com/forums) + - [Feedback portal](https://www.syncfusion.com/feedback/flutter) + - type: textarea + attributes: + label: Use case + description: | + Kindly inform us of the issue you're encountering which has prompted you to suggest a new feature. + If your proposed feature is based on an existing problem, + could you please provide a detailed and concise explanation of the issue? + validations: + required: true + - type: textarea + attributes: + label: Proposal + description: | + Please provide a concise and precise description of your proposal. + + Include a visual representation of your concept. + * code samples + * images (illustrations, diagrams, screenshots) + * videos + validations: + required: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..45784b06 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.qodo diff --git a/LICENSE b/LICENSE index 81f11404..7c89f3a2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,14 +1,14 @@ -Syncfusion License +Syncfusion® License -Syncfusion Essential Flutter library is available under the Syncfusion Essential Studio program, and can be licensed either under the Syncfusion Community License Program or the Syncfusion commercial license. +Syncfusion Essential® Flutter library is available under the Syncfusion Essential Studio® program, and can be licensed either under the Syncfusion® Community License Program or the Syncfusion® commercial license. -To be qualified for the Syncfusion Community License Program you must have a gross revenue of less than one (1) million U.S. dollars ($1,000,000.00 USD) per year and have less than five (5) developers in your organization, and agree to be bound by Syncfusion’s terms and conditions. +To be qualified for the Syncfusion® Community License Program you must have a gross revenue of less than one (1) million U.S. dollars ($1,000,000.00 USD) per year and have less than five (5) developers in your organization, and agree to be bound by Syncfusion® terms and conditions. Customers who do not qualify for the community license can contact sales@syncfusion.com for commercial licensing options. -Under no circumstances can you use this product without (1) either a Community License or a commercial license and (2) without agreeing and abiding by Syncfusion’s license containing all terms and conditions. +Under no circumstances can you use this product without (1) either a Community License or a commercial license and (2) without agreeing and abiding by Syncfusion® license containing all terms and conditions. -The Syncfusion license that contains the terms and conditions can be found at +The Syncfusion® license that contains the terms and conditions can be found at https://www.syncfusion.com/content/downloads/syncfusion_license.pdf -Syncfusion provides implementation but you would subsequently need to have a license to use Flutter. The Flutter engine must be licensed from google directly. We do not license Flutter or the Flutter Engine and provide no license or rights even if you end up with the binaries from us by mistake. \ No newline at end of file +Syncfusion® provides implementation but you would subsequently need to have a license to use Flutter. The Flutter engine must be licensed from google directly. We do not license Flutter or the Flutter Engine and provide no license or rights even if you end up with the binaries from us by mistake. \ No newline at end of file diff --git a/README.md b/README.md index ed8e4f1b..a531e3e3 100644 --- a/README.md +++ b/README.md @@ -1,109 +1,139 @@ +# Syncfusion® Flutter examples -# Syncfusion Flutter Examples - -This repository contains the demos of Syncfusion Flutter UI widgets. This is the best place to check our widgets to get more insight about the usage of APIs. You can also check our widgets by installing the [sample browser application](https://play.google.com/store/apps/details?id=com.syncfusion.flutter.examples&hl=en) from Google Play Store, in which you can browse the demos for all the available widgets and view the source code of each example within the app itself. - - +This repository contains awesome demos of [Syncfusion® Flutter UI widgets](https://www.syncfusion.com/flutter-widgets). This is the best place to check our widgets to get more insight into the usage of APIs. You can also check our widgets by installing the complete Flutter sample browser from [Google Play Store](https://play.google.com/store/apps/details?id=com.syncfusion.flutter.examples) or [App Store](https://apps.apple.com/us/app/syncfusion-flutter-ui-widgets/id1475231341), in which you can browse the demo for all the widgets and view the source code of each sample within the app itself. + ## Table of contents -- [Requirements to run the demo](#requirements-to-run-the-demo) -- [Repository structure](#repository-structure) -- [Widgets catalog](#widgets-catalog) -- [How to run this project](#how-to-run-this-project) -- [Get the demo application](#get-the-demo-application) -- [Useful links](#useful-links) -- [Support and feedback](#support-and-feedback) -- [About Syncfusion](#about-syncfusion) +* [Requirements to run the demo](#requirements-to-run-the-demo) +* [Repository Structure](#repository-structure) +* [Widgets Catalog](#widgets-catalog) +* [License](#license) +* [Using the examples](#using-the-examples) +* [Support and Feedback](#support-and-feedback) ## Requirements to run the demo ## - -* [Flutter SDK](https://flutter.dev/docs/get-started/install) -* [Android studio](https://developer.android.com/studio/install) or [Visual studio code](https://code.visualstudio.com/download) -* Install Flutter extension in Android studio or in [VS code](https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter) - -## Repository structure ## - -This repository contains sample browser project. Each widgets sample will be found inside the lib/samples folder. Run this project to see the demo samples of all the Flutter widgets in single application. - -## Widgets catalog ## - -| Samples | Package | Description | -|---------|----------|-------------| -| DATA VISUALIZATION | -| [Cartesian Charts](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/chart/cartesian_charts) | [syncfusion_flutter_charts](https://pub.dev/packages/syncfusion_flutter_charts) | Plot over 30 chart types ranging from line charts to financial charts. | -| [Circular Charts](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/chart/circular_charts) | [syncfusion_flutter_charts](https://pub.dev/packages/syncfusion_flutter_charts) | Visualize the data using pie, doughnut, and radial bar charts. | -| [Pyramid Chart](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/chart/pyramid_charts) | [syncfusion_flutter_charts](https://pub.dev/packages/syncfusion_flutter_charts) | Visualize the organized data using pyramid chart. | -| [Funnel Chart](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/chart/funnel_charts) | [syncfusion_flutter_charts](https://pub.dev/packages/syncfusion_flutter_charts) | Visualize the sequential data using funnel chart. | -| [Radial Gauge](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/gauge) | [syncfusion_flutter_gauges](https://pub.dev/packages/syncfusion_flutter_gauges) | Visualize one or multiple measures on a circular scale with pointers and ranges. | -| [Barcodes](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/barcodes) | [syncfusion_flutter_barcodes](https://pub.dev/packages/syncfusion_flutter_barcodes) | Generate and display data in machine-readable 1D and 2D barcodes. | -| [Maps](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/maps) | [syncfusion_flutter_maps](https://pub.dev/packages/syncfusion_flutter_maps) | Easily visualize data over a geographical area. | -| [Circular ProgressBar](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/progress_bar) | [syncfusion_flutter_gauges](https://pub.dev/packages/syncfusion_flutter_gauges) | Designed using Radial Gauge widget. Indicates the progress of a task with customizable visuals. | -| GRIDS | -| [DataGrid](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/datagrid) | [syncfusion_flutter_datagrid](https://pub.dev/packages/syncfusion_flutter_datagrid) | Displays large amounts of data with different data types in a tabular view | -| CALENDAR | -| [Event Calendar](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/calendar) | [syncfusion_flutter_calendar](https://pub.dev/packages/syncfusion_flutter_calendar) | Allows you to easily visualize and schedule appointments. | -| [Date Range Picker](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/date_picker) | [syncfusion_flutter_datepicker](https://pub.dev/packages/syncfusion_flutter_datepicker) | Allows to easily select dates or range of dates. | -| VIEWER | -| [PDF Viewer](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/pdf_viewer) | [syncfusion_flutter_pdfviewer](https://pub.dev/packages/syncfusion_flutter_pdfviewer) | View the PDF document seamlessly and efficiently | -| FILE FORMATS | -| [PDF](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/pdf) | [syncfusion_flutter_pdf](https://pub.dev/packages/syncfusion_flutter_pdf) | Create PDF document with text, images and tables. | -| [XlsIO](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/xlsio) | [syncfusion_flutter_xlsio](https://pub.dev/packages/syncfusion_flutter_xlsio) | Create Excel documents with text, numbers, cell formatting, formulas, charts, images, and more. | -| SLIDERS | -| [Slider](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/sliders/slider) | [syncfusion_flutter_sliders](https://pub.dev/packages/syncfusion_flutter_sliders) | Select a date or numeric value. | -| [Range Slider](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/sliders/range_slider) | [syncfusion_flutter_sliders](https://pub.dev/packages/syncfusion_flutter_sliders) | Select a date or numeric range. | -| [Range Selector](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/sliders/range_selector) | [syncfusion_flutter_sliders](https://pub.dev/packages/syncfusion_flutter_sliders) | Visualize data and select a date or numeric range. | -| SIGNATURE PAD | -| [Signature Pad](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/signature_pad) | [syncfusion_flutter_signaturepad](https://pub.dev/packages/syncfusion_flutter_signaturepad) | Captures the signature and save it as an image to sync across devices and documents. | - -## How to run this project ## +* IDE tools are [Visual Studio code](https://flutter.dev/docs/get-started/editor?tab=vscode) and [Android studio](https://flutter.dev/docs/get-started/editor?tab=androidstudio). +* Flutter SDK + | Channel| Version| + |--------|--------| + | Stable | [3.24.0](https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_3.24.0-stable.zip)| + +* Dart and Flutter add-ons for Visual Studio Code (available via the Visual studio code extension) in Android Studio it available in plugin preference. + +## Repository Structure ## +The lib/samples directory contains the Flutter widget examples for each widget such as Charts, DataGrid, etc. All the examples can be deployed in Android, Web, Windows, iOS, Mac, and Linux platforms. + +## Widgets Catalog ## + +| Widgets | Repository | +| ------------- | --------------- | +| Barcode Generator | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/barcodes) | +| Calendar | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/calendar) | +| Chat | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/chat) | +| Charts | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/chart) | +| DataGrid | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/datagrid) | +| Date Range Picker | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/date_picker) | +| Linear Gauge | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/linear_gauge) | +| Maps | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/maps) | +| PDF | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/pdf) | +| PDF Viewer | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/pdf_viewer) | +| Progress Bar | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/progress_bar) | +| Radial Gauge | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/gauge) | +| Range Selector | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/sliders/range_selector) | +| Range Slider | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/sliders/range_slider) | +| Slider | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/sliders/slider) | +| Spark Charts | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/sparkline) | +| Signature Pad | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/signature_pad) | +| Treemap | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/treemap) | +| XlsIO | [Link](https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/xlsio) | + +## License ## + +Syncfusion® has no liability for any damage or consequence that may arise by the use or viewing of the examples. The examples are for demonstrative purposes and if you choose to use or access the examples you agree to not hold Syncfusion® liable, in any form, for any damage that is related to use, accessing or otherwise viewing the examples. By accessing, viewing, or otherwise seeing the examples you acknowledge and agree Syncfusion® examples will not allow you to seek injunctive relief in any form for any claim related to the sample. If you do not agree to this, do not view, access, utilize or otherwise do anything with Syncfusion® examples. + +## Using the examples ## **Step 1** -Download or clone the [flutter-examples](https://github.com/syncfusion/flutter-examples) repository into your machine. + Unzip the downloaded flutter example archive. + + **Note:** If you clone this repository ignore this step. **Step 2** +Open the flutter example folder in an IDE. + +**Step 3** + Run the following command to get the required packages. ```dart $ flutter pub get ``` -**Step 3** +**Step 4** + +Run your application using the following commands: + +**Windows & Linux** + +Run code: Ctrl + F5 + +Run with debugging: F5 or Run > Start Debugging -Run your application either using `F5` or `Run > Start Debugging`. +Stop debugging: Shift + F5 -## Get the demo application ## +Restart debugging: Ctrl + Shift + F5 + +**MacOS** + +Run code: Cmd + F5 + +Run with debugging: F5 or Run > Start Debugging + +Stop debugging: Shift + Cmd + F5 + +Restart debugging: Cmd + Shift + F5 + +**Web (VS Code in the Browser)** + +Run code: Ctrl + F5 + +Run with debugging: F5 or Run > Start Debugging + +## Get the demo application Explore the full capabilities of our Flutter widgets on your device by installing our sample browser applications from the below app stores, and view samples code in GitHub.

- - -

-

- + + +

+

+ + +

+ -## Useful links ## -Take a look at the following to learn more about Syncfusion Flutter widgets: +## Useful links +Take a look at the following to learn more about Syncfusion® Flutter widgets: -* [Syncfusion Flutter product page](https://www.syncfusion.com/flutter-widgets) +* [Syncfusion® Flutter product page](https://www.syncfusion.com/flutter-widgets) * [User guide documentation](https://help.syncfusion.com/flutter/introduction/overview) * [API reference](https://help.syncfusion.com/flutter/introduction/api-reference) -* [Source](https://github.com/syncfusion/flutter-widgets) * [Knowledge base](https://www.syncfusion.com/kb/flutter) * [Video tutorials](https://www.syncfusion.com/tutorial-videos/flutter) -## Support and feedback ## +## Support and feedback -* For any other queries, reach our [Syncfusion support team](https://www.syncfusion.com/support/directtrac/incidents/newincident) or post the queries through the [Community forums](https://www.syncfusion.com/forums) and submit a feature request or a bug through our [Feedback portal](https://www.syncfusion.com/feedback/flutter). +* For any other queries, reach our [Syncfusion® support team](https://www.syncfusion.com/support/directtrac/incidents/newincident) or post the queries through the [Community forums](https://www.syncfusion.com/forums) and submit a feature request or a bug through our [Feedback portal](https://www.syncfusion.com/feedback/flutter). * To renew the subscription, click [renew](https://www.syncfusion.com/sales/products) or contact our sales team at salessupport@syncfusion.com | Toll Free: 1-888-9 DOTNET. -## About Syncfusion +## About Syncfusion® -Founded in 2001 and headquartered in Research Triangle Park, N.C., Syncfusion has more than 20,000 customers and more than 1 million users, including large financial institutions, Fortune 500 companies, and global IT consultancies. +Founded in 2001 and headquartered in Research Triangle Park, N.C., Syncfusion® has more than 20,000 customers and more than 1 million users, including large financial institutions, Fortune 500 companies, and global IT consultancies. -Today we provide 1,000+ controls and frameworks for web ([ASP.NET Core](https://www.syncfusion.com/aspnet-core-ui-controls), [ASP.NET MVC](https://www.syncfusion.com/aspnet-mvc-ui-controls), [ASP.NET WebForms](https://www.syncfusion.com/jquery/aspnet-web-forms-ui-controls), [JavaScript](https://www.syncfusion.com/javascript-ui-controls), [Angular](https://www.syncfusion.com/angular-ui-components), [React](https://www.syncfusion.com/react-ui-components), [Vue](https://www.syncfusion.com/vue-ui-components), and [Blazor](https://www.syncfusion.com/blazor-components), mobile ([Xamarin](https://www.syncfusion.com/xamarin-ui-controls), [Flutter](https://www.syncfusion.com/flutter-widgets), [UWP](https://www.syncfusion.com/uwp-ui-controls), and [JavaScript](https://www.syncfusion.com/javascript-ui-controls)), and desktop development ([WinForms](https://www.syncfusion.com/winforms-ui-controls), [WPF](https://www.syncfusion.com/wpf-ui-controls), and [UWP](https://www.syncfusion.com/uwp-ui-controls)). We provide ready-to deploy enterprise software for dashboards, reports, data integration, and big data processing. Many customers have saved millions in licensing fees by deploying our software. +Today we provide 1,000+ controls and frameworks for web ([ASP.NET Core](https://www.syncfusion.com/aspnet-core-ui-controls), [ASP.NET MVC](https://www.syncfusion.com/aspnet-mvc-ui-controls), [ASP.NET WebForms](https://www.syncfusion.com/jquery/aspnet-web-forms-ui-controls), [JavaScript](https://www.syncfusion.com/javascript-ui-controls), [Angular](https://www.syncfusion.com/angular-ui-components), [React](https://www.syncfusion.com/react-ui-components), [Vue](https://www.syncfusion.com/vue-ui-components), and [Blazor](https://www.syncfusion.com/blazor-components), mobile ([Xamarin](https://www.syncfusion.com/xamarin-ui-controls), [Flutter](https://www.syncfusion.com/flutter-widgets), [UWP](https://www.syncfusion.com/uwp-ui-controls), and [JavaScript](https://www.syncfusion.com/javascript-ui-controls)), and desktop development ([WinForms](https://www.syncfusion.com/winforms-ui-controls), [WPF](https://www.syncfusion.com/wpf-ui-controls), and [UWP](https://www.syncfusion.com/uwp-ui-controls) and [WinUI](https://www.syncfusion.com/winui-controls)). We provide ready-to deploy enterprise software for dashboards, reports, data integration, and big data processing. Many customers have saved millions in licensing fees by deploying our software. diff --git a/analysis_options.yaml b/analysis_options.yaml index 59e7227c..1f1e4226 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1 +1,16 @@ -include: lib/analysis_options.yaml \ No newline at end of file +include: package:syncfusion_flutter_core/analysis_options.yaml + +analyzer: + errors: + include_file_not_found: ignore + lines_longer_than_80_chars: ignore + invalid_dependency: ignore + avoid_as: ignore + unnecessary_null_comparison: false + avoid_bool_literals_in_conditional_expressions: ignore + library_private_types_in_public_api: ignore + prefer_interpolation_to_compose_strings: ignore + always_specify_types: ignore + use_late_for_private_fields_and_variables: ignore + use_key_in_widget_constructors: ignore + diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 00000000..55afd919 --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/to/reference-keystore +key.properties +**/*.keystore +**/*.jks diff --git a/android/.gradle/4.10.2/taskHistory/taskHistory.bin b/android/.gradle/4.10.2/taskHistory/taskHistory.bin index f49f3dd0..80f6e9c1 100644 Binary files a/android/.gradle/4.10.2/taskHistory/taskHistory.bin and b/android/.gradle/4.10.2/taskHistory/taskHistory.bin differ diff --git a/android/.gradle/buildOutputCleanup/cache.properties b/android/.gradle/buildOutputCleanup/cache.properties index 4bab3493..d8c085d5 100644 --- a/android/.gradle/buildOutputCleanup/cache.properties +++ b/android/.gradle/buildOutputCleanup/cache.properties @@ -1,2 +1,2 @@ #Tue Jul 09 18:11:55 IST 2019 -gradle.version=4.10.2 +gradle.version=4.10.2 \ No newline at end of file diff --git a/android/.gradle/buildOutputCleanup/outputFiles.bin b/android/.gradle/buildOutputCleanup/outputFiles.bin index 6a433967..ecb203da 100644 Binary files a/android/.gradle/buildOutputCleanup/outputFiles.bin and b/android/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/android/app/build.gradle b/android/app/build.gradle index e8b5522e..ef2f8f92 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,61 +1,44 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' +plugins { + id "com.android.application" + id "kotlin-android" + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id "dev.flutter.flutter-gradle-plugin" } -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { - compileSdkVersion 28 + namespace = "com.syncfusion.flutter_examples" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } - lintOptions { - disable 'InvalidPackage' + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8 } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.syncfusion.flutter_examples" - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + applicationId = "com.syncfusion.flutter_examples" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName } buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug + signingConfig = signingConfigs.debug } } } flutter { - source '../..' -} - -dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + source = "../.." } diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 3b6b28e7..399f6981 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,6 +1,6 @@ - - diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 2867e27c..742a574e 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,46 +1,52 @@ - - - - - + - - - - - + + android:name="io.flutter.app.android.SplashScreenUntilFirstFrame" + android:value="true" /> + + + + + + + + + + + + diff --git a/android/app/src/main/java/com/syncfusion/flutter_examples/MainActivity.java b/android/app/src/main/java/com/syncfusion/flutter_examples/MainActivity.java index 0bf4909c..9ed08f48 100644 --- a/android/app/src/main/java/com/syncfusion/flutter_examples/MainActivity.java +++ b/android/app/src/main/java/com/syncfusion/flutter_examples/MainActivity.java @@ -20,7 +20,7 @@ import io.flutter.plugins.GeneratedPluginRegistrant; public class MainActivity extends FlutterActivity { - + @Override public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { GeneratedPluginRegistrant.registerWith(flutterEngine); @@ -29,7 +29,7 @@ public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { (call, result) -> { if (call.method.equals("viewPdf") || call.method.equals("viewExcel")) { String path = call.argument("file_path"); - if(!checkPermission(Manifest.permission.READ_EXTERNAL_STORAGE)){ + if(Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU && !checkPermission(Manifest.permission.READ_EXTERNAL_STORAGE)){ requestPermission(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}); } else { launchFile(path); diff --git a/android/app/src/main/kotlin/com/example/flutter_examples/MainActivity.kt b/android/app/src/main/kotlin/com/example/flutter_examples/MainActivity.kt new file mode 100644 index 00000000..4c80816e --- /dev/null +++ b/android/app/src/main/kotlin/com/example/flutter_examples/MainActivity.kt @@ -0,0 +1,79 @@ +package com.syncfusion.flutter_examples + +import android.Manifest +import android.content.Intent +import android.net.Uri +import android.os.Build +import android.os.Bundle +import androidx.core.app.ActivityCompat +import androidx.core.content.ContextCompat +import androidx.core.content.FileProvider +import androidx.core.content.PermissionChecker +import io.flutter.embedding.android.FlutterActivity +import io.flutter.embedding.engine.FlutterEngine +import io.flutter.plugin.common.MethodChannel +import java.io.File + +class MainActivity : FlutterActivity() { + private val CHANNEL = "launchFile" + + override fun configureFlutterEngine(flutterEngine: FlutterEngine) { + super.configureFlutterEngine(flutterEngine) + MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler { call, result -> + when (call.method) { + "viewPdf", "viewExcel" -> { + val path: String? = call.argument("file_path") + if (path != null) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU && !checkPermission(Manifest.permission.READ_EXTERNAL_STORAGE)) { + requestPermission(arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE)) + } else { + launchFile(path) + } + } else { + result.error("INVALID_PATH", "File path is null", null) + } + } + else -> result.notImplemented() + } + } + } + + private fun requestPermission(permissions: Array) { + ActivityCompat.requestPermissions(this, permissions, 1) + } + + private fun checkPermission(permission: String): Boolean { + return if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + true + } else { + ContextCompat.checkSelfPermission(this, permission) == PermissionChecker.PERMISSION_GRANTED + } + } + + private fun launchFile(filePath: String) { + val file = File(filePath) + if (file.exists()) { + val intent = Intent(Intent.ACTION_VIEW) + intent.flags = Intent.FLAG_ACTIVITY_SINGLE_TOP + intent.addCategory(Intent.CATEGORY_DEFAULT) + val uri: Uri = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) + val packageName = this.packageName + FileProvider.getUriForFile(this, "$packageName.fileProvider", file) + } else { + Uri.fromFile(file) + } + + intent.setDataAndType( + uri, + if (filePath.contains(".pdf")) "application/pdf" else "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + ) + + try { + startActivity(intent) + } catch (e: Exception) { + // Could not launch the file. + } + } + } +} diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 00000000..f74085f3 --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml index 7f8ad4a3..304732f8 100644 --- a/android/app/src/main/res/drawable/launch_background.xml +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -4,8 +4,9 @@ - + diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 00000000..06952be7 --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index 00fa4417..cb1ef880 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -1,8 +1,18 @@ - + + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml index 3b6b28e7..399f6981 100644 --- a/android/app/src/profile/AndroidManifest.xml +++ b/android/app/src/profile/AndroidManifest.xml @@ -1,6 +1,6 @@ - - diff --git a/android/build.gradle b/android/build.gradle index bb8a3038..d2ffbffa 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,29 +1,18 @@ -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' - } -} - allprojects { repositories { google() - jcenter() + mavenCentral() } } -rootProject.buildDir = '../build' +rootProject.buildDir = "../build" subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { - project.evaluationDependsOn(':app') + project.evaluationDependsOn(":app") } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/android/flutter_examples_android.iml b/android/flutter_examples_android.iml index 269c4d74..18999696 100644 --- a/android/flutter_examples_android.iml +++ b/android/flutter_examples_android.iml @@ -4,6 +4,8 @@