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 the Dart project authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style license | |
// that can be found in the LICENSE file. | |
import 'dart:async'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_markdown/flutter_markdown.dart'; | |
import 'package:google_generative_ai/google_generative_ai.dart'; | |
import 'package:url_launcher/link.dart'; |
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 the Dart project authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style license | |
// that can be found in the LICENSE file. | |
import 'dart:async'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_markdown/flutter_markdown.dart'; | |
import 'package:google_generative_ai/google_generative_ai.dart'; | |
import 'package:url_launcher/link.dart'; |
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 the Dart project authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style license | |
// that can be found in the LICENSE file. | |
import 'dart:async'; | |
import 'dart:typed_data'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_markdown/flutter_markdown.dart'; | |
import 'package:google_generative_ai/google_generative_ai.dart'; |
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