flutter_zoom_drawer 1.0.4+1 copy "flutter_zoom_drawer: ^1.0.4+1" to clipboard
flutter_zoom_drawer: ^1.0.4+1 copied to clipboard

outdated

A Flutter package with custom implementation of the Side Menu (Drawer)

example/lib/main.dart

import 'dart:ui' as ui;

import 'package:easy_localization/easy_localization.dart';
import 'package:example/home_screen.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:provider/provider.dart';

void main() => runApp(EasyLocalization(
      child: MyApp(),
      path: 'assets/langs',
      supportedLocales: MyApp.list,
      useOnlyLangCode: true,
    ));

class MyApp extends StatelessWidget {
  static const list = [
    Locale('en', 'US'),
    Locale('ar', 'TN'),
  ];

  @override
  Widget build(BuildContext context) {
    final windowLocale = ui.window.locale;
    Locale locale;
    try {
      final first = MyApp.list
          ?.firstWhere((l) => l?.languageCode == windowLocale?.languageCode);
      locale = first != null ? first : Locale('en', 'US');
    } catch (e) {
      print(e);
    }

    return MaterialApp(
      title: 'Flutter Zoom Drawer Demo',
      onGenerateTitle: (context) => tr("app_name"),
      debugShowCheckedModeBanner: false,
      localizationsDelegates: [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        //app-specific localization
        EasyLocalization
            .of(context)
            .delegate,
      ],
      supportedLocales: EasyLocalization
          .of(context)
          .supportedLocales,
      locale: locale,
      theme: ThemeData(
        primarySwatch: Colors.deepPurple,
        accentColor: Colors.deepPurpleAccent,
      ),
      home: ChangeNotifierProvider(
        create: (_) => MenuProvider(),
        child: HomeScreen(),
      ),
    );
  }
}
1003
likes
0
pub points
98%
popularity

Publisher

verified publishermedyas.ml

A Flutter package with custom implementation of the Side Menu (Drawer)

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_zoom_drawer