import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/pages/settings/profile_setting.dart'; import 'package:diplomaticquarterapp/pages/settings/general_setting.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/arrow_back.dart'; import 'package:flutter/material.dart'; class Settings extends StatefulWidget { final int type; Settings({this.type = 0}); @override _Settings createState() => _Settings(); } class _Settings extends State with TickerProviderStateMixin { TabController _tabController; @override void initState() { _tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type); if (widget.type == 1) { _tabController.animateTo(1); } super.initState(); } @override Widget build(BuildContext context) { AppGlobal.context = context; return Scaffold( appBar: AppBar( bottom: TabBar( // isScrollable: true, indicatorWeight: 5.0, //indicatorSize: TabBarIndicatorSize.label, // indicatorSize: TabBarIndicatorSize.tab, indicatorColor: Theme.of(context).primaryColor, // labelColor: Theme.of(context).primaryColor, tabs: [ Tab(text: TranslationBase.of(context).general), Tab( text: TranslationBase.of(context).profile, ) ], controller: _tabController, ), title: Text(TranslationBase.of(context).settings, style: TextStyle(color: Theme.of(context).textTheme.bodyText2.color)), leading: Builder( builder: (BuildContext context) { return ArrowBack(); }, ), ), body: TabBarView( physics: NeverScrollableScrollPhysics(), children: [GeneralSettings(), ProfileSettings()], controller: _tabController), ); } }