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.

56 lines
1.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_slider_drawer/flutter_slider_drawer.dart';
import 'package:fluttersliderdrawer_example/main_widget.dart';
import 'dart:async';
import 'package:fluttersliderdrawer_example/menu_widget.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
GlobalKey<SliderMenuContainerState> _key =
new GlobalKey<SliderMenuContainerState>();
5 years ago
String title;
@override
void initState() {
5 years ago
title = "Home";
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
5 years ago
debugShowCheckedModeBanner: false,
home: Scaffold(
body: SliderMenuContainer(
5 years ago
appBarColor: Colors.white,
key: _key,
5 years ago
appBarPadding: const EdgeInsets.only(top: 20),
sliderMenuOpenOffset: 250,
appBarHeight: 60,
title: Text(
title,
style: TextStyle(fontSize: 22, fontWeight: FontWeight.w700),
),
sliderMenuWidget: MenuWidget(
5 years ago
onItemClick: (title) {
_key.currentState.closeDrawer();
5 years ago
setState(() {
this.title = title;
});
},
),
sliderMainWidget: MainWidget()),
),
);
}
}