-Code refactoer

master
Nikhil Vadoliya 4 years ago
parent 79f6993dac
commit 137c5ac8e2

@ -1,7 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_slider_drawer/flutter_slider_drawer.dart'; import 'package:flutter_slider_drawer/flutter_slider_drawer.dart';
import 'dart:async';
import 'main_widget.dart'; import 'main_widget.dart';
import 'menu_widget.dart'; import 'menu_widget.dart';
@ -30,26 +28,23 @@ class _MyAppState extends State<MyApp> {
return MaterialApp( return MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
home: Scaffold( home: Scaffold(
body: Padding( body: SliderMenuContainer(
padding: const EdgeInsets.only(top: 0), appBarColor: Colors.white,
child: SliderMenuContainer( key: _key,
appBarColor: Colors.white, sliderMenuOpenSize: 200,
key: _key, title: Text(
sliderMenuOpenSize: 200, title,
title: Text( style: TextStyle(fontSize: 22, fontWeight: FontWeight.w700),
title, ),
style: TextStyle(fontSize: 22, fontWeight: FontWeight.w700), sliderMenu: MenuWidget(
), onItemClick: (title) {
sliderMenu: MenuWidget( _key.currentState.closeDrawer();
onItemClick: (title) { setState(() {
_key.currentState.closeDrawer(); this.title = title;
setState(() { });
this.title = title; },
}); ),
}, sliderMain: MainWidget()),
),
sliderMain: MainWidget()),
),
), ),
); );
} }

@ -0,0 +1,15 @@
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
});
}

@ -133,7 +133,6 @@ class SliderMenuContainerState extends State<SliderMenuContainer>
animation.value, widget.sliderMenuOpenSize), animation.value, widget.sliderMenuOpenSize),
child: child, child: child,
); );
return child;
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,

Loading…
Cancel
Save