mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-06-18 03:10:14 +08:00
Modify:修正 bottomNavigationBar
iconButton 警告
This commit is contained in:
File diff suppressed because one or more lines are too long
@ -18,13 +18,16 @@ class WidgetDemo extends StatefulWidget {
|
|||||||
final String docUrl;
|
final String docUrl;
|
||||||
final String title;
|
final String title;
|
||||||
final String codeUrl;
|
final String codeUrl;
|
||||||
|
final Widget bottomNaviBar;
|
||||||
|
|
||||||
WidgetDemo(
|
WidgetDemo(
|
||||||
{Key key,
|
{Key key,
|
||||||
@required this.title,
|
@required this.title,
|
||||||
@required this.contentList,
|
@required this.contentList,
|
||||||
@required this.codeUrl,
|
@required this.codeUrl,
|
||||||
@required this.docUrl})
|
@required this.docUrl,
|
||||||
|
this.bottomNaviBar
|
||||||
|
})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|
||||||
_WidgetDemoState createState() => _WidgetDemoState();
|
_WidgetDemoState createState() => _WidgetDemoState();
|
||||||
@ -207,6 +210,8 @@ class _WidgetDemoState extends State<WidgetDemo> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
bottomNavigationBar: (widget.bottomNaviBar is Widget) ? widget
|
||||||
|
.bottomNaviBar : null
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ class _DemoState extends State<Demo> {
|
|||||||
codeUrl: 'components/Navigation/BottomNavigationBar/demo.dart',
|
codeUrl: 'components/Navigation/BottomNavigationBar/demo.dart',
|
||||||
contentList: [allDemoBoxs(context, this)],
|
contentList: [allDemoBoxs(context, this)],
|
||||||
docUrl: 'https://docs.flutter.io/flutter/material/BottomNavigationBar-class.html',
|
docUrl: 'https://docs.flutter.io/flutter/material/BottomNavigationBar-class.html',
|
||||||
//bottomNaviBar:BottomNavigationBarDemo.BottomNavigationBarFullDefault()
|
bottomNaviBar:BottomNavigationBarDemo.BottomNavigationBarFullDefault()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import 'dart:math';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_rookie_book/common/iconNames.dart';
|
import 'package:flutter_rookie_book/common/iconNames.dart';
|
||||||
|
|
||||||
final int len = IconNames.Names.length;
|
final int len = IconNames.names.length;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* IconButton 默认按钮的实例
|
* IconButton 默认按钮的实例
|
||||||
@ -56,7 +56,7 @@ class IconButtonCustom extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final int iconIndex = Random.secure().nextInt(len);
|
final int iconIndex = Random.secure().nextInt(len);
|
||||||
final IconData type = IconNames.Names[iconIndex];
|
final IconData type = IconNames.names[iconIndex];
|
||||||
final _onPressed = onPressed;
|
final _onPressed = onPressed;
|
||||||
return IconButton(
|
return IconButton(
|
||||||
// 定义图标在IconButton中的定位方式,AlignmentGeometry 如果父Widget尺寸大于child Widget尺寸,这个属性设置会起作用,有很多种对齐方式。
|
// 定义图标在IconButton中的定位方式,AlignmentGeometry 如果父Widget尺寸大于child Widget尺寸,这个属性设置会起作用,有很多种对齐方式。
|
||||||
|
Reference in New Issue
Block a user