Skip to content

Commit ea1cf9d

Browse files
authored
Remove dependency on package:gap (#33)
1 parent 33f13c9 commit ea1cf9d

File tree

12 files changed

+14
-27
lines changed

12 files changed

+14
-27
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## 0.6.8-wip
22

33
* Require Dart 3.5 or later.
4-
*
4+
* Remove dependency on `package:gap`.
55

66
## 0.6.7
77

example/lib/demo/api_key_page.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter/services.dart';
3-
import 'package:gap/gap.dart';
43
import 'package:url_launcher/url_launcher.dart';
54

65
class GeminiApiKeyPage extends StatefulWidget {
@@ -57,7 +56,7 @@ class _GeminiApiKeyPageState extends State<GeminiApiKeyPage> {
5756
child: Text('(or copy the URL above by tapping HERE)'),
5857
),
5958
),
60-
const Gap(16),
59+
const SizedBox(height: 16),
6160
const Text('Paste your API key here:'),
6261
SizedBox(
6362
width: 300,
@@ -74,7 +73,7 @@ class _GeminiApiKeyPageState extends State<GeminiApiKeyPage> {
7473
: null,
7574
),
7675
),
77-
const Gap(16),
76+
const SizedBox(height: 16),
7877
ElevatedButton(
7978
onPressed: _isValidApiKey()
8079
? () => widget.onApiKey(_controller.text)

example/lib/recipes/pages/edit_recipe_page.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import 'dart:convert';
66

77
import 'package:flutter/material.dart';
88
import 'package:flutter_ai_toolkit/flutter_ai_toolkit.dart';
9-
import 'package:gap/gap.dart';
109
import 'package:go_router/go_router.dart';
1110
import 'package:google_generative_ai/google_generative_ai.dart';
1211
import 'package:uuid/uuid.dart';
@@ -150,7 +149,7 @@ When you generate a recipe, you should generate a JSON object.
150149
),
151150
maxLines: null,
152151
),
153-
const Gap(16),
152+
const SizedBox(height: 16),
154153
OverflowBar(
155154
spacing: 16,
156155
children: [
@@ -210,9 +209,9 @@ When you generate a recipe, you should generate a JSON object.
210209
title: Text(recipe.title),
211210
content: Column(
212211
crossAxisAlignment: CrossAxisAlignment.start,
212+
spacing: 16,
213213
children: [
214214
const Text('Modifications:'),
215-
const Gap(16),
216215
Text(_wrapText(modifications)),
217216
],
218217
),

example/lib/recipes/views/recipe_content_view.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// found in the LICENSE file.
44

55
import 'package:flutter/material.dart';
6-
import 'package:gap/gap.dart';
76

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

@@ -25,18 +24,18 @@ class RecipeContentView extends StatelessWidget {
2524
? SingleChildScrollView(
2625
child: Column(
2726
crossAxisAlignment: CrossAxisAlignment.start,
27+
spacing: 16,
2828
children: [
2929
_RecipeIngredientsView(recipe),
30-
const Gap(16),
3130
_RecipeInstructionsView(recipe),
3231
],
3332
),
3433
)
3534
: Row(
3635
crossAxisAlignment: CrossAxisAlignment.start,
36+
spacing: 16,
3737
children: [
3838
Expanded(child: _RecipeIngredientsView(recipe)),
39-
const Gap(16),
4039
Expanded(child: _RecipeInstructionsView(recipe)),
4140
],
4241
),

example/lib/recipes/views/recipe_response_view.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'dart:convert';
22

33
import 'package:flutter/material.dart';
44
import 'package:flutter_markdown/flutter_markdown.dart';
5-
import 'package:gap/gap.dart';
65

76
import '../data/recipe_data.dart';
87
import '../data/recipe_repository.dart';
@@ -35,7 +34,6 @@ class RecipeResponseView extends StatelessWidget {
3534
// extract the recipe
3635
final json = recipeWithText['recipe'] as Map<String, dynamic>;
3736
final recipe = Recipe.fromJson(json);
38-
children.add(const Gap(16));
3937
children.add(Column(
4038
crossAxisAlignment: CrossAxisAlignment.start,
4139
children: [
@@ -46,12 +44,10 @@ class RecipeResponseView extends StatelessWidget {
4644
));
4745

4846
// add a button to add the recipe to the list
49-
children.add(const Gap(16));
5047
children.add(OutlinedButton(
5148
onPressed: () => RecipeRepository.addNewRecipe(recipe),
5249
child: const Text('Add Recipe'),
5350
));
54-
children.add(const Gap(16));
5551
}
5652
} catch (e) {
5753
debugPrint('Error parsing response: $e');
@@ -74,6 +70,7 @@ class RecipeResponseView extends StatelessWidget {
7470

7571
return Column(
7672
crossAxisAlignment: CrossAxisAlignment.start,
73+
spacing: 16,
7774
children: children,
7875
);
7976
}

example/lib/recipes/views/recipe_view.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// found in the LICENSE file.
44

55
import 'package:flutter/material.dart';
6-
import 'package:gap/gap.dart';
76

87
import '../data/recipe_data.dart';
98
import 'recipe_content_view.dart';
@@ -52,7 +51,7 @@ class RecipeView extends StatelessWidget {
5251
],
5352
),
5453
),
55-
const Gap(16),
54+
const SizedBox(height: 16),
5655
],
5756
),
5857
],

example/pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ dependencies:
1818
firebase_vertexai: ^1.0.1
1919
shared_preferences: ^2.3.2
2020
url_launcher: ^6.3.0
21-
gap: ^3.0.1
2221
go_router: ^14.2.8
2322
uuid: ^4.5.1
2423
path: ^1.9.0

lib/src/views/attachment_view/file_attatchment_view.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// found in the LICENSE file.
44

55
import 'package:flutter/widgets.dart';
6-
import 'package:gap/gap.dart';
76

87
import '../../chat_view_model/chat_view_model_client.dart';
98
import '../../providers/interface/attachments.dart';
@@ -37,6 +36,7 @@ class FileAttachmentView extends StatelessWidget {
3736
decoration: attachmentStyle.decoration,
3837
child: Row(
3938
mainAxisSize: MainAxisSize.min,
39+
spacing: 8,
4040
children: [
4141
Container(
4242
height: 64,
@@ -48,7 +48,6 @@ class FileAttachmentView extends StatelessWidget {
4848
size: 24,
4949
),
5050
),
51-
const Gap(8),
5251
Flexible(
5352
child: Column(
5453
crossAxisAlignment: CrossAxisAlignment.start,

lib/src/views/chat_input/chat_input.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import 'package:file_selector/file_selector.dart';
66
import 'package:flutter/services.dart';
77
import 'package:flutter/widgets.dart';
8-
import 'package:gap/gap.dart';
98
import 'package:image_picker/image_picker.dart';
109
import 'package:waveform_recorder/waveform_recorder.dart';
1110

@@ -149,7 +148,7 @@ class _ChatInputState extends State<ChatInput> {
149148
attachments: _attachments,
150149
onRemove: onRemoveAttachment,
151150
),
152-
if (_attachments.isNotEmpty) const Gap(6),
151+
if (_attachments.isNotEmpty) const SizedBox(height: 6),
153152
ValueListenableBuilder(
154153
valueListenable: _textController,
155154
builder: (context, value, child) => ListenableBuilder(

lib/src/views/chat_input/editing_indicator.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:flutter/widgets.dart';
2-
import 'package:gap/gap.dart';
32

43
import '../../styles/action_button_style.dart';
54
import '../../styles/toolkit_text_styles.dart';
@@ -36,14 +35,14 @@ class EditingIndicator extends StatelessWidget {
3635
child: Row(
3736
mainAxisAlignment: MainAxisAlignment.end,
3837
crossAxisAlignment: CrossAxisAlignment.end,
38+
spacing: 6,
3939
children: [
4040
Text(
4141
'Editing',
4242
style: ToolkitTextStyles.label.copyWith(
4343
color: invertColor(cancelButtonStyle.iconColor),
4444
),
4545
),
46-
const Gap(6),
4746
ActionButton(
4847
onPressed: onCancelEdit,
4948
style: cancelButtonStyle,

0 commit comments

Comments
 (0)