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_bloc/flutter_bloc.dart'; | |
import 'package:flutter/material.dart'; | |
abstract class BaseState {} | |
class InitialState implements BaseState {} | |
class LoadingState implements BaseState {} | |
class LoadedState<T> implements BaseState { |
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() { | |
final result = sumZero([-6, -5, 0, 1, 2, 3, 4]); | |
print(result); | |
print(uniqueCount([-2,-1,-1, 0,1])); | |
} | |
//assume it receives a sorted array | |
// return a pair of values whose sum is 0 otherwise undefined | |
//using multiple pointers pattern |
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() { | |
bool result = isAnagram('iceman', 'cinemas'); | |
print(result); | |
} | |
bool isAnagram(String first, String second) { | |
if (first.length != second.length) { | |
return false; | |
} |
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'; | |
void main() { | |
final isSame = same([1, 4, 5], [16, 1, 25]); | |
print(isSame); | |
} | |
bool same(List<int> array1, List<int> array2) { | |
if (array1.length != array2.length) { | |
return false; |
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'; | |
void main() { | |
const monitor = 3000; // 3s | |
Timer.periodic(Duration(seconds: monitor), (timer){ | |
print('Timer $timer'); | |
refreshTokenChk(monitor); | |
}); | |
} |
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 'dart:math' as math; | |
void main() { | |
runApp(MyApp()); | |
} | |
class CurvePainter extends CustomPainter { | |
@override | |
void paint(Canvas canvas, Size size) { |
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
//A group of twenty boys are in a football pitch and they want to play football. | |
//I want you to help me create a programme using python or any other programming | |
//language that will help me to break the group into two football teams each consisting of 10 players. | |
//The programme should first ask me to input the names of the two teams; the first team name then the second team name. | |
//Then after that, it should ask me to input the list of names of the twenty boys. | |
//After inputing these names, the programme should give me an output of the two final teams with the team name on top of a list of the 10 players | |
//of each team. The team players should be selected in the order of odd number and even number respectively according to the list of names that will be provided. | |
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 'dart:convert'; | |
import 'package:http/http.dart' as http; | |
void main() async{ | |
final List<SubSection> subsections = []; | |
final graphQLQuery = { | |
'query': '''query { | |
getSubsections(courseId: 16, sectionId: 16) { | |
id |
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:http/http.dart' as http; | |
void main() async{ | |
final List<Section> sections = []; | |
final graphQLQuery = { | |
'query': '''query { | |
getSections(courseId: 16) { | |
id |
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:http/http.dart' as http; | |
void main() async{ | |
final List<Section> sections = []; | |
final graphQLQuery = { | |
'query': '''query GetSections { | |
getSections { | |
id |
NewerOlder