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
#!/bin/bash | |
# Root project having .gitmodules | |
PROJECT[0]="." | |
# Another project inside root project having .gitmodules | |
PROJECT[1]="project1" | |
for i in "${PROJECT[@]}" | |
do | |
cd $i |
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:async'; | |
import 'dart:collection'; | |
import 'package:meta/meta.dart'; | |
/// A listener that can be added to a [EventEmitter] using | |
/// [EventEmitter.on] or [EventEmitter.addListener]. | |
/// | |
/// This callback gets invoked once we call [EventEmitter.emit]. | |
typedef Listener<T> = void Function(T data); |
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'; | |
class PropertyValueNotifier<T> extends ValueNotifier<T> { | |
PropertyValueNotifier(T value) : super(value); | |
@override | |
void notifyListeners() { | |
super.notifyListeners(); | |
} | |
} |
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
Show hidden characters
{ | |
"include": [ | |
"./src/**/*" | |
], | |
"compilerOptions": { | |
"baseUrl": "src", | |
"paths": { | |
"@/*": [ | |
"./*" | |
] |
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 readFileStream() { | |
Stream<List<int>> stream = new File('./assets/user.json').openRead(); | |
StringBuffer buffer = new StringBuffer(); | |
stream | |
.transform(utf8.decoder) | |
.listen((data) { | |
buffer.write(data); | |
}, | |
onDone: () => print(buffer.toString()), | |
onError: (e) => print(e)); |
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 initChaptersTitleScrap() async { | |
final rawUrl = | |
'https://unacademy.com/course/gravitation-for-iit-jee/D5A8YSAJ'; | |
final webScraper = WebScraper('https://unacademy.com'); | |
final endpoint = rawUrl.replaceAll(r'https://unacademy.com', ''); | |
if (await webScraper.loadWebPage(endpoint)) { | |
final titleElements = webScraper.getElement( | |
'div.Week__Wrapper-sc-1qeje5a-2 > a.Link__StyledAnchor-sc-1n9f3wx-0 ' | |
'> div.ItemCard__ItemInfo-xrh60s-1 ' | |
'> h6.H6-sc-1gn2suh-0', |
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
# This is a basic workflow to help you get started with Actions | |
name: Build, Release app to Github Pages and Firebase Hosting | |
# name: Test, Build and Release apk | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: | |
- master |
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'; | |
import 'package:workozy_app/widgets/helper/stream_error_widget.dart'; | |
import 'package:workozy_app/widgets/helper/stream_loading_widget.dart'; | |
typedef OnData<T> = Widget Function(T data); | |
typedef OnError = Widget Function(dynamic e); | |
typedef OnLoading = Widget Function(); | |
class MyStreamBuilder<T> extends StatelessWidget { | |
MyStreamBuilder({ |
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
# This is a basic workflow to help you get started with Actions | |
name: Test, Build, Release Demo app to Azure Storgae | |
# name: Test, Build and Release apk | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: [ master ] |
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:async'; | |
import 'package:dio/dio.dart'; | |
import 'package:flutter/cupertino.dart'; | |
/// [LoggingInterceptor] is used to print logs during network requests. | |
/// It's better to add [LoggingInterceptor] to the tail of the interceptor queue, | |
/// otherwise the changes made in the interceptor behind A will not be printed out. | |
/// This is because the execution of interceptors is in the order of addition. | |
class LoggingInterceptor extends Interceptor { |
NewerOlder