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:collection/collection.dart' show IterableExtension; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
import 'package:stream_chat_flutter/stream_chat_flutter.dart'; | |
Future<void> main() async { | |
final client = StreamChatClient( | |
's2dxdhpxd94g', | |
logLevel: Level.INFO, | |
); |
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:ui'; | |
import 'package:cached_network_image/cached_network_image.dart'; | |
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/painting.dart'; | |
void main() { | |
runApp(const App()); | |
} |
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
/// Implementation of [Card] using the new [MaterialStateProperty] for handling | |
/// and reacting to user interactions. | |
class InteractiveCard extends StatefulWidget { | |
const InteractiveCard({ | |
Key? key, | |
this.color, | |
this.shadowColor, | |
this.elevation, | |
this.shape, | |
this.borderOnForeground = true, |
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'; | |
void main() { | |
runApp(TexColDemo()); | |
} | |
class TexColDemo extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
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:stream_chat_flutter/stream_chat_flutter.dart'; | |
import './responsive_builder.dart'; | |
// This sample uses GetStream for chat. To get started, please see https://getstream.io/chat/flutter/tutorial/ | |
Future<void> main() async { | |
final Client streamClient = Client("YOUR-STREAM-KEY", persistenceEnabled: false); | |
await streamClient.setUser( | |
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
void main() { | |
calculateDateInterval(DateTime(2020, 09, 22, 11, 00), DateTime(2020, 09, 22, 16, 00), 0.75); | |
} | |
void calculateDateInterval( | |
final DateTime startTime, | |
final DateTime endTime, | |
final double intervalInHours, | |
) { | |
final workingHours = endTime.difference(startTime).inHours; |
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'; | |
const kBreakpoint = 860.0; | |
extension Width on BuildContext { | |
double get width => MediaQuery.of(this).size.width; | |
} | |
void main() { | |
runApp( |
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
// MIT License | |
// | |
// Copyright (c) 2020 Neevash Ramdial | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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
// MIT License | |
// | |
// Copyright (c) 2019 Neevash Ramdial | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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
/// Mixin containing a helper list method | |
mixin ListDistinct { | |
/// Creates a new list with the unique elements form [listOne] and [listTwo]. | |
/// The new list is returned with the specified type [T] | |
List<T> distinct<T>(List<T> listOne, List<T> listTwo) { | |
final List<T> _newList = <T>[]; | |
_newList.addAll(listOne); | |
for (final T item in listTwo) { | |
if (_newList.contains(item)) { | |
_newList.remove(item); |
NewerOlder