Skip to content

Commit

Permalink
Moved the new sample changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuvaraj-Gajaraj committed Dec 18, 2023
1 parent 7005e22 commit b612bf4
Show file tree
Hide file tree
Showing 488 changed files with 74,986 additions and 8,487 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,12 @@ Explore the full capabilities of our Flutter widgets on your device by installin

<p align="center">
<a href="https://play.google.com/store/apps/details?id=com.syncfusion.flutter.examples"><img src="https://cdn.syncfusion.com/content/images/FTControl/google-play-store.png"/></a>
<a href="https://apps.apple.com/us/app/syncfusion-flutter-ui-widgets/id1475231341"><img src="https://cdn.syncfusion.com/content/images/FTControl/ios-store.png"/></a>
<a href="https://flutter.syncfusion.com"><img src="https://cdn.syncfusion.com/content/images/FTControl/web-sample-browser.png"/></a>
<a href="https://flutter.syncfusion.com"><img src="https://cdn.syncfusion.com/content/images/FTControl/web-sample-browser.png"/></a>
<a href="https://www.microsoft.com/en-us/p/syncfusion-flutter-gallery/9nhnbwcsf85d?activetab=pivot:overviewtab"><img src="https://cdn.syncfusion.com/content/images/FTControl/windows-store.png"/></a>
</p>
<p align="center">
<a href="https://www.microsoft.com/en-us/p/syncfusion-flutter-gallery/9nhnbwcsf85d?activetab=pivot:overviewtab"><img src="https://cdn.syncfusion.com/content/images/FTControl/windows-store.png"/></a>
<a href="https://install.appcenter.ms/orgs/syncfusion-demos/apps/syncfusion-flutter-gallery/distribution_groups/release"><img src="https://cdn.syncfusion.com/content/images/FTControl/macos-app-center.png"/></a>
<a href="https://snapcraft.io/syncfusion-flutter-gallery"><img src="https://cdn.syncfusion.com/content/images/FTControl/snap-store.png"/></a>
</p>
<p align="center">
<a href="https://github.com/syncfusion/flutter-examples"><img src="https://cdn.syncfusion.com/content/images/FTControl/github-samples.png"/></a>
</p>

Expand Down
2 changes: 2 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ analyzer:
avoid_bool_literals_in_conditional_expressions: ignore
library_private_types_in_public_api: ignore
prefer_interpolation_to_compose_strings: ignore
always_specify_types: ignore

54,662 changes: 54,610 additions & 52 deletions assets/europe.json

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions assets/germany.json

Large diffs are not rendered by default.

Binary file added assets/pdf/annotations.pdf
Binary file not shown.
Binary file added assets/pdf/form_document.pdf
Binary file not shown.
Binary file added assets/pdf/rtl_document.pdf
Binary file not shown.
23 changes: 21 additions & 2 deletions build/flutter_assets/lib/sample_details.json
Original file line number Diff line number Diff line change
Expand Up @@ -2600,6 +2600,26 @@
}
]
},
{
"type": "child",
"title": "Grouping",
"subItems": [
{
"type": "sample",
"title": "Grouping",
"key": "datagrid_grouping",
"codeLink": "https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/datagrid/grouping/datagrid_grouping.dart",
"needsPropertyPanel": false
},
{
"type": "sample",
"title": "Custom Grouping",
"key": "datagrid_custom_grouping",
"codeLink": "https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/datagrid/grouping/datagrid_custom_grouping",
"needsPropertyPanel": false
}
]
},
{
"type": "child",
"title": "Selection",
Expand Down Expand Up @@ -2627,7 +2647,6 @@
}
]
},

{
"type": "child",
"title": "Freeze Panes",
Expand Down Expand Up @@ -3610,4 +3629,4 @@
}
]
}
]
]
Binary file modified images/cartesian_types.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/circle_gauge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/circle_series.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/circular_progress_bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pdf_viewer/color_palette.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pdf_viewer/delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pdf_viewer/export_annotation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pdf_viewer/highlight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pdf_viewer/import_annotation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pdf_viewer/locked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pdf_viewer/opacity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pdf_viewer/save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pdf_viewer/squiggly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pdf_viewer/strikethrough.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pdf_viewer/text_markup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pdf_viewer/underline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pdf_viewer/unlocked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/radial_range_slider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/radial_slider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
315 changes: 166 additions & 149 deletions lib/model/helper.dart

Large diffs are not rendered by default.

190 changes: 123 additions & 67 deletions lib/model/mobile_view.dart

Large diffs are not rendered by default.

211 changes: 110 additions & 101 deletions lib/model/model.dart

Large diffs are not rendered by default.

220 changes: 217 additions & 3 deletions lib/model/sample_view.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/// Package import
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:syncfusion_localizations/syncfusion_localizations.dart';

/// Local import
import 'model.dart';
Expand All @@ -11,7 +13,7 @@ abstract class SampleView extends StatefulWidget {
}

/// Base class of the sample's state class
abstract class SampleViewState extends State<SampleView> {
abstract class SampleViewState<T extends SampleView> extends State<T> {
/// Holds the SampleModel information
late SampleModel model;

Expand All @@ -25,9 +27,8 @@ abstract class SampleViewState extends State<SampleView> {
super.initState();
}

@override

/// Must call super.
@override
void dispose() {
model.isCardView = true;
super.dispose();
Expand All @@ -39,6 +40,219 @@ abstract class SampleViewState extends State<SampleView> {
}
}

/// Base class of the localization sample's stateful widget class
class LocalizationSampleView extends SampleView {
/// base class constructor of sample's stateful widget class
const LocalizationSampleView({Key? key}) : super(key: key);

@override
State<StatefulWidget> createState() => LocalizationSampleViewState();
}

/// Base class of the localization sample's state class
class LocalizationSampleViewState<T extends LocalizationSampleView>
extends SampleViewState<T> {
late List<Locale> _supportedLocales;

@override
void initState() {
if (this is! DirectionalitySampleViewState) {
_supportedLocales = <Locale>[
const Locale('ar', 'AE'),
const Locale('en', 'US'),
const Locale('es', 'ES'),
const Locale('fr', 'FR'),
const Locale('zh', 'CN')
];
} else {
_supportedLocales = <Locale>[
const Locale('ar', 'AE'),
const Locale('en', 'US'),
];
}

super.initState();
}

/// Add the localization selection widget.
Widget localizationSelectorWidget(BuildContext context) {
final double screenWidth =
model.isWebFullView ? 250 : MediaQuery.of(context).size.width;
final double dropDownWidth = 0.6 * screenWidth;
return StatefulBuilder(
builder: (BuildContext context, StateSetter stateSetter) {
return Row(
children: <Widget>[
Text(this is DirectionalitySampleViewState ? 'Language' : 'Locale',
softWrap: false,
style: TextStyle(
fontSize: 16,
color: model.textColor,
)),
Container(
padding: const EdgeInsets.fromLTRB(50, 0, 0, 0),
width: dropDownWidth,
child: DropdownButton<Locale>(
focusColor: Colors.transparent,
isExpanded: true,
underline:
Container(color: const Color(0xFFBDBDBD), height: 1),
value: model.locale,
items: _supportedLocales.map((Locale value) {
String localeString = value.toString();
if (this is DirectionalitySampleViewState) {
localeString =
(localeString == 'ar_AE') ? 'Arabic' : 'English';
} else {
localeString = localeString.substring(0, 2) +
'-' +
localeString.substring(3, 5);
}

return DropdownMenuItem<Locale>(
value: value,
child: Text(localeString,
style: TextStyle(color: model.textColor)));
}).toList(),
onChanged: (Locale? value) {
if (model.locale != value) {
setState(() {
stateSetter(() {
model.isInitialRender = false;
model.locale = value;
if (this is! DirectionalitySampleViewState) {
if (model.locale == const Locale('ar', 'AE')) {
model.textDirection = TextDirection.rtl;
} else {
model.textDirection = TextDirection.ltr;
}
}
});
});
}
})),
],
);
});
}

Widget _buildDirectionalityWidget() {
return Localizations(
locale: model.locale!,
delegates: const [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
SfGlobalLocalizations.delegate
],
child: Directionality(
textDirection: model.textDirection,
child: buildSample(context) ?? Container()));
}

/// Method to get the widget's color based on the widget state
Color? getColor(Set<MaterialState> states) {
const Set<MaterialState> interactiveStates = <MaterialState>{
MaterialState.pressed,
MaterialState.selected,
};
if (states.any(interactiveStates.contains)) {
return model.backgroundColor;
}
return null;
}

@override
Widget build(BuildContext context) {
return _buildDirectionalityWidget();
}

/// Get the settings panel content.
Widget? buildSample(BuildContext context) {
return null;
}

/// Must call super.
@override
void dispose() {
super.dispose();
}
}

/// Base class of the directionality sample's stateful widget class
class DirectionalitySampleView extends LocalizationSampleView {
/// base class constructor of sample's stateful widget class
const DirectionalitySampleView({Key? key}) : super(key: key);
}

/// Base class of the directionality sample's state class
class DirectionalitySampleViewState<T extends DirectionalitySampleView>
extends LocalizationSampleViewState<T> {
final List<TextDirection> _supportedTextDirection = <TextDirection>[
TextDirection.ltr,
TextDirection.rtl,
];

/// Must call super.
@override
void dispose() {
super.dispose();
}

/// Close all overlay when property panel is opened. Implemented for PdfViewer
/// RTL sample.
void closeAllOverlay() {}

/// Add the localization selection widget.
Widget textDirectionSelectorWidget(BuildContext context) {
final double screenWidth =
model.isWebFullView ? 250 : MediaQuery.of(context).size.width;
closeAllOverlay();
final double dropDownWidth = 0.6 * screenWidth;
return StatefulBuilder(
builder: (BuildContext context, StateSetter stateSetter) {
return Row(
children: <Widget>[
Text('Rendering\nDirection',
maxLines: 2,
textAlign: TextAlign.left,
softWrap: false,
style: TextStyle(
fontSize: 16,
color: model.textColor,
)),
Container(
padding: const EdgeInsets.fromLTRB(50, 0, 0, 0),
width: dropDownWidth,
child: DropdownButton<TextDirection>(
focusColor: Colors.transparent,
isExpanded: true,
underline:
Container(color: const Color(0xFFBDBDBD), height: 1),
value: model.textDirection,
items: _supportedTextDirection.map((TextDirection value) {
return DropdownMenuItem<TextDirection>(
value: value,
child: Text(
value.toString().split('.')[1].toUpperCase(),
style: TextStyle(color: model.textColor)));
}).toList(),
onChanged: (TextDirection? value) {
if (model.textDirection != value) {
setState(() {
stateSetter(() {
model.isInitialRender = false;
model.textDirection = value!;
});
});
}
})),
],
);
});
}
}

///Chart sample data
class ChartSampleData {
/// Holds the datapoint values like x, y, etc.,
Expand Down
Loading

0 comments on commit b612bf4

Please sign in to comment.