Skip to content

Commit bb4fb74

Browse files
author
LavanyaA
authored
Merge pull request #753 from sfHariHaraSudhan/master
FLUT-7439 - [Others] Moved changes from 1st volume release to master
2 parents d56ed9b + e079040 commit bb4fb74

File tree

25 files changed

+93
-102
lines changed

25 files changed

+93
-102
lines changed

android/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ apply plugin: 'com.android.application'
2525
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2626

2727
android {
28-
compileSdkVersion 31
28+
compileSdkVersion flutter.compileSdkVersion
2929

3030
lintOptions {
3131
disable 'InvalidPackage'
@@ -34,8 +34,8 @@ android {
3434
defaultConfig {
3535
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
3636
applicationId "com.syncfusion.flutter_examples"
37-
minSdkVersion 16
38-
targetSdkVersion 31
37+
minSdkVersion flutter.minSdkVersion
38+
targetSdkVersion flutter.targetSdkVersion
3939
versionCode flutterVersionCode.toInteger()
4040
versionName flutterVersionName
4141
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
11
package io.flutter.plugins;
22

3-
import androidx.annotation.Keep;
4-
import androidx.annotation.NonNull;
5-
import io.flutter.Log;
6-
7-
import io.flutter.embedding.engine.FlutterEngine;
3+
import io.flutter.plugin.common.PluginRegistry;
4+
import io.flutter.plugins.pathprovider.PathProviderPlugin;
5+
import io.flutter.plugins.urllauncher.UrlLauncherPlugin;
86

97
/**
108
* Generated file. Do not edit.
11-
* This file is generated by the Flutter tool based on the
12-
* plugins that support the Android platform.
139
*/
14-
@Keep
1510
public final class GeneratedPluginRegistrant {
16-
private static final String TAG = "GeneratedPluginRegistrant";
17-
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
18-
try {
19-
flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin());
20-
} catch(Exception e) {
21-
Log.e(TAG, "Error registering plugin path_provider_android, io.flutter.plugins.pathprovider.PathProviderPlugin", e);
22-
}
23-
try {
24-
flutterEngine.getPlugins().add(new com.syncfusion.flutter.pdfviewer.SyncfusionFlutterPdfViewerPlugin());
25-
} catch(Exception e) {
26-
Log.e(TAG, "Error registering plugin syncfusion_flutter_pdfviewer, com.syncfusion.flutter.pdfviewer.SyncfusionFlutterPdfViewerPlugin", e);
11+
public static void registerWith(PluginRegistry registry) {
12+
if (alreadyRegisteredWith(registry)) {
13+
return;
2714
}
28-
try {
29-
flutterEngine.getPlugins().add(new io.flutter.plugins.urllauncher.UrlLauncherPlugin());
30-
} catch(Exception e) {
31-
Log.e(TAG, "Error registering plugin url_launcher_android, io.flutter.plugins.urllauncher.UrlLauncherPlugin", e);
15+
PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin"));
16+
UrlLauncherPlugin.registerWith(registry.registrarFor("io.flutter.plugins.urllauncher.UrlLauncherPlugin"));
17+
}
18+
19+
private static boolean alreadyRegisteredWith(PluginRegistry registry) {
20+
final String key = GeneratedPluginRegistrant.class.getCanonicalName();
21+
if (registry.hasPlugin(key)) {
22+
return true;
3223
}
24+
registry.registrarFor(key);
25+
return false;
3326
}
3427
}

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
}
66

77
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.5.3'
8+
classpath 'com.android.tools.build:gradle:7.2.0'
99
}
1010
}
1111

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip

android/local.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
sdk.dir=C:\\Users\\SriramKiranSenthilku\\AppData\\Local\\Android\\sdk
22
flutter.sdk=C:\\src\\flutter
33
flutter.buildMode=release
4-
flutter.versionName=20.4.38
4+
flutter.versionName=21.1.35

lib/model/helper.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ Widget getFooter(BuildContext context, SampleModel model) {
841841
),
842842
Container(
843843
padding: const EdgeInsets.only(top: 10),
844-
child: Text('Copyright © 2001 - 2022 Syncfusion Inc.',
844+
child: Text('Copyright © 2001 - 2023 Syncfusion Inc.',
845845
style: TextStyle(
846846
color: model.textColor.withOpacity(0.7),
847847
fontSize: 12,

lib/sample_details.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"description": "Visualize hierarchically structured data that is sized and colored by quantitative variables",
3939
"image": "images/treemap.png",
4040
"displayType": "tab",
41-
"isBeta": true,
4241
"controlId": 4,
4342
"subItems": [
4443
{
@@ -2712,7 +2711,7 @@
27122711
{
27132712
"type": "sample",
27142713
"title": "Sorting",
2715-
"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.",
2714+
"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.",
27162715
"key": "sorting_datagrid",
27172716
"codeLink": "https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/datagrid/sorting/datagrid_sorting.dart",
27182717
"needsPropertyPanel": true
@@ -3266,29 +3265,24 @@
32663265
"description": "Create Excel documents with text, numbers, cell formatting, formulas, charts, images, and more",
32673266
"image": "images/xlsio.png",
32683267
"displayType": "tab",
3269-
"isBeta": true,
32703268
"controlId": 2,
3271-
"status": "Updated",
32723269
"subItems": [
32733270
{
32743271
"type": "sample",
32753272
"title": "Expenses Report",
32763273
"key": "expenses_report",
3277-
"status": "Updated",
32783274
"codeLink": "https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/xlsio/expenses_report/expenses_report.dart"
32793275
},
32803276
{
32813277
"type": "sample",
32823278
"title": "Invoice",
32833279
"key": "invoice_excel",
3284-
"status": "Updated",
32853280
"codeLink": "https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/xlsio/invoice/invoice.dart"
32863281
},
32873282
{
32883283
"type": "sample",
32893284
"title": "Yearly Sales",
32903285
"key": "yearly_sales",
3291-
"status": "Updated",
32923286
"codeLink": "https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/xlsio/yearly_sales/yearly_sales.dart"
32933287
},
32943288
{

lib/samples/chart/cartesian_charts/trendline/default_trendline.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class _TrendLineDefaultState extends SampleViewState {
6767
@override
6868
void dispose() {
6969
if (_slope != null) {
70-
_slope!.clear();
70+
_slope = [];
7171
}
7272
_trendlineTypeList!.clear();
7373
super.dispose();

lib/samples/datagrid/datagridsource/dealer_datagridsource.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ class DealerDataGridSource extends DataGridSource {
137137
}
138138

139139
@override
140-
void onCellSubmit(DataGridRow dataGridRow, RowColumnIndex rowColumnIndex,
141-
GridColumn column) {
140+
Future<void> onCellSubmit(DataGridRow dataGridRow,
141+
RowColumnIndex rowColumnIndex, GridColumn column) async {
142142
final dynamic oldValue = dataGridRow
143143
.getCells()
144144
.firstWhereOrNull((DataGridCell dataGridCell) =>

lib/samples/datagrid/datagridsource/product_datagridsource.dart

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
// ignore_for_file: depend_on_referenced_packages
2+
13
import 'dart:math';
24

5+
import 'package:collection/collection.dart';
36
import 'package:flutter/material.dart';
47
import 'package:intl/intl.dart';
5-
// ignore: depend_on_referenced_packages
68
import 'package:syncfusion_flutter_datagrid/datagrid.dart';
79

810
import '../model/product.dart';
@@ -205,6 +207,45 @@ class ProductDataGridSource extends DataGridSource {
205207
}
206208
}
207209

210+
@override
211+
int compare(DataGridRow? a, DataGridRow? b, SortColumnDetails sortColumn) {
212+
if (_sampleName == 'Custom Sorting' && sortColumn.name == 'name') {
213+
final String? value1 = a
214+
?.getCells()
215+
.firstWhereOrNull(
216+
(dynamic element) => element.columnName == sortColumn.name)
217+
?.value
218+
?.toString();
219+
final String? value2 = b
220+
?.getCells()
221+
.firstWhereOrNull(
222+
(dynamic element) => element.columnName == sortColumn.name)
223+
?.value
224+
?.toString();
225+
226+
final int? aLength = value1?.length;
227+
final int? bLength = value2?.length;
228+
229+
if (aLength == null || bLength == null) {
230+
return 0;
231+
}
232+
233+
if (aLength.compareTo(bLength) > 0) {
234+
return sortColumn.sortDirection == DataGridSortDirection.ascending
235+
? 1
236+
: -1;
237+
} else if (aLength.compareTo(bLength) == -1) {
238+
return sortColumn.sortDirection == DataGridSortDirection.ascending
239+
? -1
240+
: 1;
241+
} else {
242+
return 0;
243+
}
244+
} else {
245+
return super.compare(a, b, sortColumn);
246+
}
247+
}
248+
208249
final List<String> _product = <String>[
209250
'Lax',
210251
'Chocolate',

0 commit comments

Comments
 (0)