Disable code line number in code block by default (#1471)
* Disable code line number in code block by default * Fix analysis issues * Change blocks to element * ...pull/1470/head^2
parent
8149e2b2d1
commit
c2156dc3cc
7 changed files with 85 additions and 8 deletions
@ -0,0 +1,19 @@ |
||||
import 'package:equatable/equatable.dart'; |
||||
import 'package:flutter/foundation.dart' show immutable; |
||||
|
||||
import 'elements/code_block.dart'; |
||||
|
||||
export 'elements/code_block.dart'; |
||||
|
||||
@immutable |
||||
class QuillEditorElementOptions extends Equatable { |
||||
const QuillEditorElementOptions({ |
||||
this.code = const QuillEditorCodeBlockElementOptions(), |
||||
}); |
||||
|
||||
final QuillEditorCodeBlockElementOptions code; |
||||
@override |
||||
List<Object?> get props => [ |
||||
code, |
||||
]; |
||||
} |
@ -0,0 +1,18 @@ |
||||
import 'package:equatable/equatable.dart'; |
||||
import 'package:flutter/foundation.dart' show immutable; |
||||
|
||||
@immutable |
||||
class QuillEditorCodeBlockElementOptions extends Equatable { |
||||
const QuillEditorCodeBlockElementOptions({ |
||||
this.enableLineNumbers = false, |
||||
}); |
||||
|
||||
/// If you want line numbers in the code block, please pass true |
||||
/// by default it's false as it's not really needed in most cases |
||||
final bool enableLineNumbers; |
||||
|
||||
@override |
||||
List<Object?> get props => [ |
||||
enableLineNumbers, |
||||
]; |
||||
} |
Loading…
Reference in new issue