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 App extends HookConsumerWidget { | |
const App({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context, WidgetRef ref) { | |
final router = useMemoized(() => Router()); | |
final locale = ref.watch(localeProvider); | |
return MaterialApp.router( | |
debugShowCheckedModeBanner: !_kIsTakingScreenshots && kDebugMode, |
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'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
extension LoadingWidgets on List<Widget> { | |
// TODO: This will likely fail the requirements of a [ListView.builder] | |
/// Adds [loadingWidgetAfter] and [loadingWidgetBefore] to the list. | |
List<Widget> addLoadingIndicators( | |
Widget? loadingWidgetAfter, |
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 admin = require('firebase-admin'); | |
const serviceAccount: { [key: string]: any } = require('../service_key.json'); | |
admin.initializeApp({ | |
credential: admin.credential.cert(serviceAccount), | |
databaseURL: 'https://remac-test-prep.firebaseio.com', | |
}); | |
const firestore = admin.firestore(); |
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 admin = require('firebase-admin'); | |
const serviceAccount: { [key: string]: any } = require('../service_key.json'); | |
admin.initializeApp({ | |
credential: admin.credential.cert(serviceAccount), | |
databaseURL: 'https://remac-test-prep.firebaseio.com', | |
}); | |
const firestore = admin.firestore(); |
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:async_button_builder/async_button_builder.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_hooks/flutter_hooks.dart'; | |
import 'package:flutter_utils/flutter_utils.dart'; | |
import 'package:hooks_riverpod/hooks_riverpod.dart'; | |
import 'package:nremt_paramedic_prep/data/profile/profile.dart'; | |
import 'package:nremt_paramedic_prep/models/doc/doc.dart'; | |
import 'package:nremt_paramedic_prep/models/test/test.dart'; | |
import 'package:nremt_paramedic_prep/providers/categories.dart'; | |
import 'package:nremt_paramedic_prep/providers/question_count.dart'; |
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:cloud_firestore/cloud_firestore.dart'; | |
import 'package:freezed_annotation/freezed_annotation.dart'; | |
part 'document.freezed.dart'; | |
typedef RestoreData<T> = Future<void> Function(); | |
/// To generate updated model code, run: | |
/// flutter pub run build_runner build | |
@freezed |
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
// This file incorporates work covered by the following copyright and | |
// permission notice: | |
// | |
// Copyright 2013, the Dart project authors. All rights reserved. | |
// Redistribution and use in source and binary forms, with or without | |
// modification, are permitted provided that the following conditions are | |
// met: | |
// | |
// * Redistributions of source code must retain the above copyright | |
// notice, this list of conditions and the following disclaimer. |
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
enum ElementType { literal, argument, plural, gender, select } | |
class BaseElement { | |
final ElementType type; | |
final String value; | |
const BaseElement(this.type, this.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
import 'package:hooks_riverpod/all.dart'; | |
import 'package:tuple/tuple.dart'; | |
AsyncValue<Tuple2<T, R>> combineAsync2<T, R>( | |
AsyncValue<T> asyncOne, | |
AsyncValue<R> asyncTwo, | |
) { | |
if (asyncOne is AsyncError) { | |
final error = asyncOne as AsyncError<T>; | |
return AsyncError(error.error, error.stackTrace); |
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
#!/bin/bash | |
# This script will install pytorch, torchvision, torchtext and spacy on nano. | |
# If you have any of these installed already on your machine, you can skip those. | |
# Tailored for virtual environments created with python3 -m venv [name] | |
if [ -z ${VIRTUAL_ENV+x} ] | |
then | |
echo "Not in a virtual environment" |