gapx 0.0.1 copy "gapx: ^0.0.1" to clipboard
gapx: ^0.0.1 copied to clipboard

A smart, ScreenUtil-aware spacing widget for Flutter that replaces SizedBox and automatically adapts to Row, Column, and Flex layouts.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gapx/gapx.dart';
void main() {
  runApp(const MyApp());
}

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
     return ScreenUtilInit(
        designSize: const Size(360, 690),
      minTextAdapt: true,
      splitScreenMode: true,
      builder: (_,child){
        return MaterialApp(
          debugShowCheckedModeBanner: false,
          home: GapxDemo(),
        );
      },
     );

  }
}

class GapxDemo extends StatelessWidget{
  Widget build(BuildContext context){
    return Scaffold(
      backgroundColor: Colors.amberAccent,
      body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.center,
children: [

//For Column
Column(
  children: [
      Container(
        color: Colors.red,
      padding: EdgeInsets.all(8.sp),
        child: Text("First Column Text")),
  Gapx(10),
   Container(
        color: Colors.green,
      padding: EdgeInsets.all(8.sp),
        child: Text("Second Column Text")),
  ],
),
Gapx(20),
///For Row
Row(
  mainAxisAlignment: MainAxisAlignment.center,
  crossAxisAlignment: CrossAxisAlignment.center,
  children: [
Container(
        color: Colors.red,
      padding: EdgeInsets.all(8.sp),
        child: Text("First Column Text")),
  Gapx(20),
   Container(
        color: Colors.green,
      padding: EdgeInsets.all(8.sp),
        child: Text("Second Column Text")),
  ],
)
],
      ),
    );
  }
}
1
likes
160
points
129
downloads

Publisher

unverified uploader

Weekly Downloads

A smart, ScreenUtil-aware spacing widget for Flutter that replaces SizedBox and automatically adapts to Row, Column, and Flex layouts.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_screenutil

More

Packages that depend on gapx