Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## 0.6.8-wip

* Require Dart 3.5 or later.
*
* Remove dependency on `package:gap`.

## 0.6.7

Expand Down
5 changes: 2 additions & 3 deletions example/lib/demo/api_key_page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:gap/gap.dart';
import 'package:url_launcher/url_launcher.dart';

class GeminiApiKeyPage extends StatefulWidget {
Expand Down Expand Up @@ -57,7 +56,7 @@ class _GeminiApiKeyPageState extends State<GeminiApiKeyPage> {
child: Text('(or copy the URL above by tapping HERE)'),
),
),
const Gap(16),
const SizedBox(height: 16),
const Text('Paste your API key here:'),
SizedBox(
width: 300,
Expand All @@ -74,7 +73,7 @@ class _GeminiApiKeyPageState extends State<GeminiApiKeyPage> {
: null,
),
),
const Gap(16),
const SizedBox(height: 16),
ElevatedButton(
onPressed: _isValidApiKey()
? () => widget.onApiKey(_controller.text)
Expand Down
5 changes: 2 additions & 3 deletions example/lib/recipes/pages/edit_recipe_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:flutter_ai_toolkit/flutter_ai_toolkit.dart';
import 'package:gap/gap.dart';
import 'package:go_router/go_router.dart';
import 'package:google_generative_ai/google_generative_ai.dart';
import 'package:uuid/uuid.dart';
Expand Down Expand Up @@ -150,7 +149,7 @@ When you generate a recipe, you should generate a JSON object.
),
maxLines: null,
),
const Gap(16),
const SizedBox(height: 16),
OverflowBar(
spacing: 16,
children: [
Expand Down Expand Up @@ -210,9 +209,9 @@ When you generate a recipe, you should generate a JSON object.
title: Text(recipe.title),
content: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 16,
children: [
const Text('Modifications:'),
const Gap(16),
Text(_wrapText(modifications)),
],
),
Expand Down
5 changes: 2 additions & 3 deletions example/lib/recipes/views/recipe_content_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// found in the LICENSE file.

import 'package:flutter/material.dart';
import 'package:gap/gap.dart';

import '../data/recipe_data.dart';

Expand All @@ -25,18 +24,18 @@ class RecipeContentView extends StatelessWidget {
? SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 16,
children: [
_RecipeIngredientsView(recipe),
const Gap(16),
_RecipeInstructionsView(recipe),
],
),
)
: Row(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 16,
children: [
Expanded(child: _RecipeIngredientsView(recipe)),
const Gap(16),
Expanded(child: _RecipeInstructionsView(recipe)),
],
),
Expand Down
5 changes: 1 addition & 4 deletions example/lib/recipes/views/recipe_response_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:gap/gap.dart';

import '../data/recipe_data.dart';
import '../data/recipe_repository.dart';
Expand Down Expand Up @@ -35,7 +34,6 @@ class RecipeResponseView extends StatelessWidget {
// extract the recipe
final json = recipeWithText['recipe'] as Map<String, dynamic>;
final recipe = Recipe.fromJson(json);
children.add(const Gap(16));
children.add(Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand All @@ -46,12 +44,10 @@ class RecipeResponseView extends StatelessWidget {
));

// add a button to add the recipe to the list
children.add(const Gap(16));
children.add(OutlinedButton(
onPressed: () => RecipeRepository.addNewRecipe(recipe),
child: const Text('Add Recipe'),
));
children.add(const Gap(16));
}
} catch (e) {
debugPrint('Error parsing response: $e');
Expand All @@ -74,6 +70,7 @@ class RecipeResponseView extends StatelessWidget {

return Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 16,
children: children,
);
}
Expand Down
3 changes: 1 addition & 2 deletions example/lib/recipes/views/recipe_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// found in the LICENSE file.

import 'package:flutter/material.dart';
import 'package:gap/gap.dart';

import '../data/recipe_data.dart';
import 'recipe_content_view.dart';
Expand Down Expand Up @@ -52,7 +51,7 @@ class RecipeView extends StatelessWidget {
],
),
),
const Gap(16),
const SizedBox(height: 16),
],
),
],
Expand Down
1 change: 0 additions & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ dependencies:
firebase_vertexai: ^1.0.1
shared_preferences: ^2.3.2
url_launcher: ^6.3.0
gap: ^3.0.1
go_router: ^14.2.8
uuid: ^4.5.1
path: ^1.9.0
Expand Down
3 changes: 1 addition & 2 deletions lib/src/views/attachment_view/file_attatchment_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// found in the LICENSE file.

import 'package:flutter/widgets.dart';
import 'package:gap/gap.dart';

import '../../chat_view_model/chat_view_model_client.dart';
import '../../providers/interface/attachments.dart';
Expand Down Expand Up @@ -37,6 +36,7 @@ class FileAttachmentView extends StatelessWidget {
decoration: attachmentStyle.decoration,
child: Row(
mainAxisSize: MainAxisSize.min,
spacing: 8,
children: [
Container(
height: 64,
Expand All @@ -48,7 +48,6 @@ class FileAttachmentView extends StatelessWidget {
size: 24,
),
),
const Gap(8),
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down
3 changes: 1 addition & 2 deletions lib/src/views/chat_input/chat_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import 'package:file_selector/file_selector.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:gap/gap.dart';
import 'package:image_picker/image_picker.dart';
import 'package:waveform_recorder/waveform_recorder.dart';

Expand Down Expand Up @@ -149,7 +148,7 @@ class _ChatInputState extends State<ChatInput> {
attachments: _attachments,
onRemove: onRemoveAttachment,
),
if (_attachments.isNotEmpty) const Gap(6),
if (_attachments.isNotEmpty) const SizedBox(height: 6),
ValueListenableBuilder(
valueListenable: _textController,
builder: (context, value, child) => ListenableBuilder(
Expand Down
3 changes: 1 addition & 2 deletions lib/src/views/chat_input/editing_indicator.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/widgets.dart';
import 'package:gap/gap.dart';

import '../../styles/action_button_style.dart';
import '../../styles/toolkit_text_styles.dart';
Expand Down Expand Up @@ -36,14 +35,14 @@ class EditingIndicator extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
spacing: 6,
children: [
Text(
'Editing',
style: ToolkitTextStyles.label.copyWith(
color: invertColor(cancelButtonStyle.iconColor),
),
),
const Gap(6),
ActionButton(
onPressed: onCancelEdit,
style: cancelButtonStyle,
Expand Down
3 changes: 1 addition & 2 deletions lib/src/views/chat_message_view/hovering_buttons.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:async';

import 'package:flutter/widgets.dart';
import 'package:gap/gap.dart';

import '../../styles/llm_chat_view_style.dart';
import '../../utility.dart';
Expand Down Expand Up @@ -66,6 +65,7 @@ class HoveringButtons extends StatelessWidget {
right: isUserMessage ? 0 : null,
left: isUserMessage ? null : 32,
child: Row(
spacing: 6,
children: [
if (onEdit != null)
GestureDetector(
Expand All @@ -78,7 +78,6 @@ class HoveringButtons extends StatelessWidget {
),
),
),
const Gap(6),
GestureDetector(
onTap: () => unawaited(
copyToClipboard(context, clipboardText!),
Expand Down
3 changes: 1 addition & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ dependencies:
flutter_context_menu: ^0.2.0
flutter_markdown: ^0.7.4+3
flutter_picture_taker: ^0.2.0
gap: ^3.0.1
google_fonts: ^6.2.1
google_generative_ai: ^0.4.3
image_picker: ^1.1.2
mime: ^2.0.0
universal_platform: ^1.1.0
uuid: ^4.4.2
waveform_recorder: ^1.3.0

dev_dependencies:
flutter_lints: ^5.0.0
flutter_test:
Expand Down
Loading