Skip to content

Commit 2978f78

Browse files
Updated samples for service pack release.
1 parent 76353b8 commit 2978f78

File tree

205 files changed

+16297
-11900
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+16297
-11900
lines changed

assets/fonts/Roboto-Bold.ttf

166 KB
Binary file not shown.

assets/fonts/Roboto-Medium.ttf

168 KB
Binary file not shown.

assets/fonts/Roboto-Regular.ttf

167 KB
Binary file not shown.

images/Icon-App-1024x1024@1x.png

-166 KB
Binary file not shown.

images/dark_theme_gauge.png

14.6 KB
Loading

lib/main.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import 'package:flutter_examples/model/model.dart';
44
import 'package:flutter_examples/sample_browser.dart';
55
import 'package:flutter_examples/sb_web/sample_browser_web.dart';
66
import 'package:syncfusion_flutter_core/core.dart';
7-
//Test
7+
88
Future<void> main() async {
9-
WidgetsFlutterBinding.ensureInitialized();
9+
WidgetsFlutterBinding.ensureInitialized();
1010
await updateControl();
1111
// Register your license here
1212
SyncfusionLicense.registerLicense(null);
1313
runApp(kIsWeb ? WebSampleBrowser() : SampleBrowser());
1414
}
15+

lib/model/helper.dart

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ Widget getSideDrawer(SampleModel _model) {
663663
)),
664664
Align(
665665
alignment: Alignment.bottomCenter,
666-
child: Text('Version 18.1.42',
666+
child: Text('Version 18.1.52',
667667
style: TextStyle(
668668
color: _model.drawerTextIconColor,
669669
fontSize: 12,
@@ -689,9 +689,11 @@ Widget getFooter(BuildContext context, SampleModel model) {
689689
),
690690
color: model.webFooterColor,
691691
),
692-
padding:isMobile ? EdgeInsets.fromLTRB(MediaQuery.of(context).size.width * 0.025, 0,
693-
MediaQuery.of(context).size.width * 0.025, 0): EdgeInsets.fromLTRB(MediaQuery.of(context).size.width * 0.05, 0,
694-
MediaQuery.of(context).size.width * 0.05, 0),
692+
padding: isMobile
693+
? EdgeInsets.fromLTRB(MediaQuery.of(context).size.width * 0.025, 0,
694+
MediaQuery.of(context).size.width * 0.025, 0)
695+
: EdgeInsets.fromLTRB(MediaQuery.of(context).size.width * 0.05, 0,
696+
MediaQuery.of(context).size.width * 0.05, 0),
695697
child: Row(
696698
mainAxisAlignment: MainAxisAlignment.spaceBetween,
697699
children: <Widget>[
@@ -758,14 +760,14 @@ Widget getFooter(BuildContext context, SampleModel model) {
758760
? HandCursor(
759761
child: InkWell(
760762
onTap: () => launch('https://www.syncfusion.com'),
761-
child: Image.asset(model.syncfusionIcon,
763+
child: Image.asset(model.syncfusionIcon,
762764
fit: BoxFit.contain, height: 25, width: 80),
763765
),
764-
)
766+
)
765767
: HandCursor(
766768
child: InkWell(
767769
onTap: () => launch('https://www.syncfusion.com'),
768-
child: Image.asset(model.syncfusionIcon,
770+
child: Image.asset(model.syncfusionIcon,
769771
fit: BoxFit.contain, height: 25, width: 120),
770772
),
771773
),

lib/model/model.dart

Lines changed: 46 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,10 @@ class SampleModel extends Model {
141141
.add(controlList[index].childList[i].subItems[j]);
142142
else {
143143
//ignore: prefer_foreach
144-
for (SubItem sample in controlList[index]
145-
.childList[i]
146-
.subItems[j]
147-
.subItems){
148-
searchSampleItems.add(sample);
149-
}
144+
for (SubItem sample
145+
in controlList[index].childList[i].subItems[j].subItems) {
146+
searchSampleItems.add(sample);
147+
}
150148
}
151149
}
152150
}
@@ -194,18 +192,18 @@ class SampleModel extends Model {
194192
Color bottomSheetBackgroundColor = Colors.white;
195193
final bool isTileView = true;
196194
Color cardThemeColor = Colors.white;
197-
Color webBackgroundColor = const Color.fromRGBO(246, 246, 246, 1);
195+
Color webBackgroundColor = const Color.fromRGBO(246, 246, 246, 1);
198196
Color webIconColor = const Color.fromRGBO(111, 111, 111, 1);
199197
bool isWeb = false;
200-
Color webInputColor = const Color.fromRGBO(242,242,242,1);
198+
Color webInputColor = const Color.fromRGBO(242, 242, 242, 1);
201199
Color webOutputContainerColor = Colors.white;
202200
Color webCardColor = Colors.white;
203-
Color webFooterColor = const Color.fromRGBO(234,234,234,1);
204-
Color webDividerColor = const Color.fromRGBO(204, 204, 204,1);
201+
Color webFooterColor = const Color.fromRGBO(234, 234, 234, 1);
202+
Color webDividerColor = const Color.fromRGBO(204, 204, 204, 1);
205203
Color webSampleBackgroundColor = Colors.white;
206-
Color webTabTextColor = const Color.fromRGBO(89, 89, 89,1);
204+
Color webTabTextColor = const Color.fromRGBO(89, 89, 89, 1);
207205
String syncfusionIcon = 'images/syncfusion.png';
208-
Color webDividerColor2 = const Color.fromRGBO(238, 238, 238,1);
206+
Color webDividerColor2 = const Color.fromRGBO(238, 238, 238, 1);
209207

210208
Color lightThemeSelected;
211209
Color darkThemeSelected;
@@ -217,29 +215,30 @@ class SampleModel extends Model {
217215
Color currentPaletteColor;
218216
bool isLightThemeSelected = true;
219217

220-
dynamic sampleOutputContainer;
218+
dynamic sampleOutputContainer;
221219
Map<dynamic, dynamic> properties = <dynamic, dynamic>{};
222220
GlobalKey globalKey;
223-
221+
224222
void changeTheme(ThemeData _themeData) {
225223
themeData = _themeData;
226224
switch (_themeData.brightness) {
227225
case Brightness.dark:
228226
{
229227
syncfusionIcon = 'images/syncfusion_dark.png';
230-
webDividerColor = const Color.fromRGBO(61, 61, 61,1);
231-
webDividerColor2 = const Color.fromRGBO(61, 61, 61,1);
228+
webDividerColor = const Color.fromRGBO(61, 61, 61, 1);
229+
webDividerColor2 = const Color.fromRGBO(61, 61, 61, 1);
232230
webTabTextColor = Colors.white;
233-
webCardColor = const Color.fromRGBO(48, 48, 48,1);
231+
webCardColor = const Color.fromRGBO(48, 48, 48, 1);
234232
webIconColor = const Color.fromRGBO(230, 230, 230, 1);
235-
webOutputContainerColor = Colors.black;
236-
webInputColor = const Color.fromRGBO(44,44,44,1);
233+
webOutputContainerColor = const Color.fromRGBO(23, 23, 23, 1);
234+
webInputColor = const Color.fromRGBO(44, 44, 44, 1);
237235
webBackgroundColor = const Color.fromRGBO(33, 33, 33, 1);
238-
webFooterColor = const Color.fromRGBO(33,33,33,1);
239-
webSampleBackgroundColor = const Color.fromRGBO(33,33,33,1);
236+
webFooterColor = const Color.fromRGBO(33, 33, 33, 1);
237+
webSampleBackgroundColor = const Color.fromRGBO(33, 33, 33, 1);
240238
drawerTextIconColor = Colors.white;
241239
drawerIconColor = Colors.white;
242-
slidingPanelColor = Colors.black;//const Color.fromRGBO(32, 33, 37, 1);
240+
slidingPanelColor =
241+
Colors.black; //const Color.fromRGBO(32, 33, 37, 1);
243242
drawerBackgroundColor = Colors.black;
244243
bottomSheetBackgroundColor = const Color.fromRGBO(34, 39, 51, 1);
245244
backgroundColor =
@@ -249,21 +248,21 @@ class SampleModel extends Model {
249248
listDescriptionTextColor = const Color.fromRGBO(242, 242, 242, 1);
250249
textColor = const Color.fromRGBO(242, 242, 242, 1);
251250
theme = Brightness.dark;
252-
cardThemeColor = const Color.fromRGBO(23, 27, 36, 1);
251+
cardThemeColor = const Color.fromRGBO(23, 27, 36, 1);
253252
break;
254253
}
255254
default:
256255
{
257256
syncfusionIcon = 'images/syncfusion.png';
258-
webDividerColor = const Color.fromRGBO(204,204,204,1);
259-
webDividerColor2 = const Color.fromRGBO(238, 238, 238,1);
260-
webTabTextColor = const Color.fromRGBO(89, 89, 89,1);
257+
webDividerColor = const Color.fromRGBO(204, 204, 204, 1);
258+
webDividerColor2 = const Color.fromRGBO(238, 238, 238, 1);
259+
webTabTextColor = const Color.fromRGBO(89, 89, 89, 1);
261260
webCardColor = Colors.white;
262261
webIconColor = const Color.fromRGBO(111, 111, 111, 1);
263262
webOutputContainerColor = Colors.white;
264-
webInputColor = const Color.fromRGBO(242,242,242,1);
265-
webBackgroundColor =const Color.fromRGBO(246, 246, 246, 1);
266-
webFooterColor = const Color.fromRGBO(234,234,234,1);
263+
webInputColor = const Color.fromRGBO(242, 242, 242, 1);
264+
webBackgroundColor = const Color.fromRGBO(246, 246, 246, 1);
265+
webFooterColor = const Color.fromRGBO(234, 234, 234, 1);
267266
webSampleBackgroundColor = Colors.white;
268267
drawerTextIconColor = Colors.black;
269268
drawerIconColor = Colors.black;
@@ -301,19 +300,27 @@ Future<void> updateControl() async {
301300
subItems.add(SubItem.fromJson(SampleModel.controlList1[i].subItems[j]));
302301
if (subItems[j].type == 'parent') {
303302
for (int k = 0; k < subItems[j].subItems.length; k++) {
304-
if(!isWeb || SubItem.fromJson(subItems[j].subItems[k]).showInWeb != false){
305-
subItems1.add(SubItem.fromJson(subItems[j].subItems[k]));
306-
for (int l = 0; l < subItems1[subItems1.length -1].subItems.length; l++) {
307-
if (!isWeb ||
308-
SubItem.fromJson(subItems1[subItems1.length-1].subItems[l]).showInWeb != false)
309-
subItems2.add(SubItem.fromJson(subItems1[subItems1.length-1].subItems[l]));
303+
if (!isWeb ||
304+
SubItem.fromJson(subItems[j].subItems[k]).showInWeb != false) {
305+
subItems1.add(SubItem.fromJson(subItems[j].subItems[k]));
306+
for (int l = 0;
307+
l < subItems1[subItems1.length - 1].subItems.length;
308+
l++) {
309+
if (!isWeb ||
310+
SubItem.fromJson(subItems1[subItems1.length - 1].subItems[l])
311+
.showInWeb !=
312+
false)
313+
subItems2.add(SubItem.fromJson(
314+
subItems1[subItems1.length - 1].subItems[l]));
315+
}
316+
subItems1[subItems1.length - 1].subItems = subItems2;
317+
subItems2 = <SubItem>[];
310318
}
311-
subItems1[subItems1.length-1].subItems = subItems2;
312-
subItems2 = <SubItem>[];
313-
}}
319+
}
314320
subItems[j].subItems = subItems1;
315321
subItems1 = <SubItem>[];
316-
} else if (subItems[j].type == 'child' && (!isWeb || subItems[j].showInWeb != false)) {
322+
} else if (subItems[j].type == 'child' &&
323+
(!isWeb || subItems[j].showInWeb != false)) {
317324
isChild = true;
318325
for (int k = 0; k < subItems[j].subItems.length; k++) {
319326
if (!isWeb ||

lib/model/view.dart

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ class _LayoutPageState extends State<LayoutPage> {
2222
super.dispose();
2323
}
2424

25+
int _index = 0;
26+
int _index1 = 0;
2527
@override
2628
// ignore: must_call_super
2729
Widget build(BuildContext context) {
28-
int _index = 0;
2930
return ScopedModelDescendant<SampleModel>(
3031
rebuildOnChange: true,
3132
builder: (BuildContext context, _, SampleModel model) => Theme(
3233
data: ThemeData(
33-
brightness: model.themeData.brightness,
34-
primaryColor: model.backgroundColor
35-
),
34+
brightness: model.themeData.brightness,
35+
primaryColor: model.backgroundColor),
3636
child: SafeArea(
3737
child: DefaultTabController(
3838
length: model.controlList[model.selectedIndex].subItems.length,
@@ -79,18 +79,24 @@ class _LayoutPageState extends State<LayoutPage> {
7979
fontSize: 16.0,
8080
color: Colors.white,
8181
letterSpacing: 0.3)),
82-
actions: (model.controlList[model.selectedIndex]
83-
.sampleList !=
84-
null &&
85-
model.controlList[model.selectedIndex]
86-
.displayType !=
87-
'card' &&
88-
model.controlList[model.selectedIndex]
89-
.sampleList[_index].codeLink !=
90-
null &&
91-
model.controlList[model.selectedIndex]
92-
.sampleList[_index].codeLink !=
93-
'')
82+
actions: ((model.controlList[model.selectedIndex]
83+
.sampleList !=
84+
null &&
85+
model.controlList[model.selectedIndex]
86+
.displayType !=
87+
'card' &&
88+
model.controlList[model.selectedIndex]
89+
.sampleList[_index].codeLink !=
90+
null &&
91+
model.controlList[model.selectedIndex]
92+
.sampleList[_index].codeLink !=
93+
'') ||
94+
(model.controlList[model.selectedIndex]
95+
.childList !=
96+
null &&
97+
model.controlList[model.selectedIndex]
98+
.childList[_index].displayType ==
99+
'tab'))
94100
? <Widget>[
95101
Padding(
96102
padding: const EdgeInsets.fromLTRB(0, 0, 10, 0),
@@ -102,9 +108,19 @@ class _LayoutPageState extends State<LayoutPage> {
102108
color: Colors.white),
103109
onPressed: () {
104110
launch(model
105-
.controlList[model.selectedIndex]
106-
.sampleList[_index]
107-
.codeLink);
111+
.controlList[
112+
model.selectedIndex]
113+
.sampleList ==
114+
null
115+
? model
116+
.controlList[model.selectedIndex]
117+
.childList[_index]
118+
.subItems[_index1]
119+
.codeLink
120+
: model
121+
.controlList[model.selectedIndex]
122+
.sampleList[_index]
123+
.codeLink);
108124
},
109125
),
110126
),
@@ -215,7 +231,7 @@ class _LayoutPageState extends State<LayoutPage> {
215231
itemCount: list.length,
216232
itemBuilder: (BuildContext context, int position) {
217233
final String status = list[position].status;
218-
final SubItem _subitem =list[position];
234+
final SubItem _subitem = list[position];
219235
return Container(
220236
color: model.slidingPanelColor,
221237
padding: const EdgeInsets.all(5.0),
@@ -313,8 +329,8 @@ class _LayoutPageState extends State<LayoutPage> {
313329
child: SizedBox(
314330
//ignore: avoid_as
315331
width: model.isWeb
316-
? _subitem != null
317-
&& _subitem.key == 'clock_sample'
332+
? _subitem != null &&
333+
_subitem.key == 'clock_sample'
318334
? (MediaQuery.of(context).size.height *
319335
0.6)
320336
: double.infinity
@@ -354,6 +370,9 @@ class _LayoutPageState extends State<LayoutPage> {
354370
backgroundColor:
355371
const Color.fromRGBO(241, 241, 241, 1),
356372
bottom: TabBar(
373+
onTap: (int index) {
374+
_index1 = index;
375+
},
357376
unselectedLabelColor: Colors.black,
358377
labelColor: Colors.blue,
359378
indicatorColor: Colors.transparent,
@@ -414,5 +433,5 @@ class _LayoutPageState extends State<LayoutPage> {
414433
}
415434
}
416435
return tabs;
417-
}
436+
}
418437
}

0 commit comments

Comments
 (0)