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

56 lines
1.6 KiB
Dart

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<Settings> with TickerProviderStateMixin {
TabController _tabController;
@override
void initState() {
_tabController =
new TabController(length: 2, vsync: this, initialIndex: widget.type);
super.initState();
}
@override
Widget build(BuildContext context) {
AppGlobal.context = context;
return Scaffold(
appBar: AppBar(
bottom: TabBar(
tabs: [
Tab(text: TranslationBase.of(context).general),
Tab(
text: TranslationBase.of(context).profile,
)
],
controller: _tabController,
),
title: Text(TranslationBase.of(context).settings,
style: TextStyle(color: Colors.white)),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack();
},
),
),
body: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [GeneralSettings(), ProfileSettings()],
controller: _tabController),
);
}
}