Widgets for convenient to make app.
Create some widgets for easily to make app.
Features
Have a lot custom Widgets for make app.
Getting started
Use these Widgets to make app.
- TextTitle()
- TextBody()
- AppBarWidget()
- CategoryHorizontalWidget()
- CategoryVerticalWidget()
- CardSmallImageOneTitleWidget()
- CardMediumImageTwoTitleOneButtonWidget()
- ListImageTwoTitleOneButtonWidget()
Usage
import 'package:flutter/material.dart';
import 'package:flutter_example/models/category_model.dart';
import 'package:flutter_example/models/diet_model.dart';
import 'package:flutter_example/models/popular_model.dart';
import 'package:flutter_tyre/flutter_tyre.dart';
class HomeScreen extends StatefulWidget {
const HomeScreen({super.key});
@override
State<HomeScreen> createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
List<CategoryModel> categories = [];
List<DietModel> diets = [];
List<PopularDietsModel> popularDiets = [];
@override
void initState() {
super.initState();
categories = CategoryModel.getCategories();
diets = DietModel.getDiets();
popularDiets = PopularDietsModel.getPopularDiets();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBarWidget(
title: 'Boy',
action: IconButton(
onPressed: () {},
icon: const Icon(Icons.send),
),
),
body: ListView(
children: [
const TextTitle(
title: 'Text Title',
),
const TextBody(
title: 'Text Body',
),
CategoryHorizontalWidget(
title: "Hello",
itemHeight: 240,
datas: diets,
childBuilder: (data) => CardMediumImageTwoTitleOneButtonWidget(
backgroundColor: data.boxColor.withOpacity(0.4),
image: const Icon(Icons.woman),
title: data.name,
subTitle: data.calorie,
onTapped: () {
print(data.name);
},
),
),
const SizedBox(height: 40),
CategoryHorizontalWidget(
itemHeight: 120,
title: "Somethings",
datas: categories,
childBuilder: (data) => CardSmallImageOneTitleWidget(
backgroundColor: data.boxColor.withOpacity(0.7),
image: const Icon(Icons.person),
title: data.name,
onTapped: () {
print(data.name);
},
),
),
const SizedBox(height: 40),
CategoryVerticalWidget(
title: "Vertical",
datas: popularDiets,
childBuilder: (data) => ListImageTwoTitleOneButtonWidget(
title: 'Lists',
image: const Icon(Icons.outlined_flag_rounded),
subTitle: data.name,
nextButton: const Icon(Icons.send),
),
)
],
),
);
}
}
Additional information
Will update widgets go on.