Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

517
Views
¿Cómo colocar dos switchListTIles uno al lado del otro, como en una fila en flutter?

Quería hacer 2 cosas en flutter:

  1. cambie el espacio entre el título y el interruptor de un switchlisttile().
  2. coloque dos switchlistTiles uno al lado del otro en una fila. Por alguna razón, esto da un error en flutter.

Gracias.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

al dar altura, no tengo ningún error, solo un intento de demostración, podría ayudar a importar 'paquete: aleteo/material.dart';

 void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: const MyHomePage(title: 'Flutter Demo Home Page'), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({Key? key, required this.title}) : super(key: key); final String title; @override State<MyHomePage> createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { int _counter = 0; double ?height ; double ?width ; void _incrementCounter() { setState(() { _counter++; }); } @override Widget build(BuildContext context) { height = MediaQuery.of(context).size.height; width = MediaQuery.of(context).size.width; bool ans = false; bool anss = false; return Scaffold( appBar: AppBar( title: Text(widget.title), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Row( children: [ Container( height: height!/10, width: width!/2, child: SwitchListTile( title: const Text('Lights'), value: ans, onChanged: (bool value) { setState(() { ans = value; }); }, secondary: const Icon(Icons.lightbulb_outline), ), ), Container( height: height!/10, width: width!/2, child: SwitchListTile( title: const Text('hhh'), value: anss, onChanged: (bool value) { setState(() { anss = value; }); }, secondary: const Icon(Icons.lightbulb_outline), ), ) ], ), ], ), ), // This trailing comma makes auto-formatting nicer for build methods. ); } }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!