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() { | |
| List ids = ['1234', '3455', '2330', '1111']; | |
| List users = [{"id": '1234', "name": "username"}, {"id": '3455', "name": "username"}]; | |
| List selectedUsers = users.map((user) { | |
| if(ids.contains(user["id"])) return user; | |
| return null; | |
| }).toList(); | |
| //Above line can replace with where(), as | |
| List selects = users.where((u) => ids.contains(u["id"])); // where() accept method that returns boolean based on provided condition and the if the condition is true, that element will add to the new list. | |
| print(selectedUsers); |
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(MaterialApp( | |
| title: 'Flutter GTranslate Demo', | |
| theme: ThemeData( | |
| primarySwatch: Colors.blue, | |
| ), | |
| home: MyApp(), | |
| )); |
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
| Material( | |
| shape: CircleBorder(), | |
| color: kinderm8Theme.Colors.appdarkcolour, | |
| child: Container( | |
| width: 60.0, | |
| height: 60.0, | |
| padding: const EdgeInsets.all(8.0), | |
| child: decideDeleteOrSendActionWidget(), | |
| )), |
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'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:http/http.dart' as http; | |
| void main() => runApp(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { |
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
| name: mysqltest | |
| description: A new Flutter project. | |
| version: 1.0.0+1 | |
| environment: | |
| sdk: ">=2.0.0-dev.68.0 <3.0.0" | |
| dependencies: | |
| flutter: |
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'; | |
| //this is what you need to have for flexible grid | |
| import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; | |
| //below two imports for fetching data from somewhere on the internet | |
| import 'dart:convert'; | |
| import 'package:http/http.dart' as http; | |
| //boilerplate that you use everywhere |
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
| { | |
| "emojis": [ | |
| {"emoji": "π©βπ©βπ§βπ§", "name": "family_mothers_two_girls", "shortname": "", "unicode": "", "html": "👩‍👩‍👧‍👧", "category": "p", "order": ""}, | |
| {"emoji": "π©βπ©βπ§βπ¦", "name": "family_mothers_children", "shortname": "", "unicode": "", "html": "👩‍👩‍👧‍👦", "category": "p", "order": ""}, | |
| {"emoji": "π©βπ©βπ¦βπ¦", "name": "family_mothers_two_boys", "shortname": "", "unicode": "", "html": "👩‍👩‍👦‍👦", "category": "p", "order": ""}, | |
| {"emoji": "π¨βπ©βπ§βπ§", "name": "family_two_girls", "shortname": "", "unicode": "", "html": "👨‍👩‍👧‍👧", "category": "p", "order": ""}, | |
| {"emoji": "π¨βπ©βπ§βπ¦", "name": "family_children", "shortname": "", "unicode": "", "html": "👨‍👩‍👧‍👦", "category": "p", "order": ""}, | |
| {"emoji": "π¨βπ©βπ¦βπ¦", "name": "family_two_boys", "shortname": "", "unicode": "", "html": "👨&zw |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <h1>Hello Dude</h1> |
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
| //The easy way: | |
| void main() { | |
| var collection=[0, 1, 2]; | |
| for(int i = 0; i < collection.length; i++) { | |
| collection[i] += 1; | |
| } | |
| print(collection); | |
| } |
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(new MyApp()); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return new MaterialApp( | |
| title: 'LogIn n SignUp', | |
| theme: ThemeData( |