diff --git a/README.md b/README.md index 378b87b..5da2381 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,10 @@ > 当前Flutter 版本 ``` -Flutter 2.10.5 • channel stable • https://github.com/flutter/flutter.git -Framework • revision 5464c5bac7 (10 days ago) • 2022-04-18 09:55:37 -0700 -Engine • revision 57d3bac3dd -Tools • Dart 2.16.2 • DevTools 2.9.2 +Flutter 3.0.0 • channel stable • https://github.com/flutter/flutter.git +Framework • revision ee4e09cce0 (10 days ago) • 2022-05-09 16:45:18 -0700 +Engine • revision d1b9a6938a +Tools • Dart 2.17.0 • DevTools 2.12.2 ``` --- diff --git a/android/build.gradle b/android/build.gradle index c45f25c..ba6fe4a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.5.31' + ext.kotlin_version = '1.6.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:7.1.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index bc6a58a..55be929 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip + diff --git a/assets/flutter.db b/assets/flutter.db index d1d5b44..14e76ed 100644 Binary files a/assets/flutter.db and b/assets/flutter.db differ diff --git a/lib/components/project/items/widget/coupon_widget_list_item.dart b/lib/components/project/items/widget/coupon_widget_list_item.dart index 2a511a8..13f36e4 100644 --- a/lib/components/project/items/widget/coupon_widget_list_item.dart +++ b/lib/components/project/items/widget/coupon_widget_list_item.dart @@ -48,7 +48,7 @@ class CouponWidgetListItem extends StatelessWidget { } Widget buildContent() => Container( - color: colors[data.family.index].withAlpha(66), + color: data.death?Colors.grey:colors[data.family.index].withAlpha(66), height: 95, padding: const EdgeInsets.only(top: 10, left: 10, right: 10, bottom: 5), child: Row( diff --git a/lib/components/project/items/widget/techno_widget_list_item.dart b/lib/components/project/items/widget/techno_widget_list_item.dart index 79983df..e4af5d1 100644 --- a/lib/components/project/items/widget/techno_widget_list_item.dart +++ b/lib/components/project/items/widget/techno_widget_list_item.dart @@ -104,7 +104,8 @@ class TechnoWidgetListItem extends StatelessWidget { ), ); - Color get itemColor => Cons.tabColors[data.family.index]; + Color get itemColor => data.death?Colors.grey:Cons.tabColors[data.family.index]; + Widget _buildTitle() { return Row( diff --git a/lib/components/project/overlay_tool_wrapper.dart b/lib/components/project/overlay_tool_wrapper.dart index 35e6638..9712bb8 100644 --- a/lib/components/project/overlay_tool_wrapper.dart +++ b/lib/components/project/overlay_tool_wrapper.dart @@ -60,7 +60,7 @@ class OverlayToolWrapperState extends State vsync: this, )..addListener(_listenAnimate); - WidgetsBinding.instance?.addPostFrameCallback((callback) { + WidgetsBinding.instance.addPostFrameCallback((callback) { var px = MediaQuery.of(context).size.width - 100; var py = MediaQuery.of(context).size.height*0.05; offset = Offset(px, py); diff --git a/lib/components/project/widget_node_panel.dart b/lib/components/project/widget_node_panel.dart index eba4f36..18e0f37 100644 --- a/lib/components/project/widget_node_panel.dart +++ b/lib/components/project/widget_node_panel.dart @@ -22,11 +22,13 @@ class WidgetNodePanel extends StatefulWidget { final Widget? show; final HighlighterStyle? codeStyle; final String? codeFamily; + final bool death; const WidgetNodePanel( {Key? key, this.text='', this.subText='', this.code='', + this.death=false, this.show, required this.codeStyle, this.codeFamily}) : super(key: key); @@ -58,6 +60,7 @@ class _WidgetNodePanelState extends State { padding: const EdgeInsets.only(top: 10, bottom: 20), child: widget.show, ), + if(!widget.death) _buildNodeInfo(), const Divider(), ], diff --git a/lib/main.dart b/lib/main.dart index e5a60f0..67910e6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -8,7 +8,7 @@ import 'app/views/navigation/flutter_unit.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); //滚动性能优化 1.22.0 - GestureBinding.instance?.resamplingEnabled = true; + GestureBinding.instance.resamplingEnabled = true; runApp(const BlocWrapper(child: FlutterUnit())); } diff --git a/lib/painter_system/gallery_unit.dart b/lib/painter_system/gallery_unit.dart index b669be0..461b784 100644 --- a/lib/painter_system/gallery_unit.dart +++ b/lib/painter_system/gallery_unit.dart @@ -68,10 +68,9 @@ class _GalleryUnitState extends State { @override Widget build(BuildContext context) { - return Scaffold( body: ValueListenableBuilder( - child: Column( //使用 child 属性优化 + child: Column( children: [ _buildTitle(context), Expanded( diff --git a/lib/widget_system/repositories/model/widget_model.dart b/lib/widget_system/repositories/model/widget_model.dart index 0e08fef..8c4756c 100644 --- a/lib/widget_system/repositories/model/widget_model.dart +++ b/lib/widget_system/repositories/model/widget_model.dart @@ -18,6 +18,7 @@ class WidgetModel extends Equatable { final String nameCN; final WidgetFamily family; final bool deprecated; + final bool death; final List links; final double lever; final ImageProvider? image; @@ -32,6 +33,7 @@ class WidgetModel extends Equatable { required this.nameCN, required this.family, this.deprecated =false, + this.death =false, required this.links, // required this.type, required this.lever, @@ -50,6 +52,7 @@ class WidgetModel extends Equatable { image: convertImage(po.name), lever: po.lever, deprecated: po.deprecated == 1, + death: po.deprecated == -1, info: po.info, links: formatLinkTo(po.linkWidget), ); diff --git a/lib/widget_system/views/widget_detail_view/widget_detail_page.dart b/lib/widget_system/views/widget_detail_view/widget_detail_page.dart index 8c2b536..51bbd4f 100644 --- a/lib/widget_system/views/widget_detail_view/widget_detail_page.dart +++ b/lib/widget_system/views/widget_detail_view/widget_detail_page.dart @@ -211,6 +211,7 @@ class _WidgetDetailPageState extends State { text: nodes[i].name, subText: nodes[i].subtitle, code: nodes[i].code, + death: _modelStack.last.death, show: WidgetsMap.map(name)[i], ), childCount: nodes.length, diff --git a/lib/widget_system/views/widget_home_view/home_page.dart b/lib/widget_system/views/widget_home_view/home_page.dart index 4fed903..19142d6 100644 --- a/lib/widget_system/views/widget_home_view/home_page.dart +++ b/lib/widget_system/views/widget_home_view/home_page.dart @@ -33,7 +33,7 @@ class _HomePageState extends State @override void initState() { super.initState(); - WidgetsBinding.instance?.addPostFrameCallback(_onFrameCallBack); + WidgetsBinding.instance.addPostFrameCallback(_onFrameCallBack); } void _onFrameCallBack(Duration timeStamp) { diff --git a/lib/widget_system/widgets/ProxyWidget/ButtonBarTheme/node1_base.dart b/lib/widget_system/widgets/ProxyWidget/ButtonBarTheme/node1_base.dart index b800292..b2483fa 100644 --- a/lib/widget_system/widgets/ProxyWidget/ButtonBarTheme/node1_base.dart +++ b/lib/widget_system/widgets/ProxyWidget/ButtonBarTheme/node1_base.dart @@ -37,7 +37,7 @@ class TempButtonBar extends StatelessWidget { children: [ RaisedButton( color: Colors.blue, child: const Text("1.Raised"), onPressed: () {}), - OutlineButton(child: const Text("2.Outline"), onPressed: () {}), + OutlinedButton(child: const Text("2.Outlined"), onPressed: () {}), FlatButton( color: Colors.blue, onPressed: () {}, diff --git a/lib/widget_system/widgets/ProxyWidget/ButtonTheme/node1_base.dart b/lib/widget_system/widgets/ProxyWidget/ButtonTheme/node1_base.dart index d6f6d35..1119d82 100644 --- a/lib/widget_system/widgets/ProxyWidget/ButtonTheme/node1_base.dart +++ b/lib/widget_system/widgets/ProxyWidget/ButtonTheme/node1_base.dart @@ -30,7 +30,7 @@ class ButtonThemeDemo extends StatelessWidget { children: [ RaisedButton(onPressed: (){},child: const Icon(Icons.add)), FlatButton(onPressed: (){},child: const Icon(Icons.add)), - OutlineButton(onPressed: (){},child: const Icon(Icons.add)), + OutlinedButton(onPressed: (){},child: const Icon(Icons.add)), MaterialButton(onPressed: (){},child: const Icon(Icons.add)), ], ), diff --git a/lib/widget_system/widgets/StatefulWidget/MonthPicker/node1_base.dart b/lib/widget_system/widgets/StatefulWidget/MonthPicker/node1_base.dart index dbc8193..af9d365 100644 --- a/lib/widget_system/widgets/StatefulWidget/MonthPicker/node1_base.dart +++ b/lib/widget_system/widgets/StatefulWidget/MonthPicker/node1_base.dart @@ -12,26 +12,34 @@ import 'package:flutter/material.dart'; // "【lastDate】 : 最后日期限制 【DateTime】\n" // "【onChanged】 : 点击回调 【Function(DateTime)】", // } -class CustomMonthPicker extends StatefulWidget { +class CustomMonthPicker extends StatelessWidget{ const CustomMonthPicker({Key? key}) : super(key: key); - @override - _CustomMonthPickerState createState() => _CustomMonthPickerState(); -} - -class _CustomMonthPickerState extends State { - DateTime _date = DateTime.now(); + final String info = + 'MonthPicker 月份期选择器于 Flutter3.0 退出历史舞台。取代者为 CalendarDatePicker 日历选择器。'; @override Widget build(BuildContext context) { - return SizedBox( - height: 350, - child: MonthPicker( - selectedDate: _date, - onChanged: (date) => setState(() => _date = date), - firstDate: DateTime(2018), - lastDate: DateTime(2030), - ), + return Container( + color: Colors.blue.withOpacity(0.1), + padding: const EdgeInsets.all(10), + margin: const EdgeInsets.all(10), + child: Text(info), ); } + + // final DateTime _date = DateTime.now(); + // + // @override + // Widget build(BuildContext context) { + // return SizedBox( + // height: 350, + // child: MonthPicker( + // selectedDate: _date, + // onChanged: (date) => setState(() => _date = date), + // firstDate: DateTime(2018), + // lastDate: DateTime(2030), + // ), + // ); + // } } diff --git a/lib/widget_system/widgets/StatelessWidget/ButtonBar/node1_base.dart b/lib/widget_system/widgets/StatelessWidget/ButtonBar/node1_base.dart index 0eb070c..0d4dba8 100755 --- a/lib/widget_system/widgets/StatelessWidget/ButtonBar/node1_base.dart +++ b/lib/widget_system/widgets/StatelessWidget/ButtonBar/node1_base.dart @@ -25,8 +25,8 @@ class CustomButtonBar extends StatelessWidget { color: Colors.blue, child: const Text("Raised"), onPressed: () => DialogAbout.show(context)), - OutlineButton( - child: const Text("Outline"), + OutlinedButton( + child: const Text("Outlined"), onPressed: () => DialogAbout.show(context)), FlatButton( color: Colors.blue, diff --git a/lib/widget_system/widgets/StatelessWidget/ButtonBar/node2_padding.dart b/lib/widget_system/widgets/StatelessWidget/ButtonBar/node2_padding.dart index f35dca3..b94b96a 100644 --- a/lib/widget_system/widgets/StatelessWidget/ButtonBar/node2_padding.dart +++ b/lib/widget_system/widgets/StatelessWidget/ButtonBar/node2_padding.dart @@ -26,8 +26,8 @@ class PaddingButtonBar extends StatelessWidget { color: Colors.blue, child: const Text("Raised"), onPressed: () => DialogAbout.show(context)), - OutlineButton( - child: const Text("Outline"), + OutlinedButton( + child: const Text("Outlined"), onPressed: () => DialogAbout.show(context)), FlatButton( color: Colors.blue, diff --git a/lib/widget_system/widgets/StatelessWidget/DayPicker/node1_base.dart b/lib/widget_system/widgets/StatelessWidget/DayPicker/node1_base.dart index 67958ca..5fc1293 100644 --- a/lib/widget_system/widgets/StatelessWidget/DayPicker/node1_base.dart +++ b/lib/widget_system/widgets/StatelessWidget/DayPicker/node1_base.dart @@ -17,29 +17,37 @@ // } import 'package:flutter/material.dart'; -class CustomDayPicker extends StatefulWidget { +class CustomDayPicker extends StatelessWidget{ + const CustomDayPicker({Key? key}) : super(key: key); - @override - _CustomDayPickerState createState() => _CustomDayPickerState(); -} - -class _CustomDayPickerState extends State { - - DateTime _date = DateTime.now(); + final String info = + 'DayPicker 日期选择器于 Flutter3.0 退出历史舞台。取代者为 CalendarDatePicker 日历选择器。'; @override Widget build(BuildContext context) { - return SizedBox( - height: 350, - child: DayPicker( - selectedDate: _date, - currentDate: DateTime.now(), - onChanged: (date)=> setState(() => _date = date), - firstDate: DateTime(2018), - lastDate: DateTime(2030), - displayedMonth: DateTime.now() - ), + return Container( + color: Colors.blue.withOpacity(0.1), + padding: const EdgeInsets.all(10), + margin: const EdgeInsets.all(10), + child: Text(info), ); } + + // final DateTime _date = DateTime.now(); + // + // @override + // Widget build(BuildContext context) { + // return SizedBox( + // height: 350, + // child: DayPicker( + // selectedDate: _date, + // currentDate: DateTime.now(), + // onChanged: (date)=> setState(() => _date = date), + // firstDate: DateTime(2018), + // lastDate: DateTime(2030), + // displayedMonth: DateTime.now() + // ), + // ); + // } } diff --git a/lib/widget_system/widgets/StatelessWidget/OutlineButton/node1_base.dart b/lib/widget_system/widgets/StatelessWidget/OutlineButton/node1_base.dart index 1b6a48a..bba68e8 100755 --- a/lib/widget_system/widgets/StatelessWidget/OutlineButton/node1_base.dart +++ b/lib/widget_system/widgets/StatelessWidget/OutlineButton/node1_base.dart @@ -20,17 +20,30 @@ import 'package:flutter/material.dart'; class CustomOutlineButton extends StatelessWidget { const CustomOutlineButton({Key? key}) : super(key: key); + final String info = + 'OutlineButton 按钮于 Flutter3.0 退出历史舞台。取代者为 OutlinedButton 按钮。'; + @override Widget build(BuildContext context) { - return OutlineButton(//边线按钮 - onPressed: () {}, - child: const Text("OutlineButton"), - padding: const EdgeInsets.all(8), - splashColor: Colors.green, - highlightColor: Colors.orangeAccent, - highlightedBorderColor: Colors.grey, - textColor: const Color(0xff000000), - borderSide: const BorderSide(color: Color(0xff0A66F8), width: 2), + return Container( + color: Colors.blue.withOpacity(0.1), + padding: const EdgeInsets.all(10), + margin: const EdgeInsets.all(10), + child: Text(info), ); } + + // @override + // Widget build(BuildContext context) { + // return OutlineButton(//边线按钮 + // onPressed: () {}, + // child: const Text("OutlineButton"), + // padding: const EdgeInsets.all(8), + // splashColor: Colors.green, + // highlightColor: Colors.orangeAccent, + // highlightedBorderColor: Colors.grey, + // textColor: const Color(0xff000000), + // borderSide: const BorderSide(color: Color(0xff0A66F8), width: 2), + // ); + // } } diff --git a/pubspec.lock b/pubspec.lock index 1879f88..1147254 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -63,7 +63,7 @@ packages: name: collection url: "https://pub.flutter-io.cn" source: hosted - version: "1.15.0" + version: "1.16.0" crypto: dependency: transitive description: @@ -105,7 +105,7 @@ packages: name: fake_async url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0" + version: "1.3.0" ffi: dependency: transitive description: @@ -204,7 +204,7 @@ packages: name: js url: "https://pub.flutter-io.cn" source: hosted - version: "0.6.3" + version: "0.6.4" jwt_decoder: dependency: "direct main" description: @@ -239,7 +239,7 @@ packages: name: material_color_utilities url: "https://pub.flutter-io.cn" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -309,7 +309,7 @@ packages: name: path url: "https://pub.flutter-io.cn" source: hosted - version: "1.8.0" + version: "1.8.1" path_provider: dependency: "direct main" description: @@ -510,7 +510,7 @@ packages: name: source_span url: "https://pub.flutter-io.cn" source: hosted - version: "1.8.1" + version: "1.8.2" sqflite: dependency: "direct main" description: @@ -573,7 +573,7 @@ packages: name: test_api url: "https://pub.flutter-io.cn" source: hosted - version: "0.4.8" + version: "0.4.9" toggle_rotate: dependency: "direct main" description: @@ -650,7 +650,7 @@ packages: name: vector_math url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.1" + version: "2.1.2" win32: dependency: transitive description: @@ -680,5 +680,5 @@ packages: source: hosted version: "5.3.1" sdks: - dart: ">=2.15.0 <3.0.0" + dart: ">=2.17.0-0 <3.0.0" flutter: ">=2.8.0" diff --git a/pubspec.yaml b/pubspec.yaml index d9da893..f766939 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ author: 张风捷特烈 <1981462002@qq.com> homepage: https://juejin.cn/user/149189281194766/posts environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.12.0 <=3.0.0" dependencies: flutter: