-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: release/0.2.0
Are you sure you want to change the base?
Conversation
@@ -45,6 +45,7 @@ class _MyAppState extends State<MyApp> { | |||
selectAll: true, | |||
share: true, | |||
), | |||
enableLineNumbers: true, |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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?
No description provided.