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:collection'; | |
import 'package:collection/collection.dart'; | |
import 'package:dio/dio.dart'; | |
import 'package:equatable/equatable.dart'; | |
import 'package:logging/logging.dart'; | |
import 'package:rate_limiter/rate_limiter.dart'; | |
import 'package:stream_chat/src/client/channel.dart'; | |
import 'package:stream_chat/src/client/retry_policy.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 'dart:math' as math; | |
import 'dart:ui' as ui show lerpDouble; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/widgets.dart'; | |
const _kDefaultGradient = LinearGradient(colors: [ | |
Color(0xFF000000), | |
Color(0xFF000000), | |
]); |
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_highlighting/flutter_highlighting.dart'; | |
import 'package:flutter_highlighting/themes/atom-one-dark.dart'; | |
import 'package:flutter_highlighting/themes/atom-one-light.dart'; | |
import 'package:flutter_markdown/flutter_markdown.dart'; | |
import 'package:highlighting/languages/all.dart'; | |
import 'package:stream_chat_flutter/src/theme/stream_chat_theme.dart'; | |
/// {@template codeSyntaxHighlightBuilder} | |
/// A builder that highlights code blocks in a markdown body. It uses the |
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:go_router/go_router.dart'; | |
void main() => runApp(const MyApp()); | |
/// The route configuration. | |
final GoRouter _router = GoRouter( | |
routes: <RouteBase>[ | |
GoRoute( |
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
class _SelectValueNotifier<R, T> extends ValueNotifier<R> { | |
_SelectValueNotifier(this.source, this.selector) | |
: super(selector(source.value)) { | |
source.addListener(_sourceListener); | |
} | |
final ValueNotifier<T> source; | |
final R Function(T value) selector; | |
void _sourceListener() => value = selector(source.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 'dart:convert'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'package:stream_chat/stream_chat.dart'; | |
class MessageInputController extends ValueNotifier<Message> { | |
/// Creates a controller for an editable text field. | |
/// | |
/// This constructor treats a null [message] argument as if it were the empty |
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
abstract class EventSyncHelper { | |
void startSession(); | |
Future<void> sendEvent(Event event); | |
Future<VoidResult> syncRemainingEvents(); | |
void endSession(); | |
} |
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 Streamable<T> extends Subject<T> implements ValueStream<T> { | |
Streamable(this._subject) : super(_subject, _subject); | |
final BehaviorSubject<T> _subject; | |
@override | |
Subject<R> createForwardingSubject<R>({ | |
void Function()? onListen, | |
void Function()? onCancel, | |
bool sync = false, |
NewerOlder