Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with RTL locale #55

Open
paurakhsharma opened this issue Nov 19, 2020 · 0 comments
Open

Doesn't work with RTL locale #55

paurakhsharma opened this issue Nov 19, 2020 · 0 comments

Comments

@paurakhsharma
Copy link

It doesn't work (leftChild, rightChild slide doesn't work) when I use a RTL locale.

import 'package:flutter/material.dart';
import 'package:flutter_inner_drawer/inner_drawer.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      supportedLocales: [
        Locale('ar'),
        Locale('en', 'GB')
      ],
      localizationsDelegates: [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
      ],
      locale: Locale('ar'),
      home: HomeScreen(),
    );
  }
}

class HomeScreen extends StatelessWidget {
  //  Current State of InnerDrawerState
  final GlobalKey<InnerDrawerState> _innerDrawerKey =
      GlobalKey<InnerDrawerState>();

  @override
  Widget build(BuildContext context) {
    return InnerDrawer(
        key: _innerDrawerKey,
        onTapClose: true,
        swipe: true,
        swipeChild: true,
        offset: IDOffset.only(
          right: 0.60,
          left: 0.60,
        ),
        leftAnimationType: InnerDrawerAnimation.static,
        rightAnimationType: InnerDrawerAnimation.quadratic,
        backgroundDecoration: BoxDecoration(
          color: Colors.white,
        ),
        leftChild: Container(
          color: Colors.red,
        ),
        rightChild: Container(
          padding: const EdgeInsets.all(8.0),
          color: Colors.green,
        ),
        scaffold: Scaffold(
          body: Container(
            constraints: BoxConstraints.expand(),
            color: Colors.teal,
            child: Center(child: Text('center')),
          ),
        ),
      );
  }
}

If I change locale: Locale('ar'), to locale: Locale('en', 'GB'), it works just fine.

Any idea how I can get child sliders to work with RTL language?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants