Skip to content

Commit ac56c11

Browse files
committed
WidgetDetail
1 parent 4951631 commit ac56c11

36 files changed

+424
-539
lines changed
File renamed without changes.

lib/src/flutter_unit.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import 'navigation/router/app_route.dart';
1818
/// 说明: 应用主程序
1919
2020
class FlutterUnit3 extends StatefulWidget {
21-
const FlutterUnit3({super.key});
21+
const FlutterUnit3({super.key});
2222

2323
@override
2424
State<FlutterUnit3> createState() => _FlutterUnit3State();
@@ -71,7 +71,7 @@ class _FlutterUnit3State extends State<FlutterUnit3> {
7171
}
7272

7373
void _initWeb() {
74-
if(!kAppEnv.isWeb)return;
74+
if (!kAppEnv.isWeb) return;
7575
GoRouter.optionURLReflectsImperativeAPIs = true;
7676
context.read<WidgetsBloc>().add(const EventTabTap(WidgetFamily.statelessWidget));
7777
}

lib/src/starter/fx_application.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class FxApplication with FxStarter<AppConfig> {
1717
const FxApplication();
1818

1919
@override
20-
Widget get app => AppBlocProvider(child: FlutterUnit3());
20+
Widget get app => const AppBlocProvider(child: FlutterUnit3());
2121

2222
@override
2323
AppStartRepository<AppConfig> get repository => const FlutterUnitStartRepo();

lib/src/starter/start_repository.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
88
import 'package:fx_boot_starter/fx_boot_starter.dart';
99
import 'package:connectivity_plus/connectivity_plus.dart';
1010
import 'package:flutter/services.dart';
11+
import 'package:fx_dio/fx_dio.dart';
1112
import 'package:shared_preferences/shared_preferences.dart';
1213
import 'package:storage/storage.dart';
1314
import 'package:path/path.dart' as path;
@@ -26,6 +27,9 @@ class FlutterUnitStartRepo implements AppStartRepository<AppConfig> {
2627
WindowSizeAdapter.setSize();
2728
// throw 'Test Debug Start Error';
2829
await SpStorage.instance.initSp();
30+
31+
FxDio().register([const UnitHost()]);
32+
2933
if (!kAppEnv.isWeb) await initDb();
3034
HttpUtil.instance.rebase(PathUnit.baseUrl);
3135
AppConfigPo po = await SpStorage.instance.appConfig.read();

modules/basic_system/app/lib/app.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ export 'app_config/app_config.dart';
2424

2525
export 'app/action/action.dart';
2626
export 'app/router/app_route.dart';
27-
export 'view/view.dart';
27+
export 'view/view.dart';
28+
export 'app/host/unit_host.dart';

modules/basic_system/app/lib/app/cons/cons.dart

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import '../res/toly_icon.dart';
99

1010
class Cons {
1111

12-
static const menuInfo = <String>["关于", "帮助", "问题反馈"]; //菜单栏
13-
1412
static const List<Color> tabColors = [
1513
Color(0xff44D1FD),
1614
Color(0xffFD4F43),
@@ -21,22 +19,7 @@ class Cons {
2119
Color(0xFFDBD83F),
2220
];
2321

24-
static const tabs = <String>[
25-
'Stles',
26-
'Stful',
27-
'Scrow',
28-
'Mcrow',
29-
'Sliver',
30-
'Proxy',
31-
'Other'
32-
]; //标题列表
33-
34-
static const iconMap = {
35-
//底栏图标
36-
"组件集录": TolyIcon.icon_layout, "收藏集录": TolyIcon.icon_star,
37-
"绘制集录": Icons.palette, "布局集录": Icons.widgets,
38-
"要点集录": TolyIcon.icon_bug,
39-
};
22+
4023

4124
static const List<String> kFontFamilySupport = [
4225
'local',
@@ -66,30 +49,6 @@ class Cons {
6649
HighlighterStyle.fromColors(HighlighterStyle.solarized):"cst - Power By cst",
6750
};
6851

69-
70-
// static final kThemeColorSupport = <MaterialColor, String>{
71-
// Colors.red: "毁灭之红",
72-
// Colors.orange: "愤怒之橙",
73-
// Colors.yellow: "警告之黄",
74-
// Colors.green: "伪装之绿",
75-
// Colors.blue: "冷漠之蓝",
76-
// Colors.indigo: "无限之靛",
77-
// Colors.purple: "神秘之紫",
78-
//
79-
// const MaterialColor(0xff2D2D2D, <int, Color>{
80-
// 50: Color(0xFF8A8A8A),
81-
// 100: Color(0xFF747474),
82-
// 200: Color(0xFF616161),
83-
// 300: Color(0xFF484848),
84-
// 400: Color(0xFF3D3D3D),
85-
// 500: Color(0xff2D2D2D),
86-
// 600: Color(0xFF252525),
87-
// 700: Color(0xFF141414),
88-
// 800: Color(0xFF050505),
89-
// 900: Color(0xff000000),
90-
// }): "归宿之黑"
91-
// };
92-
9352
}
9453

9554
enum ThemeColor {
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import 'package:fx_dio/fx_dio.dart';
2+
3+
class UnitHost extends Host {
4+
const UnitHost();
5+
6+
@override
7+
Map<HostEnv, String> get value => {
8+
HostEnv.release: 'api.toly1994.com',
9+
};
10+
11+
@override
12+
HostConfig get config => const HostConfig(
13+
scheme: 'http',
14+
port: 8080,
15+
apiNest: '/api/v1',
16+
);
17+
18+
@override
19+
HostEnv get env => HostEnv.release;
20+
}
21+
22+
enum UnitApi {
23+
hello("/hello"),
24+
25+
repository("/repository/name/FlutterUnit"),
26+
point("/point"),
27+
pointComment("/pointComment/"),
28+
;
29+
30+
final String path;
31+
final Method? method;
32+
33+
const UnitApi(this.path, [this.method = Method.get]);
34+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export 'point_comment_bloc.dart';
2+
export 'point_bloc.dart';
3+
4+
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import 'package:flutter_bloc/flutter_bloc.dart';
2+
3+
import '../repository/api/point_api.dart';
4+
import 'package:equatable/equatable.dart';
5+
import '../data/model/issue.dart';
6+
7+
/// create by 张风捷特烈 on 2020-09-03
8+
/// contact me by email [email protected]
9+
/// 说明:
10+
11+
class PointBloc extends Cubit<PointState> {
12+
final PointApi api;
13+
14+
PointBloc(this.api) : super(const PointLoading());
15+
16+
void loadPoint() async {
17+
emit(const PointLoading());
18+
try {
19+
final issues = await api.getIssues();
20+
emit(PointLoaded(issues));
21+
} catch (err) {
22+
print(err);
23+
emit(PointLoadFailure(err.toString()));
24+
}
25+
}
26+
}
27+
28+
sealed class PointState extends Equatable {
29+
const PointState();
30+
}
31+
32+
class PointLoading extends PointState {
33+
const PointLoading();
34+
35+
@override
36+
List<Object> get props => [];
37+
}
38+
39+
class PointLoaded extends PointState {
40+
final List<Issue> issues;
41+
42+
const PointLoaded(this.issues);
43+
44+
@override
45+
List<Object> get props => [issues];
46+
}
47+
48+
class PointLoadFailure extends PointState {
49+
final String error;
50+
51+
const PointLoadFailure(this.error);
52+
53+
@override
54+
List<Object> get props => [error];
55+
}

modules/knowledge_system/artifact/lib/src/points/bloc/point_bloc/point_bloc.dart

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)