Skip to content

Commit

Permalink
Merge pull request syncfusion#753 from sfHariHaraSudhan/master
Browse files Browse the repository at this point in the history
FLUT-7439 - [Others] Moved changes from 1st volume release to master
  • Loading branch information
LavanyaGowtham2021 authored Mar 23, 2023
2 parents d56ed9b + e079040 commit bb4fb74
Show file tree
Hide file tree
Showing 25 changed files with 93 additions and 102 deletions.
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 31
compileSdkVersion flutter.compileSdkVersion

lintOptions {
disable 'InvalidPackage'
Expand All @@ -34,8 +34,8 @@ android {
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 31
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
package io.flutter.plugins;

import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import io.flutter.Log;

import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugins.pathprovider.PathProviderPlugin;
import io.flutter.plugins.urllauncher.UrlLauncherPlugin;

/**
* Generated file. Do not edit.
* This file is generated by the Flutter tool based on the
* plugins that support the Android platform.
*/
@Keep
public final class GeneratedPluginRegistrant {
private static final String TAG = "GeneratedPluginRegistrant";
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
try {
flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin());
} catch(Exception e) {
Log.e(TAG, "Error registering plugin path_provider_android, io.flutter.plugins.pathprovider.PathProviderPlugin", e);
}
try {
flutterEngine.getPlugins().add(new com.syncfusion.flutter.pdfviewer.SyncfusionFlutterPdfViewerPlugin());
} catch(Exception e) {
Log.e(TAG, "Error registering plugin syncfusion_flutter_pdfviewer, com.syncfusion.flutter.pdfviewer.SyncfusionFlutterPdfViewerPlugin", e);
public static void registerWith(PluginRegistry registry) {
if (alreadyRegisteredWith(registry)) {
return;
}
try {
flutterEngine.getPlugins().add(new io.flutter.plugins.urllauncher.UrlLauncherPlugin());
} catch(Exception e) {
Log.e(TAG, "Error registering plugin url_launcher_android, io.flutter.plugins.urllauncher.UrlLauncherPlugin", e);
PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin"));
UrlLauncherPlugin.registerWith(registry.registrarFor("io.flutter.plugins.urllauncher.UrlLauncherPlugin"));
}

private static boolean alreadyRegisteredWith(PluginRegistry registry) {
final String key = GeneratedPluginRegistrant.class.getCanonicalName();
if (registry.hasPlugin(key)) {
return true;
}
registry.registrarFor(key);
return false;
}
}
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.android.tools.build:gradle:7.2.0'
}
}

Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
2 changes: 1 addition & 1 deletion android/local.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sdk.dir=C:\\Users\\SriramKiranSenthilku\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\src\\flutter
flutter.buildMode=release
flutter.versionName=20.4.38
flutter.versionName=21.1.35
2 changes: 1 addition & 1 deletion lib/model/helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ Widget getFooter(BuildContext context, SampleModel model) {
),
Container(
padding: const EdgeInsets.only(top: 10),
child: Text('Copyright © 2001 - 2022 Syncfusion Inc.',
child: Text('Copyright © 2001 - 2023 Syncfusion Inc.',
style: TextStyle(
color: model.textColor.withOpacity(0.7),
fontSize: 12,
Expand Down
8 changes: 1 addition & 7 deletions lib/sample_details.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"description": "Visualize hierarchically structured data that is sized and colored by quantitative variables",
"image": "images/treemap.png",
"displayType": "tab",
"isBeta": true,
"controlId": 4,
"subItems": [
{
Expand Down Expand Up @@ -2712,7 +2711,7 @@
{
"type": "sample",
"title": "Sorting",
"description": "This sample demonstrates how to sort one or more columns. In the Web and Desktop platforms, you can sort multiple columns by tapping the column header with the CTRL key where as in a mobile platform you can tap the column headers. It also provides some additional functionalities like Tri-state sorting and displaying sort numbers that indicate the sort order.",
"description": "This sample demonstrates how to sort one or more columns. In the Web and Windows platforms, you can sort multiple columns by tapping the column header with the CTRL key and COMMAND key in macOS platform where as in a mobile platform you can tap the column headers. It also provides some additional functionalities like Tri-state sorting and displaying sort numbers that indicate the sort order.",
"key": "sorting_datagrid",
"codeLink": "https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/datagrid/sorting/datagrid_sorting.dart",
"needsPropertyPanel": true
Expand Down Expand Up @@ -3266,29 +3265,24 @@
"description": "Create Excel documents with text, numbers, cell formatting, formulas, charts, images, and more",
"image": "images/xlsio.png",
"displayType": "tab",
"isBeta": true,
"controlId": 2,
"status": "Updated",
"subItems": [
{
"type": "sample",
"title": "Expenses Report",
"key": "expenses_report",
"status": "Updated",
"codeLink": "https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/xlsio/expenses_report/expenses_report.dart"
},
{
"type": "sample",
"title": "Invoice",
"key": "invoice_excel",
"status": "Updated",
"codeLink": "https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/xlsio/invoice/invoice.dart"
},
{
"type": "sample",
"title": "Yearly Sales",
"key": "yearly_sales",
"status": "Updated",
"codeLink": "https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/xlsio/yearly_sales/yearly_sales.dart"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class _TrendLineDefaultState extends SampleViewState {
@override
void dispose() {
if (_slope != null) {
_slope!.clear();
_slope = [];
}
_trendlineTypeList!.clear();
super.dispose();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ class DealerDataGridSource extends DataGridSource {
}

@override
void onCellSubmit(DataGridRow dataGridRow, RowColumnIndex rowColumnIndex,
GridColumn column) {
Future<void> onCellSubmit(DataGridRow dataGridRow,
RowColumnIndex rowColumnIndex, GridColumn column) async {
final dynamic oldValue = dataGridRow
.getCells()
.firstWhereOrNull((DataGridCell dataGridCell) =>
Expand Down
43 changes: 42 additions & 1 deletion lib/samples/datagrid/datagridsource/product_datagridsource.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// ignore_for_file: depend_on_referenced_packages

import 'dart:math';

import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
// ignore: depend_on_referenced_packages
import 'package:syncfusion_flutter_datagrid/datagrid.dart';

import '../model/product.dart';
Expand Down Expand Up @@ -205,6 +207,45 @@ class ProductDataGridSource extends DataGridSource {
}
}

@override
int compare(DataGridRow? a, DataGridRow? b, SortColumnDetails sortColumn) {
if (_sampleName == 'Custom Sorting' && sortColumn.name == 'name') {
final String? value1 = a
?.getCells()
.firstWhereOrNull(
(dynamic element) => element.columnName == sortColumn.name)
?.value
?.toString();
final String? value2 = b
?.getCells()
.firstWhereOrNull(
(dynamic element) => element.columnName == sortColumn.name)
?.value
?.toString();

final int? aLength = value1?.length;
final int? bLength = value2?.length;

if (aLength == null || bLength == null) {
return 0;
}

if (aLength.compareTo(bLength) > 0) {
return sortColumn.sortDirection == DataGridSortDirection.ascending
? 1
: -1;
} else if (aLength.compareTo(bLength) == -1) {
return sortColumn.sortDirection == DataGridSortDirection.ascending
? -1
: 1;
} else {
return 0;
}
} else {
return super.compare(a, b, sortColumn);
}
}

final List<String> _product = <String>[
'Lax',
'Chocolate',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class _AttendanceTrackerXlsIOState extends SampleViewState {
sheet.getRangeByName('C12:C18').cellStyle.borders.all.lineStyle =
LineStyle.none;

final List<int> bytes = workbook.saveAsStream();
final List<int> bytes = workbook.saveSync();
workbook.dispose();

//Launch file.
Expand Down
2 changes: 1 addition & 1 deletion lib/samples/xlsio/auto_filter/auto_filter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class _AutoFilterXlsIOState extends SampleViewState {
}
//saving Sheet
sheet.getRangeByName('A1:C10').autoFitColumns();
final List<int> bytes = workbook.saveAsStream();
final List<int> bytes = workbook.saveSync();
workbook.dispose();
await FileSaveHelper.saveAndLaunchFile(bytes, fileName);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/samples/xlsio/balance_sheet/balance_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class _BalanceSheetXlsIOState extends SampleViewState {

workbook.protect(true, true, 'Syncfusion');

final List<int> bytes = workbook.saveAsStream();
final List<int> bytes = workbook.saveSync();
workbook.dispose();

//Launch file.
Expand Down
2 changes: 1 addition & 1 deletion lib/samples/xlsio/data_validation/data_validation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class _DataValidationXlsIOState extends SampleViewState {
sheet.getRangeByName('A1:C15').autoFit();

//Save and dispose Workbook
final List<int> bytes = workbook.saveAsStream();
final List<int> bytes = workbook.saveSync();
workbook.dispose();

//Launch file.
Expand Down
2 changes: 1 addition & 1 deletion lib/samples/xlsio/expenses_report/expenses_report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class _ExpensesReportXlsIOState extends SampleViewState {
chart.series[0].serieFormat.commonSerieOptions.holeSizePercent = 40;
sheet1.charts = charts;

final List<int> bytes = workbook.saveAsStream();
final List<int> bytes = workbook.saveSync();
workbook.dispose();

//Launch file.
Expand Down
2 changes: 1 addition & 1 deletion lib/samples/xlsio/invoice/invoice.dart
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class _InvoiceXlsIOState extends SampleViewState {
picture.lastRow = 7;
picture.lastColumn = 8;

final List<int> bytes = workbook.saveAsStream();
final List<int> bytes = workbook.saveSync();
workbook.dispose();

//Launch file.
Expand Down
2 changes: 1 addition & 1 deletion lib/samples/xlsio/table/table.dart
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class _TableXlsIOState extends SampleViewState {
sheet.getRangeByName('A2').freezePanes();

//Save and dispose Workbook
final List<int> bytes = workbook.saveAsStream();
final List<int> bytes = workbook.saveSync();
workbook.dispose();

//Launch file.
Expand Down
2 changes: 1 addition & 1 deletion lib/samples/xlsio/yearly_sales/yearly_sales.dart
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class _YearlySalesXlsIOState extends SampleViewState {

sheet.charts = charts;

final List<int> bytes = workbook.saveAsStream();
final List<int> bytes = workbook.saveSync();
workbook.dispose();

//Launch file.
Expand Down
6 changes: 0 additions & 6 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@
// Generated file. Do not edit.
//

// clang-format off

#include "generated_plugin_registrant.h"

#include <desktop_window/desktop_window_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) desktop_window_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DesktopWindowPlugin");
desktop_window_plugin_register_with_registrar(desktop_window_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
Expand Down
2 changes: 0 additions & 2 deletions linux/flutter/generated_plugin_registrant.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Generated file. Do not edit.
//

// clang-format off

#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_

Expand Down
9 changes: 0 additions & 9 deletions linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
desktop_window
url_launcher_linux
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
)

set(PLUGIN_BUNDLED_LIBRARIES)

foreach(plugin ${FLUTTER_PLUGIN_LIST})
Expand All @@ -18,8 +14,3 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)

foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)
4 changes: 0 additions & 4 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
import FlutterMacOS
import Foundation

import desktop_window
import path_provider_macos
import syncfusion_pdfviewer_macos
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
DesktopWindowPlugin.register(with: registry.registrar(forPlugin: "DesktopWindowPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SyncfusionFlutterPdfViewerPlugin.register(with: registry.registrar(forPlugin: "SyncfusionFlutterPdfViewerPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
}
Loading

0 comments on commit bb4fb74

Please sign in to comment.