You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
822 B
36 lines
822 B
2 months ago
|
import 'package:flutter/material.dart';
|
||
|
import 'package:provider/provider.dart';
|
||
|
import 'package:win_text_editor/app/core/tab_manager.dart';
|
||
|
|
||
|
abstract class BaseView extends StatefulWidget {
|
||
|
final String tabId;
|
||
|
|
||
|
const BaseView({super.key, required this.tabId});
|
||
|
|
||
|
@override
|
||
|
State<BaseView> createState() => BaseViewState();
|
||
|
|
||
|
// 打开文件夹回调
|
||
|
void openFolder(String folderPath);
|
||
|
|
||
|
// 打开文件回调
|
||
|
void openFile(String filePath);
|
||
|
}
|
||
|
|
||
|
class BaseViewState extends State<BaseView> {
|
||
|
late TabManager _tabManager;
|
||
|
|
||
|
TabManager get tabManager => _tabManager;
|
||
|
|
||
|
@override
|
||
|
void initState() {
|
||
|
super.initState();
|
||
|
_tabManager = Provider.of<TabManager>(context, listen: false);
|
||
|
}
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Container(); // 具体实现由子类完成
|
||
|
}
|
||
|
}
|