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.

90 lines
2.3 KiB

import 'package:ansu_ui/ansu_ui.dart';
import 'package:example/main_extention.dart';
import 'package:example/main_home.dart';
4 years ago
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:get/get.dart';
4 years ago
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetMaterialApp(
4 years ago
title: 'Flutter Demo',
home: _ScreenAdapter(),
builder: BotToastInit(),
navigatorObservers: [BotToastNavigatorObserver()],
localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: [
const Locale('zh'),
],
4 years ago
);
}
}
class _ScreenAdapter extends StatelessWidget {
@override
Widget build(BuildContext context) {
ScreenUtil.init(context,
designSize: Size(375, 812), allowFontScaling: false);
return MyHomePage();
}
}
4 years ago
class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);
4 years ago
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
TabController _tabController;
@override
void initState() {
super.initState();
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light.copyWith(
statusBarColor: Colors.transparent,
));
_tabController = TabController(length: 2, vsync: this);
}
4 years ago
@override
Widget build(BuildContext context) {
4 years ago
return ASScaffold(
4 years ago
leading: navigator.canPop()
? IconButton(
icon: Icon(Icons.backpack, color: Colors.black),
onPressed: () {},
)
: SizedBox(),
4 years ago
title: '安速组件',
body: TabBarView(
controller: _tabController,
4 years ago
children: [
MainHome(),
MainExtention(),
],
),
bottomNavigationBar: ASNavigationBar(
controller: _tabController,
items: [
BottomNavigationBarItem(icon: Icon(Icons.home), label: 'HOME'),
BottomNavigationBarItem(
icon: Icon(Icons.extension), label: 'EXTENSION'),
],
4 years ago
),
);
}
}