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
// Copyright 2024 Google LLC | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
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
// Copyright 2024 Google LLC | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
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
Future<Uint8List?> pickFile() async { | |
final el = html.document.createElement('input') as html.HTMLInputElement; | |
el.type = 'file'; | |
el.accept = 'image/*'; | |
el.click(); | |
final completer = Completer<Uri?>(); | |
el.onchange = (html.Event e) { | |
final files = el.files; | |
if (files != null && files.length != 0) { | |
final file = files.item(0); |
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
// Copyright 2024 Google LLC | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
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 'package:flutter_markdown/flutter_markdown.dart'; | |
class ChatBubble extends StatelessWidget { | |
const ChatBubble({ | |
super.key, | |
this.child, | |
this.text, | |
required this.isUser, | |
}); |
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:dart_mappable/dart_mappable.dart'; | |
part 'schema.mapper.dart'; | |
@MappableClass() | |
class JsonCanvas with JsonCanvasMappable { | |
List<JsonCanvasNode> nodes; | |
List<JsonCanvasEdge> edges; | |
JsonCanvas({ |
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
void main() { | |
final number = 1; | |
final str = 'Hello World'; | |
print((number, str)); | |
print((DateTime.now(), str)); | |
print((DateTime.now(), count: number, description: str)); |
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
void main() { | |
myFunction(1, 2, c: 3, d: 4); | |
myFunction(1, c: 3, d: 4, 2); | |
myFunction(c: 3, d: 4, 1, 2); | |
myFunction(c: 3, 1, 2, d: 4); | |
myFunction.call(1, 2, c: 3, d: 4); | |
Function.apply(myFunction, [1, 2], {#c: 3, #d: 4}); | |
} | |
void myFunction(int a, int b, {int? c, int? d}) { |
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
void main() { | |
print((null, null.isTruthy)); | |
print(('', ''.isTruthy)); | |
print(('false', 'false'.isTruthy)); | |
print(('true', 'true'.isTruthy)); | |
print((0, 0.isTruthy)); | |
print((1, 1.isTruthy)); | |
print((false, false.isTruthy)); | |
print((true, true.isTruthy)); | |
print(([], [].isTruthy)); |
NewerOlder