更新 Flutter 3.0.0

This commit is contained in:
toly
2022-05-20 08:35:27 +08:00
parent f73570af29
commit 5ff246c3b2
22 changed files with 109 additions and 72 deletions

View File

@@ -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
```
---

View File

@@ -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"
}
}

View File

@@ -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

Binary file not shown.

View File

@@ -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(

View File

@@ -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(

View File

@@ -60,7 +60,7 @@ class OverlayToolWrapperState extends State<OverlayToolWrapper>
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);

View File

@@ -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<WidgetNodePanel> {
padding: const EdgeInsets.only(top: 10, bottom: 20),
child: widget.show,
),
if(!widget.death)
_buildNodeInfo(),
const Divider(),
],

View File

@@ -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()));
}

View File

@@ -68,10 +68,9 @@ class _GalleryUnitState extends State<GalleryUnit> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: ValueListenableBuilder(
child: Column( //使用 child 属性优化
child: Column(
children: [
_buildTitle(context),
Expanded(

View File

@@ -18,6 +18,7 @@ class WidgetModel extends Equatable {
final String nameCN;
final WidgetFamily family;
final bool deprecated;
final bool death;
final List<int> 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),
);

View File

@@ -211,6 +211,7 @@ class _WidgetDetailPageState extends State<WidgetDetailPage> {
text: nodes[i].name,
subText: nodes[i].subtitle,
code: nodes[i].code,
death: _modelStack.last.death,
show: WidgetsMap.map(name)[i],
),
childCount: nodes.length,

View File

@@ -33,7 +33,7 @@ class _HomePageState extends State<HomePage>
@override
void initState() {
super.initState();
WidgetsBinding.instance?.addPostFrameCallback(_onFrameCallBack);
WidgetsBinding.instance.addPostFrameCallback(_onFrameCallBack);
}
void _onFrameCallBack(Duration timeStamp) {

View File

@@ -37,7 +37,7 @@ class TempButtonBar extends StatelessWidget {
children: <Widget>[
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: () {},

View File

@@ -30,7 +30,7 @@ class ButtonThemeDemo extends StatelessWidget {
children: <Widget>[
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)),
],
),

View File

@@ -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<CustomMonthPicker> {
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),
// ),
// );
// }
}

View File

@@ -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,

View File

@@ -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,

View File

@@ -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<CustomDayPicker> {
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()
// ),
// );
// }
}

View File

@@ -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),
// );
// }
}

View File

@@ -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"

View File

@@ -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: