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/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
import 'dart:io' show Platform; | |
void main() => runApp(const AdaptiveDialogDemo()); | |
class AdaptiveDialogDemo extends StatelessWidget { | |
const AdaptiveDialogDemo({super.key}); | |
@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'; | |
import 'package:flutter/cupertino.dart'; | |
// Change the value of `isIOS` to adapt the look of text fields | |
// `isIOS` is a stand-in for `Platform.isIOS` on mobile, | |
const isIOS = true; | |
void main() { | |
runApp(MyApp()); | |
} |
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/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(const AlertDialogApp()); | |
class AlertDialogApp extends StatelessWidget { | |
const AlertDialogApp({super.key}); | |
@override | |
Widget build(BuildContext context) { |
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/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(const AlertDialogApp()); | |
class AlertDialogApp extends StatelessWidget { | |
const AlertDialogApp({super.key}); | |
@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'; | |
import 'package:flutter/cupertino.dart'; | |
void main() { | |
runApp(const SegmentedButtonApp()); | |
} | |
class SegmentedButtonApp extends StatelessWidget { | |
const SegmentedButtonApp({super.key}); |
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
// Prerequisite: add the characters package as a dependency in your pubspec.yaml. | |
import 'package:characters/characters.dart'; | |
void main(List<String> arguments) { | |
print(textOverflowEllipsis('😸cats', 10)); | |
print(textOverflowEllipsis('🦏rhinoceroses', 10)); | |
} | |
// This function converts text overflow to an ellipsis | |
// when the text's length exceeds the given character limit. |
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'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
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'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
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
void main() { | |
print(splitStarSeparatedWords('space⭐is⭐for⭐everybody')); | |
} | |
List splitStarSeparatedWords(String text) { | |
return text.split('⭐'); | |
} |
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
════════ Exception Caught By rendering library ═════════════════════════════════════════════════════ | |
The following assertion was thrown during performResize(): | |
Vertical viewport was given unbounded height. | |
Viewports expand in the scrolling direction to fill their container.In this case, a vertical viewport was given an unlimited amount of vertical space in which to expand. This situation typically happens when a scrollable widget is nested inside another scrollable widget. | |
If this widget is always nested in a scrollable widget there is no need to use a viewport because there will always be enough vertical space for the children. In this case, consider using a Column instead. Otherwise, consider using the "shrinkWrap" property (or a ShrinkWrappingViewport) to size the height of the viewport to the sum of the heights of its children. | |
When the exception was thrown, this was the stack: | |
#0 RenderViewport.performResize.<anonymous closure> (package:flutter/src/rendering/viewport.dart:1147:15) | |
#1 RenderVi |
NewerOlder