This file contains 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( | |
home: MyHomePage(), | |
); |
This file contains 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
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override |
This file contains 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'; | |
import 'package:flutter/material.dart'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} |
This file contains 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() { | |
String text = "Test #/first1hashtag test #/second2hashtag test."; | |
RegExp exp = new RegExp(r"\B#\/"); | |
exp.allMatches(text).forEach((match){ | |
print(match.group(0)); | |
text = text.replaceAll(match.group(0), ""); | |
}); | |
print(text); | |
String text2 = "Test #/first1hashtag test #/second2hashtag test."; |
This file contains 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() { | |
var locations = { | |
{ | |
'country': 'Egypt', | |
'city': 'Cairo', | |
'Latitude': 30.033333, | |
'Longitude': 31.233334, | |
'utcOffset': 2 | |
}, | |
{ |
This file contains 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() { | |
String str = "one.two"; | |
print(str.replaceAll(".two", "")); | |
// or | |
print(str.split(".").first);// split() will split from . and gives new List with separated elements. | |
// or | |
This file contains 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() { | |
Map parentMap = { | |
'childOne': { | |
'grandSon': { | |
'grandGrandChild': { | |
'childOne': 'John', | |
'childTwo': 'Ron' | |
} | |
}, | |
'grandDaughter': { |
This file contains 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() { | |
List<Map> _pecasList = []; | |
List<String> alphas = ["a", "b", "c"]; | |
Map<String, dynamic> newPecas = Map(); | |
for (String c in alphas) { | |
if (c.isEmpty || c.trimLeft() == "") { | |
print("Campo Vazio"); | |
} else { |
This file contains 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() { | |
List<String> first = ['A','B','C','D']; | |
List<String> second = ['B','D']; | |
List<String> result = first.where((item) => !second.contains(item)).toList(); | |
print(result); | |
} |
This file contains 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() { | |
final text = """My website url: https://blasanka.github.io/ | |
Google search using: www.google.com, social media is facebook.com, http://example.com/method?param=flutter | |
stackoverflow.com is my greatest website. DartPad share: https://github.com/dart-lang/dart-pad/wiki/Sharing-Guide see this example and edit it here """; | |
RegExp exp = new RegExp(r'(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-?=%.]+'); | |
Iterable<RegExpMatch> matches = exp.allMatches(text); | |
matches.forEach((match) { | |
print(text.substring(match.start, match.end)); |
NewerOlder