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
| // Importing the material library which contains Flutter's material design widgets. | |
| import 'package:flutter/material.dart'; | |
| /// Flutter code sample for [TextButton]. | |
| // The main entry point for the application. | |
| void main() => runApp(const TextButtonExampleApp()); | |
| // A StatelessWidget representing the root of the Flutter application. | |
| class TextButtonExampleApp extends StatelessWidget { |
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'; | |
| /// Flutter code sample for [FloatingActionButton]. | |
| void main() => runApp(const FloatingActionButtonExampleApp()); | |
| class FloatingActionButtonExampleApp extends StatelessWidget { | |
| const FloatingActionButtonExampleApp({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'; | |
| /// Flutter code sample for [IconButton]. | |
| /// This sample demonstrates different types of IconButtons with varying styles. | |
| void main() { | |
| runApp(const IconButtonApp()); | |
| } | |
| /// The main application widget. |
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'; | |
| /// Flutter code sample for [IconButton] with toggle feature. | |
| /// This sample demonstrates the use of IconButton with a toggle feature. | |
| /// It showcases different types of IconButton (standard, filled, filled tonal, outlined), | |
| /// and their selected and unselected states. | |
| void main() { | |
| runApp(const IconButtonToggleApp()); | |
| } |
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'; | |
| /// Flutter code sample for [SegmentedButton]. | |
| /// This sample demonstrates the use of SegmentedButton for both single and multiple choices. | |
| void main() { | |
| runApp(const SegmentedButtonApp()); | |
| } | |
| /// The main application widget. |
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(const TextFieldExampleApp()); | |
| class TextFieldExampleApp extends StatelessWidget { | |
| const TextFieldExampleApp({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/material.dart'; | |
| import 'package:flutter/services.dart'; | |
| void main() => runApp(const TextFieldExampleApp()); | |
| class TextFieldExampleApp extends StatelessWidget { | |
| const TextFieldExampleApp({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/material.dart'; | |
| void main() => runApp(const TextFieldExampleApp()); | |
| class TextFieldExampleApp extends StatelessWidget { | |
| const TextFieldExampleApp({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/material.dart'; | |
| void main() => runApp(const TextFieldExampleApp()); | |
| class TextFieldExampleApp extends StatelessWidget { | |
| const TextFieldExampleApp({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/material.dart'; | |
| /// Flutter code sample for M3 [Checkbox] with error state. | |
| void main() => runApp(const MyApp()); | |
| class MyApp extends StatelessWidget { | |
| const MyApp({Key? key}) : super(key: key); |