RenderProxyBox
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:shared_preferences/shared_preferences.dart'; | |
| final class SharedPreferencesKeys { | |
| static const action = 'action'; | |
| } | |
| void main() async { | |
| final prefsWithCache = await SharedPreferencesWithCache.create( | |
| cacheOptions: const SharedPreferencesWithCacheOptions( |
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/foundation.dart' show ValueListenable; | |
| import 'package:shared_preferences/shared_preferences.dart' | |
| show SharedPreferences; | |
| import 'package:flutter/material.dart'; | |
| void main() async { | |
| final counter = await SharedCounter.instance(); | |
| runApp( | |
| MaterialApp( | |
| home: Scaffold( |
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'; | |
| typedef SomethingToString<T extends Object> = void Function(T); | |
| class Foo extends Object { | |
| const Foo(); | |
| } | |
| extension type Bar(Foo foo) {} |
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() async { | |
| final futures = [ | |
| for (var i = 0; i < 100000; ++i) Future.sync(DateTime.now), | |
| ]; | |
| final dateTimes = await Future.wait(futures); | |
| final delta = dateTimes.last.difference(dateTimes.first); | |
| print(delta.inMilliseconds); | |
| } |
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
| /// https://codepen.io/sldsrg/pen/RwagmrL | |
| import 'dart:async'; | |
| import 'package:flutter/gestures.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/rendering.dart'; | |
| void main() { | |
| runApp( | |
| 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 'dart:math'; | |
| abstract class Foo {} | |
| class Bar implements Foo { | |
| const Bar(); | |
| } | |
| class Baz implements Foo { | |
| const Baz(); |
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 NestedScrollViewExampleApp()); | |
| class NestedScrollViewExampleApp extends StatelessWidget { | |
| const NestedScrollViewExampleApp({super.key}); | |
| @override | |
| Widget build(context) => const MaterialApp( | |
| home: NestedScrollViewExample(), |
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 MaterialApp( | |
| debugShowCheckedModeBanner: false, | |
| home: MyHomePage(), | |
| ), | |
| ); | |
| class MyHomePage 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'; | |
| abstract class MyImageUrls { | |
| static const image = 'https://www.claerly.com/wrong/url.jpg'; | |
| static const fallback = 'https://storage.googleapis.com/' | |
| 'cms-storage-bucket/65361d7e1dfa118aa63b.png'; | |
| } | |
| void main() => runApp( | |
| MaterialApp( |