You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
1.9 KiB
82 lines
1.9 KiB
4 years ago
|
// BEGIN scaffold
|
||
4 years ago
|
import 'package:ansu_ui/ansu_ui.dart';
|
||
4 years ago
|
import 'package:example/codeviewer/code_segments.dart';
|
||
|
import 'package:example/common/code_view.dart';
|
||
4 years ago
|
import 'package:flutter/material.dart';
|
||
4 years ago
|
import 'package:get/get.dart';
|
||
4 years ago
|
|
||
|
class ExampleScaffold extends StatefulWidget {
|
||
|
ExampleScaffold({Key key}) : super(key: key);
|
||
|
|
||
|
@override
|
||
|
_ExampleScaffoldState createState() => _ExampleScaffoldState();
|
||
|
}
|
||
|
|
||
4 years ago
|
class _ExampleScaffoldState extends State<ExampleScaffold>
|
||
|
with TickerProviderStateMixin {
|
||
|
TabController _tabController;
|
||
|
List<String> tabs;
|
||
|
|
||
|
@override
|
||
|
void initState() {
|
||
|
super.initState();
|
||
|
tabs = List.generate(10, (index) => 'Tab $index');
|
||
|
_tabController = TabController(
|
||
|
length: tabs.length,
|
||
|
vsync: this,
|
||
|
);
|
||
|
}
|
||
|
|
||
4 years ago
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return ASScaffold(
|
||
4 years ago
|
title: '框架 Scaffold',
|
||
4 years ago
|
actions: [
|
||
|
IconButton(
|
||
|
icon: Icon(
|
||
|
Icons.code,
|
||
|
color: Colors.black54,
|
||
|
),
|
||
|
onPressed: () => Get.to(
|
||
|
CodeView(
|
||
|
text: (context) => CodeSegments.scaffold(context),
|
||
|
),
|
||
|
),
|
||
|
)
|
||
|
],
|
||
4 years ago
|
appBarBottom: ASTabBar(
|
||
|
items: tabs,
|
||
|
isScrollable: true,
|
||
|
controller: _tabController,
|
||
|
),
|
||
4 years ago
|
body: ListView(
|
||
|
children: [
|
||
|
Builder(
|
||
|
builder: (context) {
|
||
|
return TextButton(
|
||
|
onPressed: () {
|
||
|
Scaffold.of(context).openEndDrawer();
|
||
|
},
|
||
|
child: Text('open drawer'),
|
||
|
);
|
||
|
},
|
||
4 years ago
|
),
|
||
|
TextButton(
|
||
|
onPressed: () {
|
||
|
Get.dialog(
|
||
|
ASScaffold(
|
||
|
title: '框架 Scaffold',
|
||
|
),
|
||
|
useSafeArea: false,
|
||
|
);
|
||
|
},
|
||
|
child: Text('open drawer'),
|
||
|
),
|
||
4 years ago
|
],
|
||
|
),
|
||
4 years ago
|
);
|
||
|
}
|
||
|
}
|
||
4 years ago
|
|
||
|
// END
|