Skip to content

Commit b41dce7

Browse files
committed
宝具准备
1 parent b801827 commit b41dce7

Some content is hidden

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

52 files changed

+2214
-481
lines changed

assets/iconfont/toly_icon.ttf

868 Bytes
Binary file not shown.

lib/app/navigation/pure_bottom_bar.dart

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
33

44
typedef IndexTapCallback = void Function(int);
55
typedef IndexLongTapCallback = void Function(BuildContext, int);
6+
67
class PureBottomBar extends StatefulWidget {
78
final int initPosition;
89

@@ -11,33 +12,36 @@ class PureBottomBar extends StatefulWidget {
1112

1213
// item 长按事件
1314
final IndexLongTapCallback? onItemLongTap;
14-
const PureBottomBar({Key? key, this.onItemTap,this.onItemLongTap,this.initPosition=0}) : super(key: key);
15+
const PureBottomBar(
16+
{Key? key, this.onItemTap, this.onItemLongTap, this.initPosition = 0})
17+
: super(key: key);
1518

1619
@override
1720
State<PureBottomBar> createState() => _PureBottomBarState();
1821
}
1922

2023
class _PureBottomBarState extends State<PureBottomBar> {
21-
List<String> get bottomBar => const['组件','绘制', '收藏','我的'];
24+
List<String> get bottomBar => const ['组件', '绘制',
25+
// '宝具',
26+
'收藏', '我的'];
2227

23-
List<IconData> get bottomBarIcon => const[
24-
TolyIcon.icon_layout,
25-
TolyIcon.dingzhi1,
28+
List<IconData> get bottomBarIcon => const [
29+
TolyIcon.icon_layout,
30+
TolyIcon.dingzhi1,
31+
// TolyIcon.icon_artifact,
2632
TolyIcon.icon_collect,
27-
TolyIcon.yonghu,
28-
];
33+
TolyIcon.yonghu,
34+
];
2935
int _position = 0;
3036

3137
@override
3238
void initState() {
3339
super.initState();
3440
_position = widget.initPosition;
35-
3641
}
3742

3843
@override
3944
Widget build(BuildContext context) {
40-
4145
return Wrap(
4246
children: [
4347
// Divider(height: 1,),
@@ -49,7 +53,6 @@ class _PureBottomBarState extends State<PureBottomBar> {
4953

5054
widget.onItemTap?.call(_position);
5155
setState(() {
52-
5356
// _controller.jumpToPage(_position);
5457
});
5558
},
@@ -64,7 +67,12 @@ class _PureBottomBarState extends State<PureBottomBar> {
6467
showUnselectedLabels: true,
6568
showSelectedLabels: true,
6669
// backgroundColor: themeColor.itemColor,
67-
items: bottomBar.asMap().keys.map((index) => BottomNavigationBarItem(label: bottomBar[index], icon: Icon(bottomBarIcon[index]))).toList(),
70+
items: bottomBar
71+
.asMap()
72+
.keys
73+
.map((index) => BottomNavigationBarItem(
74+
label: bottomBar[index], icon: Icon(bottomBarIcon[index])))
75+
.toList(),
6876
),
6977
],
7078
);

lib/app/navigation/unit_navigation.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'dart:io';
22

33
import 'package:app/app.dart';
44
import 'package:app_update/app_update.dart';
5+
import 'package:artifact/artifact.dart';
56
import 'package:authentication/authentication.dart';
67
import 'package:flutter/material.dart';
78
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -11,6 +12,7 @@ import 'package:flutter_unit/widget_ui/mobile/category_page/home_right_drawer.da
1112
import 'package:widget_module/blocs/blocs.dart';
1213
import 'package:flutter_unit/widget_ui/mobile/widget_panel/standard_home_page.dart';
1314

15+
1416
import 'pure_bottom_bar.dart';
1517
import 'desk_ui/unit_desk_navigation.dart';
1618

@@ -76,6 +78,7 @@ class _UnitPhoneNavigationState extends State<UnitPhoneNavigation> {
7678
children: [
7779
StandardHomePage(),
7880
GalleryUnit(),
81+
// ArtifactPage(),
7982
CollectPageAdapter(),
8083
UserPage(),
8184
],
@@ -114,7 +117,7 @@ class _UnitPhoneNavigationState extends State<UnitPhoneNavigation> {
114117
}
115118
}
116119

117-
if (index == 2) {
120+
if (index == 3) {
118121
BlocProvider.of<LikeWidgetBloc>(context).add(const EventLoadLikeData());
119122
}
120123
}
@@ -124,7 +127,7 @@ class _UnitPhoneNavigationState extends State<UnitPhoneNavigation> {
124127
if (index == 0) {
125128
Scaffold.of(context).openDrawer();
126129
}
127-
if (index == 3) {
130+
if (index == 4) {
128131
Scaffold.of(context).openEndDrawer();
129132
}
130133
}

lib/code_gen/icon_font_gen/gen_message_action.dart

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import 'package:app/app.dart';
22
import 'package:flutter/material.dart';
33

4-
5-
64
class GenMessageAction extends StatelessWidget {
75
final VoidCallback onGen;
86
const GenMessageAction({Key? key, required this.onGen}) : super(key: key);
@@ -12,21 +10,29 @@ class GenMessageAction extends StatelessWidget {
1210
return Row(
1311
crossAxisAlignment: CrossAxisAlignment.start,
1412
children: [
15-
Expanded(child: Text(
13+
Expanded(
14+
child: Text(
1615
'使用方式:\n1. 在 iconfont.cn 挑选图标,加入项目,下载压缩包。\n2. 选择 Flutter 项目地址,配置资源、产物文件位置。\n3. 点击生成代码按钮,即可生成相关代码。',
1716
style: TextStyle(
18-
color: Theme.of(context).primaryColor,fontWeight: FontWeight.bold),)),
17+
color: Theme.of(context).primaryColor,
18+
fontWeight: FontWeight.bold),
19+
)),
1920
ElevatedButton(
2021
style: ElevatedButton.styleFrom(
21-
elevation: 0,
22-
shape: const StadiumBorder()
23-
),
24-
onPressed:onGen, child: Wrap(
25-
crossAxisAlignment: WrapCrossAlignment.center,
26-
spacing: 4,
22+
elevation: 0, shape: const StadiumBorder()),
23+
onPressed: onGen,
24+
child: Wrap(
25+
crossAxisAlignment: WrapCrossAlignment.center,
26+
spacing: 4,
2727
children: [
28-
Icon(TolyIcon.icon_fast,size: 16,),
29-
const Text('生成代码',style: TextStyle(height: 1,fontSize: 12),),
28+
Icon(
29+
TolyIcon.icon_fast,
30+
size: 16,
31+
),
32+
const Text(
33+
'生成代码',
34+
style: TextStyle(height: 1.1, fontSize: 12),
35+
),
3036
],
3137
)),
3238
],

lib/code_gen/icon_font_gen/icon_font_class_parser.dart

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -107,38 +107,4 @@ class $fontFamily {
107107
pubspecFile.writeAsStringSync(lines.join('\n'));
108108
}
109109
}
110-
111-
// // 修改 pubspec.yaml
112-
// void setYaml(IconFontGenConfig config){
113-
// String fontFamily = config.fontFamily;
114-
// String assets = config.assetsDist.replaceAll('\\', '/');
115-
//
116-
// final String filePath = path.join(config.projectPath,'pubspec.yaml');
117-
// File pubspecFile = File(filePath);
118-
// final String pubspec = pubspecFile.readAsStringSync();
119-
// final doc = loadYaml(pubspec);
120-
// final modifiableDoc = getModifiableNode(doc);
121-
//
122-
// YamlList? fontsList = doc['flutter']['fonts'] as YamlList?;
123-
// if(fontsList == null){
124-
// // 新文件,没有配置 fonts 节点
125-
// modifiableDoc['flutter']['fonts'] = YamlMap.wrap({
126-
// 'family': fontFamily,
127-
// 'fonts':YamlList.wrap([YamlMap.wrap({'asset':'$assets/iconfont.ttf'})])
128-
// });
129-
// }else{
130-
// final modifiableList = getModifiableNode(fontsList);
131-
// modifiableList.removeWhere((e) => e['family'] == fontFamily);
132-
// modifiableList.add(
133-
// YamlMap.wrap({
134-
// 'family': fontFamily,
135-
// 'fonts':YamlList.wrap([YamlMap.wrap({'asset':'$assets/iconfont.ttf'})])
136-
// })
137-
// );
138-
// modifiableDoc['flutter']['fonts'] = modifiableList;
139-
// }
140-
// final targetYaml = toYamlString(modifiableDoc);
141-
// pubspecFile.writeAsStringSync(targetYaml);
142-
// }
143-
144110
}

lib/code_gen/icon_font_gen/icon_font_gen_page.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ class FileSelectorInput extends StatelessWidget {
274274
}
275275

276276
void _showSelectFile() async {
277-
print("=======_showSelectFile=============");
278277
String? path;
279278
if (pickerDir) {
280279
path = await FilePicker.platform.getDirectoryPath();

lib/widget_ui/mobile/widget_panel/standard_home_page.dart

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,23 @@ class _StandardHomePageState extends State<StandardHomePage>
6464
child: NestedScrollView(
6565
floatHeaderSlivers: true,
6666
headerSliverBuilder: _buildHeader,
67-
body: TabBarView(
68-
physics: const NeverScrollableScrollPhysics(),
69-
controller: tabController,
70-
children: _tabs.map(buildScrollPage).toList(),
71-
),
67+
body: Builder(
68+
builder:(ctx)=> CustomScrollView(
69+
// key: PageStorageKey<String>(name),
70+
slivers: <Widget>[
71+
SliverOverlapInjector(
72+
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(ctx),
73+
),
74+
const WidgetListPanel(),
75+
SliverPadding(
76+
padding: const EdgeInsets.only(bottom: 30),
77+
sliver: SliverOverlapInjector(
78+
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(ctx),
79+
),
80+
),
81+
],
82+
),
83+
)
7284
),
7385
),
7486
],

lib/widget_ui/mobile/widget_panel/widget_model_item.dart

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,16 @@ class StandardWidgetItem extends StatelessWidget {
4949
return Row(
5050
children: [
5151
if (searchArg == null)
52-
Text(
53-
model.name,
54-
style: TextStyle(
55-
fontSize: 16,
56-
color: textColor,
57-
fontWeight: FontWeight.bold,
52+
Expanded(
53+
child: Text(
54+
model.name,
55+
maxLines: 1,
56+
overflow: TextOverflow.ellipsis,
57+
style: TextStyle(
58+
fontSize: 16,
59+
color: textColor,
60+
fontWeight: FontWeight.bold,
61+
),
5862
),
5963
),
6064
if (searchArg != null) Text.rich(formSpan(model.name, searchArg!)),
@@ -85,7 +89,6 @@ class StandardWidgetItem extends StatelessWidget {
8589
),
8690
);
8791
}),
88-
const Spacer(),
8992
StarScore(
9093
star: Star(emptyColor: Colors.white, size: 12, fillColor: color),
9194
score: model.lever,

packages/app/lib/app/res/toly_icon.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import 'package:flutter/widgets.dart';
33
// 欢迎支持: https://github.com/toly1994328/FlutterUnit
44
class TolyIcon {
55
TolyIcon._();
6-
static const IconData dark = IconData(0xe72f, fontFamily: "TolyIcon");
6+
static const IconData icon_artifact = IconData(0xe726, fontFamily: "TolyIcon");
7+
static const IconData dark = IconData(0xe72f, fontFamily: "TolyIcon");
78
static const IconData wb_sunny = IconData(0xe746, fontFamily: "TolyIcon");
89
static const IconData icon_fast = IconData(0xe607, fontFamily: "TolyIcon");
910
static const IconData icon_layout = IconData(0xe85e, fontFamily: "TolyIcon");

packages/app/lib/app/theme/app_theme.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ class AppTheme {
6666
primaryColor: state.themeColor,
6767
scaffoldBackgroundColor: Color(0xffF3F4F6),
6868
useMaterial3: useMaterial3,
69-
tabBarTheme: TabBarTheme(
70-
dividerColor: Colors.transparent,
71-
),
7269
// Android 使用 Material3
7370
chipTheme: ChipThemeData(padding: EdgeInsets.symmetric(horizontal: 10)),
7471
listTileTheme: ListTileThemeData(
@@ -79,6 +76,15 @@ class AppTheme {
7976
space: px1,
8077
thickness: px1,
8178
),
79+
tabBarTheme: TabBarTheme(
80+
dividerColor: Colors.transparent,
81+
splashFactory: NoSplash.splashFactory,
82+
overlayColor: MaterialStateProperty.resolveWith<Color?>(
83+
(Set<MaterialState> states) {
84+
return states.contains(MaterialState.focused) ? null : Colors.transparent;
85+
},
86+
),
87+
),
8288
bottomNavigationBarTheme: const BottomNavigationBarThemeData(
8389
backgroundColor: Colors.white),
8490
appBarTheme: AppBarTheme(

0 commit comments

Comments
 (0)