1

Here is what i want

enter image description here

Hello, I made a table with Flutter, I need help resizing my table INSIDE the app by dragging its corners(like in the image) and not by changing sizes in the code. I found a question like this but with an image, and I couldn't integrate that into my code correctly. Can someone help me? I'll link the question here. Creating Resizable View that resizes when pinch or drag from corners and sides in FLUTTER

Update: I also found a question like that with a table but it has private packages which I can't use, I will link it here too just in case` Create dynamic table rows in PDF document using the pdf package

And I'll put my code here.

import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget{
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: HomePage(),
    );
  }
}


class HomePage extends StatelessWidget{
  const HomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        //backgroundColor: Colors.blue[100], //background color of scaffold
        appBar: AppBar(
          //title:const Text("Flutter Table"), //title of app
          backgroundColor: Colors.white, //background color of app bar
        ),
        body: Container(
            padding: const EdgeInsets.all(15),
            child:Table(
              border: TableBorder.all(width:1, color:Colors.black45), //table border
              children: const [

                TableRow(
                    children: [
                      TableCell(
                          child: Padding(
                              padding: EdgeInsets.all(10),
                              child:Text("S/N")
                          )
                      ),
                      TableCell(
                          child: Padding(
                              padding: EdgeInsets.all(10),
                              child:Text("Name")
                          )
                      ),
                      TableCell(
                          child: Padding(
                              padding: EdgeInsets.all(10),
                              child:Text("Address")
                          )
                      ),
                      TableCell(
                          child: Padding(
                              padding: EdgeInsets.all(10),
                              child:Text("Nation")
                          )
                      )
                    ]
                ),

                TableRow(
                    children: [
                      TableCell(
                          child: Padding(
                              padding: EdgeInsets.all(10),
                              child:Text("1.")
                          )
                      ),
                      TableCell(
                          child: Padding(
                              padding: EdgeInsets.all(10),
                              child:Text("Krishna Karki")
                          )
                      ),
                      TableCell(
                          child: Padding(
                              padding: EdgeInsets.all(10),
                              child:Text("Nepal, Kathmandu")
                          )
                      ),
                      TableCell(
                          child: Padding(
                              padding: EdgeInsets.all(10),
                              child:Text("Nepal")
                          )
                      )
                    ]
                ),

                TableRow(
                    children: [
                      TableCell(
                          child: Padding(
                              padding: EdgeInsets.all(10),
                              child:Text("2.")
                          )
                      ),
                      TableCell(
                          child: Padding(
                              padding: EdgeInsets.all(10),
                              child:Text("John Wick")
                          )
                      ),
                      TableCell(
                          child: Padding(
                              padding: EdgeInsets.all(10),
                              child:Text("New York, USA")
                          )
                      ),
                      TableCell(
                          child: Padding(
                              padding: EdgeInsets.all(10),
                              child:Text("USA")
                          )
                      )
                    ]
                ),

                TableRow(
                    children: [
                      TableCell(
                          child: Padding(
                              padding: EdgeInsets.all(10),
                              child:Text("3.")
                          )
                      ),
                      TableCell(
                          child: Padding(
                              padding: EdgeInsets.all(10),
                              child:Text("Fedrick May")
                          )
                      ),
                      TableCell(
                          child: Padding(
                              padding: EdgeInsets.all(10),
                              child:Text("Berlin, Germany")
                          )
                      ),
                      TableCell(
                          child: Padding(
                              padding: EdgeInsets.all(10),
                              child:Text("Germany")
                          )
                      )
                    ]
                ),
              ],)
        )
    );
  }
}

Here is how it looks` enter image description here

0 Answers0