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:convert'; | |
| /// Mock [Response] implementation | |
| class Response { | |
| final String body; | |
| Response(this.body); | |
| } | |
| /// Mock for `post` API request | |
| Response post( |
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'; | |
| final paint = Paint() | |
| ..color = const Color(0xFFFFFFFF) | |
| ..style = PaintingStyle.stroke; | |
| void main() { | |
| window.onBeginFrame = beginFrame; | |
| window.scheduleFrame(); | |
| } |
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() { | |
| final inputList = List.generate( | |
| 100, | |
| (index) => InputModel(index, 'Initial Value ${index}'), | |
| ); | |
| runApp(MyApp(inputModels: inputList)); | |
| } |
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' as math; | |
| import 'package:flutter/material.dart'; | |
| const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
| void main() { | |
| runApp(MyApp()); | |
| } | |
| class MyApp 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
| extension NumX on num { | |
| /// Maps [this] from the range [inputLow] to [inputHight] on the range | |
| /// [outputLow] tp [outputHigh]. This function is reversable by swapping the | |
| /// input and output ranges. | |
| /// | |
| /// For Example: | |
| /// ```dart | |
| /// assert(0.5.map(0, 1, 0, 10) == 5); | |
| /// assert(5.map(0, 10, 0, 1) == 0.5); | |
| /// assert(4327.map(0, 8003, 0, 1) == 0.5406722479070348); |
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'; | |
| const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
| void main() { | |
| runApp(HeroExampleApp()); | |
| } | |
| class HeroExampleApp 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'; | |
| void main() => runApp(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| title: 'Flutter Demo', | |
| debugShowCheckedModeBanner: false, |