float_column 0.1.2 float_column: ^0.1.2 copied to clipboard
A Flutter package for building a vertical column of widgets and text with the ability to "float" child widgets to the left or right, similar to the functionality of CSS float and clear properties.
import 'package:flutter/material.dart';
import 'pages/basic_ltr.dart';
import 'pages/basic_rtl.dart';
import 'pages/indents.dart';
import 'pages/margins_and_padding.dart';
import 'pages/margins_and_padding2.dart';
import 'pages/multiple_paragraphs.dart';
import 'pages/nested.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'FloatColumn Demo',
theme: ThemeData(primarySwatch: Colors.blue),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
const tabViews = <Widget>[
BasicLtr(),
BasicRtl(),
Nested(),
MultipleParagraphs(),
MarginsAndPadding(),
MarginsAndPadding2(),
Indents(),
];
final tabs = tabViews.map((e) => Tab(text: e.runtimeType.toString())).toList();
return DefaultTabController(
length: tabs.length,
child: Scaffold(
appBar: AppBar(title: TabBar(tabs: tabs, isScrollable: true)),
body: const TabBarView(children: tabViews),
),
);
}
}