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/services.dart'; | |
import 'package:intl/intl.dart'; | |
class CurrencyInputFormatter extends TextInputFormatter { | |
TextEditingValue formatEditUpdate( | |
TextEditingValue oldValue, TextEditingValue newValue) { | |
if (newValue.text.length == 0) { | |
return newValue.copyWith(text: ''); | |
} else if (newValue.text.compareTo(oldValue.text) != 0) { | |
final f = new NumberFormat.currency(symbol: "\$ ", decimalDigits: 2); |
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:convert'; | |
import 'package:flutter/material.dart'; | |
import 'package:webview_flutter/webview_flutter.dart'; | |
void main() => runApp(MaterialApp(home: WebViewExample())); | |
const String kNavigationExamplePage = ''' | |
<!DOCTYPE html><html> | |
<head><title>Navigation Delegate Example</title></head> |
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
<?php | |
namespace App\Http\Controllers\Api; | |
use App\Http\Controllers\Controller; | |
use App\Models\User; | |
use Illuminate\Http\Request; | |
use Laravel\Socialite\Facades\Socialite; |
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 'dart:core'; | |
import 'dart:math'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { |
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
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
package="com.donsyl.adoration_divine2"> | |
<uses-permission android:name="android.permission.INTERNET"/> | |
<!-- io.flutter.app.FlutterApplication is an android.app.Application that | |
calls FlutterMain.startInitialization(this); in its onCreate method. | |
In most cases you can leave this as-is, but you if you want to provide | |
additional functionality it is fine to subclass or reimplement | |
FlutterApplication and put your custom class here. --> |
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:adoration_divine/bloc/bloc.dart'; | |
import 'package:adoration_divine/repositories/news_repository.dart'; | |
import 'package:adoration_divine/ui/home_page.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
import 'package:http/http.dart' as http; | |
import 'package:uni_links/uni_links.dart'; // we import unilinks_plugin | |
void main() { | |
runApp(MyApp()); | |
} |
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
/*File /config/policies/isOwner.js */ | |
module.exports = async (ctx, next) => { | |
if (ctx.state.user) { | |
const controller = ctx.request.route.controller; | |
const o = `${strapi.config.ownmap[controller]}.id`; | |
var data = { | |
id: ctx.params.id | |
}; | |
data[o] = ctx.state.user.id; |
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 { Injectable, CanActivate, ExecutionContext } from '@nestjs/common' | |
import { getAction } from '@nestjsx/crud' | |
@Injectable() | |
export class RestfulCrudRoleGuard implements CanActivate { | |
constructor( | |
// private readonly reflector: Reflector, | |
public restfulCrudOptions: { | |
readAllRoles: string [], |
NewerOlder