0

How to add a text to an image in flutter web How do I add text on the go to an image on flutter web? Is there widget for image editing. How can we achieve this?

2

2 Answers 2

2

You can use either custom painting (other answer found by @F-1) or stack other widget on top of your image (here is excellent example, with text on top of images as you might want.

Sign up to request clarification or add additional context in comments.

Comments

2
  import 'package:flutter/material.dart';

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

class MyApp  extends StatelessWidget {
 @override
 Widget build(BuildContext context) {
  // TODO: implement build
  return MaterialApp(
   home: Scaffold(
     appBar: AppBar(
       title: Text("Add Text to an Image"),
     ),
     body:Container(
      margin: EdgeInsets.only(top: 50.0),
      child: Stack(
        children: <Widget>[
           Image.network("http://www.panama-offshore-services.com/wp- 
      content/uploads/2014/08/Tech-business-panama.jpg"),
          Container(
            margin: EdgeInsets.only(top:20.0),
          ),
          Text("This is text",
            style: TextStyle(
                color: Colors.red,
                fontSize: 18.0
            ),)
           ],
        ),
       )
      ),
     );
    }

    }







  // use stack to add text on image 

1 Comment

Would you be capable of saving this image with the text?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.