如何自定义Flutter TabBar中的Tab指示器以达到下面的目标结果?
我该如何执行以下操作:
这是我的代码
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
var categoryTabs = <Tab>[...];
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: categoryTabs.length,
child: Scaffold(
appBar: AppBar(
title: Text('My App'),
centerTitle: true,
bottom: PreferredSize(
preferredSize: Size(100, 70),
child: Column(
children: [
TabBar(
indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.transparent,
labelColor: colorPrimaryDark,
isScrollable: true,
unselectedLabelColor: Colors.white,
indicator: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: Colors.white,
),
tabs: categoryTabs,
),
SizedBox(height: 10)
],
), …Run Code Online (Sandbox Code Playgroud) 当我尝试创建 React Native 项目版本 0.59.9 时,出现以下错误
错误错误:无法在“react-native”模板中找到“/var/folders/zc/h93bvpb573q24_5ynvgkn1wc0000gn/T/rncli-init-template-0YT6FZ/node_modules/react-native/template.config.js 文件。请制作确保模板有效。
我该如何解决这个问题?
我使用的命令是npx react-native init Awesome --version 0.59.9
我该如何解决这个问题,其原因可能是什么?
这也是终端的屏幕截图
谢谢