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/material.dart'; | |
import 'package:internet_connection_checker_plus/internet_connection_checker_plus.dart'; | |
import 'package:xverse_flutter/utils/environment.dart'; | |
class ConnectivityWidget extends StatefulWidget { | |
const ConnectivityWidget({ | |
super.key, | |
required this.builder, |
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() { | |
const isDoorVisible = false; | |
const isClassVisible = false; | |
const isHazineVisible = false; | |
const isFaragiranVisible = false; | |
const isErsalPayamVisible = false; | |
List<bool> visibleWidgets = [ | |
isDoorVisible, | |
isClassVisible, |
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() { | |
final authRepo = AuthenticationRepository(); | |
// listen to cache updates | |
authRepo.user.listen((event) => print(event)); | |
const user = User(firstName: 'John', lastName: 'Doe', age: 29); | |
// Create user |
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 'package:flutter_web_plugins/url_strategy.dart'; | |
import 'package:go_router/go_router.dart'; | |
final _navKey = GlobalKey<NavigatorState>(); | |
void main() { | |
usePathUrlStrategy(); | |
runApp(const MyApp()); |
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
@riverpod | |
BookService bookService(BookServiceRef _) { | |
return const BookService(); | |
} | |
// fetch single book | |
@riverpod | |
Future<Book?> book(BookServiceRef ref, String id) { | |
return ref.read(bookServiceProvider).getBook(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:async'; | |
import 'dart:math'; | |
/// {@template cache_client} | |
/// An in-memory cache client. | |
/// {@endtemplate} | |
class CacheClient { | |
/// {@macro cache_client} | |
CacheClient() : _cache = <String, Object>{}; |
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
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override |
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 'dart:math'; | |
/// {@template cache_client} | |
/// An in-memory cache client. | |
/// {@endtemplate} | |
class CacheClient { | |
/// {@macro cache_client} | |
CacheClient() : _cache = <String, Object>{}; |
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 BlurLayer extends StatelessWidget { | |
final double strength; | |
final Widget? child; | |
const BlurLayer({ | |
super.key, | |
this.strength = 1, | |
this.child, | |
}); | |
static const _strengthMultiplier = 15; |
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
function onOpen(e) { | |
// Add a custom menu to the spreadsheet. | |
SpreadsheetApp.getUi() // Or DocumentApp, SlidesApp, or FormApp. | |
.createMenu('Merge Sheets') | |
.addItem('Press to Merge', 'writeToSheet') | |
.addToUi(); | |
} | |
const READ_ONLY_SHEET_NAME = "_merged_"; |