Skip to main content

Flutter Create StrikeThrough Text - LineThrough

We all have seen LineThrough text Looks like 5$ in many web apps and mobile apps. The main purpose of StrikeThrough text is to show discounted price of a item. In flutter to create StrikeThrough text we have to use TextDecoration.lineThrough .

Flutter Create StrikeThrough Text - LineThrough:

import 'package:flutter/material.dart';

void main() => runApp(const App());

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

  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
          body: Center(
              child: Text(
        'StrikeThrough Text in Flutter',
style: TextStyle( fontSize: 34, decoration: TextDecoration.lineThrough, decorationColor:, decorationThickness: 1.8, ), ))), ); } }
Flutter Create StrikeThrough Text