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(){ | |
Map<dynamic, dynamic> values=<dynamic,dynamic>{"Name":"Peter","age":21}; | |
var name=values["Name"]; | |
print("My name is ${name}, and my age is ${values["age"]}."); | |
} |
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
class Employee { | |
Employee() | |
{ | |
print("inside default"); | |
} | |
// Person does not have a default constructor; | |
// you must call super.fromJson(data). | |
Employee.fromJson(Map data){ | |
print('in Employee'); |
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(){ | |
var rest; | |
rest = [{"name" : "peter","family" :"hi"},{"name": "john"},{"name": "peter"},{"name": "peter"}]; | |
var filteredList; | |
filteredList = rest.where((val) => val["name"] == "peter"); | |
print(filteredList); | |
} |
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
// 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 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
// 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 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
class _MyHomePageState extends State<MyHomePage> { | |
final fb = FirebaseDatabase.instance; | |
final myController = TextEditingController(); | |
final name = "Name"; | |
@override | |
Widget build(BuildContext context) { | |
final ref = fb.reference(); | |
return Scaffold( | |
appBar: AppBar( |
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
var retrievedName; | |
ElevatedButton( | |
onPressed: () { | |
ref.child("Name").once().then((DataSnapshot data){ | |
print(data.value); | |
print(data.key); | |
setState(() { | |
retrievedName = data.value; | |
}); |
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 name = [{ | |
"restaurant_id": "1010000001", | |
"restaurant_name": "UNI Resto Cafe", | |
"restaurant_image": "http://restaurants.unicomerp.net/images/Restaurant/1010000001.jpg", | |
"table_id": "1", | |
"table_name": "Riyadh-Table 01", | |
"branch_name": "UNI Resto Cafe-Riyadh", | |
"nexturl": "http://snapittapp.snapitt.net/api/menu/10/?org=1010000001&branch_id=1000000001&limit=10&offset=20&lang=en", | |
"table_menu_list": [{ |
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:firebase_core/firebase_core.dart'; | |
import 'package:firebase_database/firebase_database.dart'; | |
import 'package:firebase_test/home.dart'; | |
import 'package:flutter/material.dart'; | |
void main() async { | |
WidgetsFlutterBinding.ensureInitialized(); | |
await Firebase.initializeApp(); | |
runApp(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
class MyHomePage extends StatefulWidget { | |
MyHomePage({Key key, this.title}) : super(key: key); | |
final String title; | |
@override | |
_MyHomePageState createState() => _MyHomePageState(); | |
} |
OlderNewer