This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
runApp( | |
new MaterialApp( | |
... | |
// Body part of the screen | |
body: new FutureBuilder( | |
future: getMovies(), | |
builder: (BuildContext context, | |
AsyncSnapshot<List> snapshot) { | |
if (!snapshot.hasData) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Widget> createMovieCardItem(List<Movie> movies, BuildContext context) { | |
// Children list for the list. | |
List<Widget> listElementWidgetList = new List<Widget>(); | |
if (movies != null) { | |
var lengthOfList = movies.length; | |
for (int i = 0; i < lengthOfList; i++) { | |
Movie movie = movies[i]; | |
// Image URL | |
var imageURL = "https://image.tmdb.org/t/p/w500/" + movie.posterPath; | |
// List item created with an image of the poster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
property | explanation | |
---|---|---|
enabled | It represents the subtree or the widget that is used can be either enabled or disabled state. | |
checked | It represents checked state of a widget similar to checkbox. | |
toggled | It represents on/off state of a widget similar to switch. | |
selected | It indicates that this subtree represents a widget that can be in selected/unselected state. | |
button | It represents a button is in this subtree. | |
header | It represents a header is in this subtree | |
textfield | It represents a text field is in the subtree | |
focused | It represents that current node holds the input focus. It's not the same with Accessibility Focus | |
inMutuallyExclusiveGroup | It represents if the node is in a mutually exclusive group. E.g. Radiobutton in radio group. |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// List tile widget creation with Semantics | |
return InkWell( | |
onTap: enabled ? onTap : null, | |
onLongPress: enabled ? onLongPress : null, | |
child: Semantics( | |
selected: selected, | |
enabled: enabled, | |
child: SafeArea( | |
top: false, | |
bottom: false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ListView.builder( | |
itemCount: 5, | |
itemBuilder: (context, position) { | |
return ListTile( | |
enabled: position == 1 ? true : false, | |
selected: position == 0 ? true : false, | |
title: Text('Main title for $position item'), | |
subtitle: Text('Sub title for $position item'), | |
); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ListView.builder( | |
itemCount: 5, | |
itemBuilder: (context, position) { | |
return Semantics( | |
label: 'Container with 200 width 200 height and red background', | |
enabled: position == 1 ? true : false, | |
selected: position == 0 ? true : false, | |
onTap: () { | |
Scaffold.of(context).showSnackBar(SnackBar(content: Text('Item $position Clicked!'))); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ListView.builder( | |
itemCount: 5, | |
addSemanticIndexes: false, | |
semanticChildCount: 3, | |
itemBuilder: (context, position) { | |
return MergeSemantics( | |
child: Semantics( | |
label: 'Container with 200 width 200 height and red background', | |
enabled: position == 1 ? true : false, | |
selected: position == 0 ? true : false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ListView( | |
addSemanticIndexes: false, | |
semanticChildCount: 2, | |
children: const <Widget>[ | |
IndexedSemantics(index: 0, child: Text('First')), | |
Spacer(), | |
IndexedSemantics(index: 1, child: Text('Second')), | |
Spacer(), | |
], | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp( | |
MaterialApp( | |
home: PathExample(), | |
), | |
); | |
class PathExample extends StatelessWidget { | |
@override |