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
extension PriceFormat on num? { | |
static final f = NumberFormat("###,###,##0.##", "en_US"); | |
String get format => formatter.format(this); | |
String get simpleFormat => f.format(this); | |
} | |
class CommaTextInputFormatter extends TextInputFormatter { | |
@override | |
TextEditingValue formatEditUpdate( |
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_svg/flutter_svg.dart'; | |
import 'package:mobile_scanner/mobile_scanner.dart'; | |
import 'package:sco_mobile/constants/colors.dart'; | |
typedef MobileScannerErrorBuilder = Widget Function( | |
BuildContext, | |
MobileScannerException, | |
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
// Sudoku is a number-placement puzzle. The objective is to fill a 9 × 9 grid | |
// with numbers in such a way that each column, each row, and each of | |
//the nine 3 × 3 sub-grids that compose the grid all | |
//contain all of the numbers from 1 to 9 one time. | |
// Implement an algorithm that will check whether the given grid | |
//of numbers represents a valid Sudoku puzzle according to the | |
//layout rules described above. Note that the puzzle represented | |
//by grid does not have to be solvable. | |
void main(){ |
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:cryptericon/common.dart'; | |
class StatusStepper extends StatelessWidget { | |
final List<DocumentStatus> status; | |
const StatusStepper({ | |
Key? key, | |
required this.status, | |
}) : super(key: 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:get/get.dart'; | |
import 'package:get/get_state_manager/get_state_manager.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp 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 'dart:math' as math; | |
/// see https://en.wikipedia.org/wiki/Levenshtein_distance | |
void main() { | |
/// terms distance can be used as threshold value when you filter similar results. | |
/// if the number of "editions" is low, you can suppose a typo and provide the "similar" | |
/// result (maybe using the `int` distance as a sorting method). | |
print(levenshtein('sittin', 'sitting')); | |
print(levenshtein('casa', 'calle')); | |
} |
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() { | |
test(()=>print('called from a parameter')); | |
} | |
void test( Function onTap){ | |
print('called on a function'); | |
onTap(); | |
} |
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:async'; | |
import 'dart:isolate'; | |
void main() async { | |
await IsolateService.init(); | |
IsolateService?.updates?.listen((e) => print('message from the isolate: $e')); | |
IsolateService.sendMessage('message from main'); | |
} | |
class IsolateService { |
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:get/get.dart'; | |
void main() { | |
runApp( | |
GetMaterialApp( | |
initialRoute: '/', | |
initialBinding: BindingsBuilder.put(() => HomeController()), | |
getPages: [ | |
GetPage( |