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
| /// Check whether two types are the same type in Dart when working with | |
| /// generic types. | |
| /// | |
| /// Uses the same definition as the language specification for when two | |
| /// types are the same. Currently the same as mutual sub-typing. | |
| bool sameTypes<S, V>() { | |
| void func<X extends S>() {} | |
| // Dart spec says this is only true if S and V are "the same type". | |
| return func is void Function<X extends V>(); | |
| } |
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'; | |
| ThemeData getLightTheme() => ThemeData( | |
| brightness: Brightness.light, | |
| colorScheme: ColorScheme.fromSeed( | |
| seedColor: Colors.blue, | |
| brightness: Brightness.light, | |
| ), | |
| ); |
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'; | |
| ThemeData getLightTheme() => ThemeData( | |
| brightness: Brightness.light, | |
| colorScheme: ColorScheme.fromSeed( | |
| seedColor: Colors.blue, | |
| brightness: Brightness.light, | |
| ), | |
| ); |
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'; | |
| /// Legacy int API extensions on [Color]. | |
| /// | |
| /// Convenience [Color] sRGB extensions that can be used as none deprecated | |
| /// replacements for `alpha`, `red`, `green`, `blue` and `value` they are | |
| /// called [alpha8bit], [red8bit], [green8bit], [blue8bit] and [value32bit]. | |
| /// You can use them to avoid using the deprecated color properties. | |
| extension LegacyIntColorExtensions on Color { | |
| /// A 32 bit value representing this color. |
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 [BubbleTabs]. | |
| // | |
| // Available as gist: | |
| // https://gist.github.com/rydmike/f77c8ff139f13c9d0e7a231c69cb375b | |
| // And DartPad: | |
| // https://dartpad.dev/?id=f77c8ff139f13c9d0e7a231c69cb375b | |
| // Related to this tweet: | |
| // https://x.com/RydMike/status/1843380238258184605 |
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'; | |
| /// Flutter code sample for [MenuBar]. | |
| void main() => runApp(const MenuBarApp()); | |
| /// A class for consolidating the definition of menu entries. | |
| /// | |
| /// This sort of class is not required, but illustrates one way that defining |
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 MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| const MyApp({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 'dart:ui'; | |
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(const MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| const MyApp({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
| import 'dart:ui'; | |
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(const MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| const MyApp({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
| import 'package:flutter/material.dart'; | |
| void main() => runApp(const MyApp()); | |
| class MyApp extends StatelessWidget { | |
| const MyApp({super.key}); | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( |
NewerOlder