import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/TabBarWidget.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'AddWeightPage.dart'; import 'WeightMonthlyPage.dart'; import 'WeightYeaPage.dart'; import 'WeightWeeklyPage.dart'; class WeightHomePage extends StatefulWidget { @override _WeightHomePageState createState() => _WeightHomePageState(); } class _WeightHomePageState extends State with SingleTickerProviderStateMixin { TabController _tabController; @override void initState() { super.initState(); _tabController = TabController(length: 3, vsync: this); } @override void dispose() { super.dispose(); _tabController.dispose(); } @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getWeight(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).weight, baseViewModel: model, body: Scaffold( extendBodyBehindAppBar: true, appBar: TabBarWidget( tabController: _tabController, ), body: Column( children: [ Expanded( child: TabBarView( physics: BouncingScrollPhysics(), controller: _tabController, children: [ WeightWeeklyPage( model: model, ), WeightMonthlyPage( model: model, ), WeightYearPage( model: model, ) ], ), ) ], ), floatingActionButton: InkWell( onTap: () { Navigator.push(context, FadePage(page: AddWeightPage(model: model,))); }, child: Container( width: 55, height: 55, decoration: BoxDecoration( shape: BoxShape.circle, color: Theme.of(context).primaryColor, ), child: Center( child: Icon( Icons.add, color: Colors.white, ), ), ), ), ), ), ); } }