Skip to content

Commit ea935ed

Browse files
[Clones] - Setup clones directory (#2662)
1 parent 37d4f8f commit ea935ed

File tree

525 files changed

+9128
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

525 files changed

+9128
-1
lines changed
File renamed without changes.

super_clones/bear/.metadata

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3"
8+
channel: "stable"
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
17+
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
18+
- platform: macos
19+
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
20+
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

super_clones/bear/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# bear
2+
3+
A new Flutter project.
4+
5+
## Getting Started
6+
7+
This project is a starting point for a Flutter application.
8+
9+
A few resources to get you started if this is your first Flutter project:
10+
11+
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12+
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13+
14+
For help getting started with Flutter development, view the
15+
[online documentation](https://docs.flutter.dev/), which offers tutorials,
16+
samples, guidance on mobile development, and a full API reference.
File renamed without changes.

super_clones/bear/lib/app.dart

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import 'package:bear/features/home_screen.dart';
2+
import 'package:flutter/material.dart';
3+
4+
class DashApp extends StatelessWidget {
5+
const DashApp({super.key});
6+
7+
@override
8+
Widget build(BuildContext context) {
9+
return MaterialApp(
10+
title: 'Dash',
11+
theme: ThemeData(
12+
colorScheme: ColorScheme.fromSeed(seedColor: Colors.red),
13+
useMaterial3: true,
14+
),
15+
home: const HomeScreen(),
16+
debugShowCheckedModeBanner: false,
17+
);
18+
}
19+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import 'package:bear/infrastructure/editor/editor.dart';
2+
import 'package:flutter/material.dart';
3+
4+
class HomeScreen extends StatefulWidget {
5+
const HomeScreen({super.key});
6+
7+
@override
8+
State<HomeScreen> createState() => _HomeScreenState();
9+
}
10+
11+
class _HomeScreenState extends State<HomeScreen> {
12+
@override
13+
Widget build(BuildContext context) {
14+
return Scaffold(
15+
body: Row(
16+
crossAxisAlignment: CrossAxisAlignment.stretch,
17+
children: [
18+
_buildToolbar(),
19+
_buildNoteList(),
20+
_buildDivider(),
21+
Expanded(
22+
child: _buildEditor(),
23+
),
24+
],
25+
),
26+
);
27+
}
28+
29+
Widget _buildToolbar() {
30+
return Container(
31+
width: 180,
32+
color: const Color(0xFF303033),
33+
);
34+
}
35+
36+
Widget _buildNoteList() {
37+
return Container(
38+
width: 285,
39+
color: Colors.white,
40+
);
41+
}
42+
43+
Widget _buildDivider() {
44+
return Container(
45+
width: 1,
46+
color: const Color(0xFFDDDDDD),
47+
);
48+
}
49+
50+
Widget _buildEditor() {
51+
return TextEditor();
52+
}
53+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:super_editor/super_editor.dart';
3+
4+
const dashComponentBuilders = [
5+
DashListItemComponentBuilder(),
6+
...defaultComponentBuilders,
7+
];
8+
9+
class DashListItemComponentBuilder implements ComponentBuilder {
10+
const DashListItemComponentBuilder();
11+
12+
@override
13+
SingleColumnLayoutComponentViewModel? createViewModel(Document document, DocumentNode node) {
14+
if (node is! ListItemNode) {
15+
return null;
16+
}
17+
if (node.type != ListItemType.unordered) {
18+
return null;
19+
}
20+
21+
return UnorderedListItemComponentViewModel(
22+
nodeId: node.id,
23+
indent: node.indent,
24+
text: node.text,
25+
textStyleBuilder: noStyleBuilder,
26+
selectionColor: const Color(0x00000000),
27+
);
28+
}
29+
30+
@override
31+
Widget? createComponent(
32+
SingleColumnDocumentComponentContext componentContext, SingleColumnLayoutComponentViewModel componentViewModel) {
33+
if (componentViewModel is! UnorderedListItemComponentViewModel) {
34+
return null;
35+
}
36+
37+
return UnorderedListItemComponent(
38+
componentKey: componentContext.componentKey,
39+
text: componentViewModel.text,
40+
styleBuilder: componentViewModel.textStyleBuilder,
41+
indent: componentViewModel.indent,
42+
indentCalculator: (TextStyle textStyle, int indent) {
43+
return (textStyle.fontSize! * 0.60) * 3 * (indent + 1);
44+
},
45+
dotStyle: const ListItemDotStyle(
46+
color: Colors.red,
47+
size: Size(6, 6),
48+
),
49+
textSelection: componentViewModel.selection,
50+
selectionColor: componentViewModel.selectionColor,
51+
highlightWhenEmpty: componentViewModel.highlightWhenEmpty,
52+
underlines: componentViewModel.createUnderlines(),
53+
);
54+
}
55+
}

0 commit comments

Comments
 (0)