You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
diplomatic-quarter/lib/pages/settings/settings.dart

76 lines
2.1 KiB
Dart

import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/pages/settings/general_setting.dart';
import 'package:diplomaticquarterapp/pages/settings/profile_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<Settings> with TickerProviderStateMixin {
TabController _tabController;
@override
void initState() {
_tabController =
new TabController(length: 2, vsync: this, initialIndex: widget.type);
if (widget.type == 1) {
4 years ago
_tabController.animateTo(1);
}
super.initState();
}
@override
Widget build(BuildContext context) {
AppGlobal.context = context;
return Scaffold(
appBar: AppBar(
3 years ago
actions: [
IconButton(
icon: Icon(Icons.info, color: Colors.white),
onPressed: () {
//openInfoPage()
},
)
],
bottom: TabBar(
4 years ago
// 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,
3 years ago
style: TextStyle(color: Colors.white)),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack();
},
),
),
body: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [GeneralSettings(), ProfileSettings()],
controller: _tabController),
);
}
}