|
|
@ -1,5 +1,8 @@
|
|
|
|
import 'package:ansu_ui/ansu_ui.dart';
|
|
|
|
import 'package:ansu_ui/ansu_ui.dart';
|
|
|
|
|
|
|
|
import 'package:example/codeviewer/code_segments.dart';
|
|
|
|
|
|
|
|
import 'package:example/common/code_view.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class ExampleTabBar extends StatefulWidget {
|
|
|
|
class ExampleTabBar extends StatefulWidget {
|
|
|
|
ExampleTabBar({Key key}) : super(key: key);
|
|
|
|
ExampleTabBar({Key key}) : super(key: key);
|
|
|
@ -36,11 +39,23 @@ class _ExampleTabBarState extends State<ExampleTabBar>
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return ASScaffold(
|
|
|
|
return ASScaffold(
|
|
|
|
title: '选项卡 TabBar',
|
|
|
|
title: '选项卡 TabBar',
|
|
|
|
|
|
|
|
actions: [
|
|
|
|
|
|
|
|
IconButton(
|
|
|
|
|
|
|
|
icon: Icon(
|
|
|
|
|
|
|
|
Icons.code,
|
|
|
|
|
|
|
|
color: Colors.black54,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
onPressed: () => Get.to(
|
|
|
|
|
|
|
|
CodeView(text: (context) => CodeSegments.tabBar(context)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
body: Material(
|
|
|
|
body: Material(
|
|
|
|
color: kForegroundColor,
|
|
|
|
color: kForegroundColor,
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
|
|
|
|
// BEGIN tabBar
|
|
|
|
ASTabBar(
|
|
|
|
ASTabBar(
|
|
|
|
items: ['全部', 'Part1', 'Part2'],
|
|
|
|
items: ['全部', 'Part1', 'Part2'],
|
|
|
|
controller: _tabController1,
|
|
|
|
controller: _tabController1,
|
|
|
@ -61,6 +76,8 @@ class _ExampleTabBarState extends State<ExampleTabBar>
|
|
|
|
.toList(),
|
|
|
|
.toList(),
|
|
|
|
controller: _tabController4,
|
|
|
|
controller: _tabController4,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// END
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|