This file contains hidden or 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 'dart:ui' as ui; | |
import 'package:flutter/material.dart'; | |
/// This app reproduces a text painting bug in which some characters, and some | |
/// descenders are cut off. | |
/// | |
/// This repro captures an actual state of paragraph style, text style, and canvas | |
/// scaling. We're painting text in our app based on a document's specification of | |
/// characters and spacing between them. In general, this is working fine. However |
This file contains hidden or 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
/// Same as `IntrinsicWidth` except that when this widget is instructed | |
/// to `computeDryLayout()`, it doesn't invoke that on its child, instead | |
/// it computes the child's intrinsic width. | |
/// | |
/// This widget is useful in situations where the `child` does not | |
/// support dry layout, e.g., `TextField` as of 01/02/2021. | |
class DryIntrinsicWidth extends SingleChildRenderObjectWidget { | |
const DryIntrinsicWidth({Key key, Widget child}) | |
: super(key: key, child: child); |
This file contains hidden or 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'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
This file contains hidden or 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'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
This file contains hidden or 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'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
This file contains hidden or 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'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
This file contains hidden or 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
@Override | |
public void onRestoreInstanceState(Parcelable state) { | |
// Cast the incoming Parcelable to our custom SavedState. We produced | |
// this Parcelable before, so we know what type it is. | |
SavedState savedState = (SavedState) state; | |
// Let our super class process state before we do because we should | |
// depend on our super class, we shouldn't imply that our super class | |
// might need to depend on us. | |
super.onRestoreInstanceState(savedState.getSuperState()); |
This file contains hidden or 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
@Override | |
public Parcelable onSaveInstanceState() { | |
// Obtain any state that our super class wants to save. | |
Parcelable superState = super.onSaveInstanceState(); | |
// Wrap our super class's state with our own. | |
SavedState myState = new SavedState(superState); | |
myState.name = this.name; | |
myState.index = this.index; | |
This file contains hidden or 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
public class MyView extends View { | |
private static class SavedState extends BaseSavedState { | |
String name; | |
int index; | |
SavedState(Parcelable superState) { | |
super(superState); | |
} | |
private SavedState(Parcel in) { |
This file contains hidden or 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
public class MyView extends View { | |
private static class SavedState extends BaseSavedState { | |
String name; | |
int index; | |
SavedState(Parcelable superState) { | |
super(superState); | |
} | |
private SavedState(Parcel in) { |
NewerOlder