Widgets are the central class hierarchy in the Flutter framework. A widget is an immutable description of part of a user interface. Widgets can be inflated into elements, which manage the underlying render tree.
Widgets themselves have no mutable state (all their fields must be final). If you wish to associate mutable state with a widget, consider using a [StatefulWidget], which creates a [State] object (via [StatefulWidget.createState]) whenever it is inflated into an element and incorporated into the tree.
A given widget can be included in the tree zero or more times. In particular a given widget can be placed in the tree multiple times. Each time a widget is placed in the tree, it is inflated into an [Element], which means a widget that is incorporated into the tree multiple times will be inflated multiple times.
The [key] property controls how one widget replaces another widget in the tree. If the [runtimeType] and [key] properties of the two widgets are [operator==], respectively, then the new widget replaces the old widget by updating the underlying element (i.e., by calling [Element.update] with the new widget). Otherwise, the old element is removed from the tree, the new widget is inflated into an element, and the new element is inserted into the tree.
See also:
* [StatefulWidget] and [State], for widgets that can build differently several times over their lifetime. * [InheritedWidget], for widgets that introduce ambient state that can be read by descendant widgets. * [StatelessWidget], for widgets that always build the same way given a particular configuration and ambient state.
String uri = "http://10.12.29.138:8080/IMG_5899.png"; String extension = uri.substring(uri.lastIndexOf(".") + 1); File savedFile = new File("/Users/admin/Downloads/123." + extension); FileUtils.copyURLToFile(new URL(uri), savedFile);
Metadata metadata = ImageMetadataReader.readMetadata(savedFile); // See whether it has GPS data Collection<GpsDirectory> gpsDirectories = metadata.getDirectoriesOfType(GpsDirectory.class); for (GpsDirectory gpsDirectory : gpsDirectories) { // Try to read out the location, making sure it's non-zero GeoLocation geoLocation = gpsDirectory.getGeoLocation(); if (geoLocation != null && !geoLocation.isZero()) { System.out.println(geoLocation.getLatitude()); System.out.println(geoLocation.getLongitude()); } } }
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
打印工具类 publicstaticvoidP(CharSequence charSequence,String sRegex){ Pattern p = Pattern.compile(sRegex); // create the pattern only once, Matcher m = p.matcher(charSequence); while (m.find()) { System.out.println( m.group() ); } } ```
## 元字符详解 .
.是元字符中最简单的例子。 .匹配任意单个字符,但不匹配换行符。
<pre> ".ar" => The <a href="#learn-regex"><strong>car</strong></a> <a href="#learn-regex"><strong>par</strong></a>ked in the <a href="#learn-regex"><strong>gar</strong></a>age. </pre>
```java P("The car parked in the garage.",".ar"); 输出 car par gar
元字符详解 [ ]
字符集也叫做字符类。 方括号用来指定一个字符集。 在方括号中使用连字符来指定字符集的范围。 在方括号中的字符集不关心顺序。 例如,表达式[Tt]he 匹配 the 和 The。