0
votes

L'icône de hamburger de tiroir à flotteur n'est pas montrant quand j'ai du hasard la directionnalité

J'essaie de faire mon application RTL et je veux que le tiroir soit sur le côté droit. J'ai réussi à l'ouvrir à partir de la bonne direction, mais l'icône du menu Hamburger a disparu.

Ceci est code pour créer la mise en page rtl : xxx

Et ceci est mon tiroir: xxx

Qu'est-ce que je manque?


1 commentaires

Pouvez-vous envoyer du code de l'échafaud où vous utilisez ce tiroir?


3 Réponses :


0
votes

sortie: strong>

 Entrez la description de l'image ici p>


Code complet: strong> p >

import 'package:flutter/material.dart';

void main() {
  runApp(
    MaterialApp(
      home: Directionality(
        child: MyPage(),
        textDirection: TextDirection.rtl, // setting rtl
      ),
    ),
  );
}

class MyPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      drawer: Drawer(), // your drawer
    );
  }
}


2 commentaires

Ne transmettez aucun enfant à tiroir et vérifier si cela fonctionne.


Toujours le même !



0
votes

Si vous ne voulez pas changer votre code. Ensuite, vous pouvez faire comme suit,

    leading: IconButton(icon: Icon(Icons.arrow_back), onPressed: (){
      Navigator.of(context).pop();
    }),


0 commentaires

1
votes

Enveloppez votre widget enfant à la maison avec directionnalité code> à l'aide de textdirection.rtl code>

 Entrez la description de l'image ici P>

    import 'package:flutter/material.dart';

    class DrawerLayoutApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
        return new MaterialApp(
            title: "My Apps",
            theme: new ThemeData(
                fontFamily: "Vazir",
                primaryColor: Color(0xff075e54),
                accentColor: Color(0xff25d366),
                primaryIconTheme: new IconThemeData(color: Colors.white)
            ),
            home: new Directionality(textDirection: TextDirection.rtl, child: new DrawerLayoutAppBody())
        );
    }
    }

    class DrawerLayoutAppBody extends StatefulWidget {
    @override
    State<StatefulWidget> createState() => new DrawerLayoutAppBodyState();
    }

    class DrawerLayoutAppBodyState extends State<DrawerLayoutAppBody>{
    TextStyle listTileTextStyle = new TextStyle(
        color: Colors.black,
        fontWeight: FontWeight.bold,
        fontSize: 18
    );

    @override
    Widget build(BuildContext context) {
        return new Scaffold(
        appBar: new AppBar(
            title: new Text("برنامه های من")
        ),
        drawer: new Drawer(
            child: new ListView(
            children: <Widget>[
                new Container(
                    height: 120,
                    child: new DrawerHeader(
                    padding: EdgeInsets.zero,
                    child: new Container(
                        decoration: new BoxDecoration(
                            gradient: new LinearGradient(
                                colors: <Color>[
                                Theme.of(context).primaryColor,
                                const Color(0xff05433c),
                                ],
                                begin: Alignment.topCenter,
                                end:  Alignment.bottomCenter
                            )
                        ),

                    )
                    )
                ),
                new ListTile(
                leading: new Icon(Icons.map, color: Colors.black),
                title: new Text(
                    'گوگل مپ',
                    style: listTileTextStyle
                ),
                onTap: (){

                },
                ),

            ]
            )
        ),
        );
    }
    }


0 commentaires