Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/line numbers #8

Open
wants to merge 8 commits into
base: release/0.2.0
Choose a base branch
from
Open

Feature/line numbers #8

wants to merge 8 commits into from

Conversation

xJac0b
Copy link
Collaborator

@xJac0b xJac0b commented Nov 19, 2024

No description provided.

@tmaxxdd tmaxxdd changed the base branch from main to release/0.2.0 November 20, 2024 08:45
@@ -45,6 +45,7 @@ class _MyAppState extends State<MyApp> {
selectAll: true,
share: true,
),
enableLineNumbers: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

showLineNumbers

import 'package:kode_view/src/presentation/syntax_highlighting_controller.dart';
import 'package:kode_view/src/presentation/text_selection_options.dart';

class CodeEditText extends StatefulWidget {
const CodeEditText({
required this.code,

// Core functionality
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even this is a nice segregation, this can lead to problems with linting and formatting, please order params by conceptual groups but remove the comments

final Color? lineNumberColor;
final TextStyle? textStyle;
final Widget child;
@override
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space

import 'package:flutter/material.dart';
import 'package:kode_view/src/presentation/styles/text_styles.dart';

class LineNumbersWrapper extends StatelessWidget {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant idea to use wrapper for that!

if (enableLineNumbers) ...[
Container(
color: lineNumberBackgroundColor,
width: 40,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have default spacings, but also enable customization. What about line 11111? This will overflow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants