Luego de tanto batallar ya dimos con el arreglo de este inconveniente que tantos usuarios de nuestra web presentan. Si deseas compartir algún dato no dudes en compartir tu comentario.
Ejemplo 1: pantalla completa de diálogo modal de flutter
showDialog( context: context, builder:(BuildContext context)returnDialog( shape:RoundedRectangleBorder( borderRadius: BorderRadius.circular(20.0)),//this right here child: Container( height: 200, child: Padding( padding: const EdgeInsets.all(12.0), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ TextField( decoration: InputDecoration( border: InputBorder.none, hintText: 'What do you want to remember?'), ), SizedBox( width: 320.0, child: RaisedButton( onPressed: () , child: Text( "Save", style: TextStyle(color: Colors.white), ), color: const Color(0xFF1BC0C5), ), ) ], ), ), ), ); );
Ejemplo 2: pantalla completa de diálogo modal de flutter
showGeneralDialog( context: context, barrierDismissible:true, barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel, barrierColor: Colors.black45, transitionDuration:constDuration(milliseconds:200), pageBuilder:(BuildContext buildContext, Animation animation, Animation secondaryAnimation)returnCenter( child:Container( width: MediaQuery.of(context).size.width -10, height: MediaQuery.of(context).size.height -80, padding: EdgeInsets.all(20), color: Colors.white, child:Column( children:[RaisedButton( onPressed:() Navigator.of(context).pop();, child:Text("Save", style:TextStyle(color: Colors.white),), color:constColor(0xFF1BC0C5),)],),),););
Ejemplo 3: agregar modal de pantalla completa en una página en la aplicación flutter
import'package:flutter/material.dart';classTutorialOverlayextendsModalRoute<void>
Duration get transitionDuration =>Duration(milliseconds:500);
bool get opaque =>false;
bool get barrierDismissible =>false;
Color get barrierColor => Colors.black.withOpacity(0.5);
String get barrierLabel =>null;
bool get maintainState =>true;
Widget buildPage(
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,)// This makes sure that text and other content follows the material stylereturnMaterial(
type: MaterialType.transparency,// make sure that the overlay content is not cut off
child:SafeArea(
child:_buildOverlayContent(context),),);
Widget _buildOverlayContent(BuildContext context)returnCenter(
child:Column(
mainAxisSize: MainAxisSize.min,
children:<Widget>[Text('This is a nice overlay',
style:TextStyle(color: Colors.white, fontSize:30.0),),RaisedButton(
onPressed:()=> Navigator.pop(context),
child:Text('Dismiss'),)],),);
Widget buildTransitions(
BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child)// You can add your own animations for the overlay contentreturnFadeTransition(
opacity: animation,
child:ScaleTransition(
scale: animation,
child: child,),);// Example application:voidmain()=>runApp(MyApp());classMyAppextendsStatelessWidget
Widget build(BuildContext context)returnMaterialApp(
title:'Flutter Playground',
home:TestPage(),);classTestPageextendsStatelessWidgetvoid_showOverlay(BuildContext context)
Navigator.of(context).push(TutorialOverlay());
Widget build(BuildContext context)returnScaffold(
appBar:AppBar(title:Text('Test')),
body:Padding(
padding: EdgeInsets.all(16.0),
child:Center(
child:RaisedButton(
onPressed:()=>_showOverlay(context),
child:Text('Show Overlay'),),),),);
Aquí puedes ver las reseñas y valoraciones de los lectores
Puedes añadir valor a nuestra información añadiendo tu experiencia en las interpretaciones.
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)