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'; | |
class QuestionsPage extends StatefulWidget { | |
@override | |
_QuestionsPageState createState() => _QuestionsPageState(); | |
} | |
class _QuestionsPageState extends State<QuestionsPage> { | |
// List of items |
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 MySingleton { | |
int resource = 5; | |
// Singleton pattern | |
static final MySingleton _singleton = new MySingleton._internal(); | |
factory MySingleton({int newResource}) { | |
// Called everytime an object is created. | |
// If an instance of the class already exists, then returns the existing reference, | |
// else creates a new reference and returns it. |